on 11-05-2013 5:42 PM
Hi:
I am trying to create a HANA procedure from ABAP using this:
lo_sql = cl_sql_connection=>get_connection( hanasovantazz )->create_statement( ).
DATA lo_resultset TYPE REF TO cl_sql_result_set.
lo_sql->execute_query( 'drop procedure SAPFRA.TEST; create procedure SAPFRA.TEST() as begin select * from SAPFRA."PDM"; end; ' ).
I had the error:
sql syntax error: incorrect syntax near ";": line 1 col 23 (at pos 23)
I also tried execute_ddl with the same result.
Is mandatory to do it on the ABAP side, regarding the context of the problem.
Thanks!
Hi,
to manipulate procedure, you should use lo_sql->execute_ddl ().
Regards.
YS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Split the processing as suggested above? one for drop and one for create.
>>>
data statement string.
statement = 'drop procedure "SAPFRA"' && |.| && '"TEST"'.
lo_sql->execute_query( statement ).
statement = 'create procedure "SAPFRA"' && |.| && '"TEST"' && | |
&& 'AS' && | |
&& 'begin' && | |
&& 'select * from "SAPFRA"' && |.| && '"PDM"' && |;| && | |
&& 'end' && |;|.
lo_sql->execute_query( statement ).
<<<
Try if it works.
YS
Hi Leonardo,
which release are you on? Quite soon we will offer a much better way to create procedures from ABAP. We plan to make a new feature available with SP5 for ABAP 7.4. This is called ABAP-managed database procedures.You can use methods as wrapper for SQLScript code then. That means you can write SQLScript in the method body. Might be helpful for you.
Best regards
Thorsten
Here comes new feature from SAP
Introduction into ABAP Managed Database Procedu... | SAP HANA
Implementing an ABAP Managed Database Procedure... | SAP HANA
Hi Leonardo,
This document shows you the step by step process for how to create and consume procedure in ABAP.
http://scn.sap.com/docs/DOC-41604
Regards
Raj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.