Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Execute a SQL string

Former Member
0 Likes
747

Define lv_sql as stext. Say lv_sql = 'select * from table1 into lt_tab where ...'

how to execute lv_sql?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
659

jacky,

break it down.. 2 3 strings..

'select' is not needed to be in the string...

direct write :

select (string1) into (string2) where (string 3)...

this line itself is executable...and how to make this!! searhc DYNAMIC SQL in SDN... you will find many wikis on this.

3 REPLIES 3
Read only

Former Member
0 Likes
659

Sounds like dynamic programming. Check the help on GENERATE SUBROUTINE POOL.

Rob

Read only

Former Member
0 Likes
660

jacky,

break it down.. 2 3 strings..

'select' is not needed to be in the string...

direct write :

select (string1) into (string2) where (string 3)...

this line itself is executable...and how to make this!! searhc DYNAMIC SQL in SDN... you will find many wikis on this.

Read only

0 Likes
659

This is exactly what i was looking for. Thank you guys so much!