Home > database >  Dynamic SQL
Dynamic SQL

Time:10-05

Is_fconditionsql=(fname='jack')
='select ls_sql f5 into: is_f5 from CBA0020 where' + is_fconditionsql
The EXECUTE IMMEDIATE: ls_sql USING sqlca;
Why my is_f5 returns null

CodePudding user response:

See SQLCODE returned value what ah?

CodePudding user response:

This kind of dynamic SQL statements, not suitable for used to write the return value of that kind of, generally applies to data definition statements
String ls_sql, ls_return
Ls_sql=as_sql

If as_sql="" then return" NULL "

//dynamic execution of
Declare my_cursor dynamic cursor for sqlsa;
Prepare sqlsa from: ls_sql;
The open dynamic my_cursor;
The fetch my_cursor into: ls_return;
The close my_cursor;

If ls_return & lt;> "" then
Return ls_return
End the if
Return "NULL"

Try this way

CodePudding user response:

Agree with the upstairs

CodePudding user response:

There is a problem please GOOGLE and BAIDU

CodePudding user response:

A little difficulty oh

CodePudding user response:

Pick up points first!
  • Related