0

I am able to get all the fields that my stored procedure (UniStoredProc1) is supposed to receive from the SQL Server. 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.

Now in Delphi,with the fields editor of the UniStoredProc1 I can add all the fields in the component without a problem. In a classic window application everything works fine.

However, when I run it on Android I get :

UniStoredProc1:Field'_COLUMN1' not found.

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. 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)). Delphi is Tokyo.

4

1 回答 1

0

看来我所要做的就是将服务器上的程序更改为:

select @Navadna as dieta

然后这个领域得到了认可。别名似乎工作。

于 2017-08-14T02:08:26.757 回答