简体   繁体   English

找不到UniStoredProc1:Field'_COLUMN1'(在Android上)

[英]UniStoredProc1:Field'_COLUMN1' not found (on android)

I am able to get all the fields that my stored procedure (UniStoredProc1) is supposed to receive from the SQL Server. 我能够从SQL Server获取我的存储过程(UniStoredProc1)应该接收的所有字段。 This is the stored procedure : 这是存储过程:

declare @Navadna int
...
select @Navadna = COUNT(diet) from Mytable where diet ='1';
...
select @Navadna

The query produces _COLUMN1 as the result field. 查询产生_COLUMN1作为结果字段。

Now in Delphi,with the fields editor of the UniStoredProc1 I can add all the fields in the component without a problem. 现在在Delphi中,使用UniStoredProc1的字段编辑器,我可以毫无问题地将所有字段添加到组件中。 In a classic window application everything works fine. 在经典的窗口应用程序中,一切正常。

However, when I run it on Android I get : 但是,当我在Android上运行它时,会得到:

UniStoredProc1:Field'_COLUMN1' not found. 找不到UniStoredProc1:Field'_COLUMN1'。

Honestly,I do not know what am I doing wrong. 老实说,我不知道我在做什么错。 As soon as UniConnection1 connects it tells me the mentioned field is missing from the UniStoredProc1 thou the field is there. 一旦UniConnection1连接,它就会告诉我,该字段在UniStoredProc1中丢失了。 I tried (on button click : 我尝试过(在按钮上单击:

procedure TTabbedForm.Button2Click(Sender: TObject);
begin
UniStoredProc1.Close;
UniStoredProc1.Prepare;
UniStoredProc1.ExecSQL;
UniStoredProc1.Open;
Label2.Text:=UniStoredProc1.FieldByName('__COLUMN1').AsString;
end;

But still the same result. 但是结果还是一样。 The missing field. 缺少的字段。 What am I missing ? 我想念什么? Any way to make this work ? 有什么办法使这项工作吗? (Uni components are from Universal data Access components (devart)). (Uni组件来自Universal Data Access组件(devart))。 Delphi is Tokyo. 德尔福是东京。

It seems all I had to do is alter my procedure on the server into : 看来我要做的就是将服务器上的过程更改为:

select @Navadna as dieta

Then the field got reckognised. 然后,该领域得到认可。 Alias seems to work. 别名似乎有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM