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

Native SQL

Former Member
0 Likes
956

Hi Experts,

Need help in rewriting the below Open SQL to Native SQL using DB cursor for opening, fetching and Closing to capture the runtime errors occured.

If not itab1[] is initial.

Select gl_sirid ryear poper rprctr sgtxt ps_psp_nr

from glpca

appending table i_itab2 package size 1000

for all entries in itab1

where kokrs = itab1-kokrs

and ryear = p_year "Parameter

and rprctr = itab1-prctr

and rvers = c_per_ver "Constant with value = '000'

and racct in s_racct. "Select-option

endselect.

endif.

Thanks in Advance.

8 REPLIES 8
Read only

Former Member
0 Likes
923

since you have a SELECT-OPTION, it would be very difficult to convert this to native SQL.

But why do you want to do this??

Rob

Read only

0 Likes
923

After more than 6 hours the batch job is timing out without any short dump traces. Wanted to capture the

reason for short dump.

Read only

0 Likes
923

Well, I think you should stick with trying to analyze the open SQL code. Since there is no dump, is there any system log message? You will have to look at the log on the server where the program ran.

Rob

Read only

Former Member
0 Likes
923

If your purpose is to find out what the OpenSQL is being translated to, you can run ST05 and capture the SQL in a trace. Then you can use the Explain Plan function to see what it is doing.

Read only

Former Member
0 Likes
923

Tried ST05 to analyze the error but its not getting captured. To capture the exact reason for the error only the Native SQL catch can help .

Read only

0 Likes
923

You could run program RSDB0004, then navigate to "SQL Statement Analysis" and "Shared Cursor Cache" to view the actual Native SQL there.

If you are on Oracle, you could look in the Oracle trace files or dump files.

Read only

0 Likes
923

Where can i find SQL Statment Analysis after executing the program RSDB0004 ?

Read only

0 Likes
923

In my system it is under the "Performance" folder.