0

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.

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48

3 Answers3

0

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.

Karthik
  • 691
  • 1
  • 5
  • 16
0

Try the following syntax:

BEGIN
  sql('TEST_DB', 'INSERT INTO TEST_CODE VALUES ( ([$ID_NUMBER]), ([$DATE]), ([$NAME]) ))
END
Graham
  • 7,431
  • 18
  • 59
  • 84
0

The correct syntax is:

BEGIN
    sql('TEST_DB', 'INSERT INTO TEST_CODE VALUES ('|| $ID_NUMBER ||' , '||$DATE|| ' , '||$NAME||')');
END
Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77