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

Opensql Insert statement

Former Member
0 Likes
627

Hi,

I'm currently trying to insert a record in the rsdiobjt table. If this works i have a batch of (similar) query's wich I execute as a one-time update.

In order to do so, i've made the following query:

INSERT INTO rsdiobjt (langu , opbjnm , objvers , txtsh , txtlg) VALUES ('N' ,'0PPM_QNT' , 'Kort' , 'lang John Smith').

When I try to execute the query i get the following error:

"Unable to interpret: (langu , opbjnm , objvers , txtsh , txtlg)"

"Possible causes of error: Incorrect spelling or comma error"

Can anyone tell me what the correct opensql syntax is?

thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
554

Hi

declare a workarea (wa_itab) with the same structure as of rsdiobj.

The values u want to insert are 2 be assigned to the corresponding fields in the work area.

Then use the stmt

INSERT INTO rsdiobjt VALUES wa_itab.

the fileds which r nnot reqd 2 be inserted can be left blank in the workarea.

Regards

Winnie

3 REPLIES 3
Read only

Former Member
0 Likes
554

>

> Hi,

>

> I'm currently trying to insert a record in the rsdiobjt table. If this works i have a batch of (similar) query's wich I execute as a one-time update.

> In order to do so, i've made the following query:

>

> INSERT INTO rsdiobjt (langu , opbjnm , objvers , txtsh , txtlg) VALUES ('N' ,'0PPM_QNT' , 'Kort' , 'lang John Smith').

>

> When I try to execute the query i get the following error:

> "Unable to interpret: (langu , opbjnm , objvers , txtsh , txtlg)"

> "Possible causes of error: Incorrect spelling or comma error"

>

> Can anyone tell me what the correct opensql syntax is?

>

> thanks

Hi Jong,

I think it is due to space after every field in your query.

Just try like this.

INSERT INTO rsdiobjt (langu, opbjnm, objvers, txtsh, txtlg)

VALUES ('N', '0PPM_QNT', 'Kort', 'lang John Smith').

Hope it will be useful to you.

Thanks

Nitesh

Read only

Former Member
0 Likes
554

Hi,

Use UPDATA DBTAB with SET key word

please go through the KEY word documentation for further info there you will find an example too

Regards

Ramchander Rao.k

Read only

Former Member
0 Likes
555

Hi

declare a workarea (wa_itab) with the same structure as of rsdiobj.

The values u want to insert are 2 be assigned to the corresponding fields in the work area.

Then use the stmt

INSERT INTO rsdiobjt VALUES wa_itab.

the fileds which r nnot reqd 2 be inserted can be left blank in the workarea.

Regards

Winnie