简体   繁体   中英

Syntax for insert data into table in SAP BODS

I tried this to insert data into table in SAP BODS, but it seems like it won't work :

    BEGIN
       sql('TEST_DB', 'INSERT INTO TEST_CODE VALUES ({$ID_NUMBER}, {$DATE}, {$NAME}))
    END

Is there any missing syntax? I already search for the sql statement and followed them, but still can't work. Appreciate any help. Thanks.

SQL function needs two parameters . 1st is the DataStore Name and second being the query. I can't find any flaw in your sql function.May be values are not according to the datatypes of the columns. Try using SQL transform instead of SQL function ,with SQL transform you can verify the syntax too.

Try the following syntax:

BEGIN
  sql('TEST_DB', 'INSERT INTO TEST_CODE VALUES ( ([$ID_NUMBER]), ([$DATE]), ([$NAME]) ))
END

The correct syntax is

BEGIN

  sql('TEST_DB', 'INSERT INTO TEST_CODE VALUES ('|| $ID_NUMBER ||' , '||$DATE|| ' , '||$NAME||')');

END

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM