‎2009 Dec 18 6:57 PM
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
‎2009 Dec 18 7:31 PM
My gues is that they are on two different databases (Oracle/DB2??)
Rob
‎2009 Dec 18 7:31 PM
My gues is that they are on two different databases (Oracle/DB2??)
Rob
‎2009 Dec 18 7:32 PM
‎2009 Dec 18 8:21 PM
Hi,
Can you paste the exact statement that you used to call the databse.
Regards
Prasenjit
‎2009 Dec 18 9:04 PM
Also try to concatenate the statement before passing to the method execute_update.
Regards
‎2010 Feb 25 10:50 AM
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