lets say i have built an sql statement...
'select * from SRVACHI where ACI010 = '12' and ACI015 = '123
and ACI085 = '123' order by ACI010, ACI015, ACI085'
i then want to pull the very first row information out and examine it...
I'm doing it as such, below... but I am getting a -822 sqlcode on the fetch...
exec sql include sqlda;
exec sql
prepare s1_select from :g_sqlstmt
exec sql
exec sql describe s1_select into :sqlda using system names;
exec sql
declare c1 cursor for s1_select;
exec sql
open c1;
exec sql
fetch next from c1 using descriptor :sqlda;
what am I missing?
I intend to examine it as...
for i = 1 to sql_num;
sqlvar = sql_var(i);
if sqlname = ' ';
leave;
endif;
endfor;
'select * from SRVACHI where ACI010 = '12' and ACI015 = '123
and ACI085 = '123' order by ACI010, ACI015, ACI085'
i then want to pull the very first row information out and examine it...
I'm doing it as such, below... but I am getting a -822 sqlcode on the fetch...
exec sql include sqlda;
exec sql
prepare s1_select from :g_sqlstmt
exec sql
exec sql describe s1_select into :sqlda using system names;
exec sql
declare c1 cursor for s1_select;
exec sql
open c1;
exec sql
fetch next from c1 using descriptor :sqlda;
what am I missing?
I intend to examine it as...
for i = 1 to sql_num;
sqlvar = sql_var(i);
if sqlname = ' ';
leave;
endif;
endfor;
Comment