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.
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.