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

CL_SQL_STATEMENT, DDL, and DML, && not expected

Former Member
0 Likes
889

Hello Gurus,

I am trying to perform a DML operation using class CL_SQL_STATEMENT, the issue is that my SQL statement is using && to do concatenations:


DATA: SQL TYPE REF TO CL_SQL_STATEMENT,
      ERR TYPE REF TO CX_SQL_EXCEPTION.

TRY.
    CREATE OBJECT SQL.
    SQL->execute_update(
    `DELETE FROM ` && DB_OWNER && `."/BI0/AFIGL_O1000"`
   ....

and I get the following error:

"&& DB_OWNER &&" is not expected

The system is SAP_BASIS 700

I copied this code in another system SAP_BASIS 710 and I do not get the error, could it be linked to the release level of SAP_BASIS ?

Points will of course be allowed.

Regards,

Thibault

Moderator message - Please do not offer points

Edited by: Rob Burbank on Dec 18, 2009 2:29 PM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
763

My gues is that they are on two different databases (Oracle/DB2??)

Rob

5 REPLIES 5
Read only

Former Member
0 Likes
764

My gues is that they are on two different databases (Oracle/DB2??)

Rob

Read only

Former Member
0 Likes
763

Hi,

No they are both on ORACLE.

Regards,

Thibault

Read only

0 Likes
763

Hi,

Can you paste the exact statement that you used to call the databse.

Regards

Prasenjit

Read only

0 Likes
763

Also try to concatenate the statement before passing to the method execute_update.

Regards

Read only

former_member183924
Active Participant
0 Likes
763

Hi Thibault,

try something like this:

TRY.
    CREATE OBJECT SQL.

      concatenate
      `DELETE FROM '` db_owner `'`                     "#EC NOTEXT
      `."/BI0/AFIGL_O1000"`
      into sql_stmt.

    SQL->execute_update( sql_stmt ).
    

see FM ORA_LOG_READ for additional help.

regards,

Steffen