Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Insert statement

Hi Experts ,

I have a reqment to connect to remote database with entry maintained in DBCON table .I am replacing the open SQL with kind of native SQL thru classes

I am making use of instances of Cl_SQL_CONNECTION and its related classes .

I am finding a problem with the insert statement .

the earlier program used to be

insert into zabcd values wa_insert.

Now for DB2 remote connectivity , I replac the insert with

concatenate

'insert into' c_tabname 'values ('''wa_insert-f1,'''wa_abcd-f2'','''wa_insert-f3'')'

into l_stmt separated by space.

and then i pass this l_stmt to the l_prepstmt_ref which is an instance of cl_sql_prepared_statement

l_prepstmt_ref->execute_update( l_stmt ).

Now my problem is

if i write insert like

'insert into' c_tabname 'values ('''wa_insert''')' into l_stmt seperated by space .

SQL0117N The number of values assigned is not the same as the number of specified or implied columns.

Is there anyway to pass like above .

Tags:
Not what you were looking for? View more on this topic or Ask a question