jack786
8th July 2004, 09:15
When I try to use the aliase table fields in the selectdo its giving error saying that a.dsca not declared
I tried in several ways,can any body throw some light on this

select a.dsca
from tiitm001 a
selectdo
message("%s",a.dsca)
endselect

string item.desc(30)
select a.dsca item.desc
from tiitm001 a
selectdo
message("%s",item.desc)
endselect


rgds,
jack

sachin03
8th July 2004, 10:12
Hi jack,
I tried this & it works, I don't know why, but it is working.
try assigning the value of a.dsca to item.desc using a.dsac:item.desc in the select.

string item.desc(30)
select a.dsca:item.desc
from tiitm001 a
selectdo
message("%s",item.desc)
endselect

lbencic
8th July 2004, 16:29
Reasons -
The 'alisas' in Baan are not what you expect in other languages (sure would be nice). The alias is good only for referring to the tables during the SQL syntax itself. To get the alias values outside of the SQL syntax, as shown in Sachin's example, you must 'bind' the result to a variable that is available outside the query.