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

INSERT at dbtab values wa

Former Member
0 Likes
1,241

Hi Experts,

Is there a way to insert a record into db table using a wa, at a specific index of the table.

I am adding a record to a db table. However the system adds it at the last. I want to add this record at third position from the start.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,184

There is no way you can add a record at a particular index in DB.

The data can be sorted according to the key though.

6 REPLIES 6
Read only

Former Member
0 Likes
1,185

There is no way you can add a record at a particular index in DB.

The data can be sorted according to the key though.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,184

Hello Kirti,

To extend what Shambu has already mentioned - in a Relational DBMS there is no pre-defined sort order & consequently no first & last records!

The sorting can be done programmatically using ORDER BY(at DB level) or SORT command.

BR,

Suhas

Read only

former_member386202
Active Contributor
0 Likes
1,184

Hi,

Check F1 hel og INSERT or select key fields first from table using index and then update that record using UPDATE or MODIFY statement.

Regards,

Prashant    

Read only

Dhivya
Active Participant
0 Likes
1,184

Hi Kirti,

1. Read all the entries from DB Table.

2. Store the value in Internal Table.

3. Update the Internal Table by inserting ur value in wa table.

4. Insert all the values into the DB table.

But i think it will lead to performance issue.

Thanks.,

Dhivya.

Read only

Former Member
0 Likes
1,184

Thank you all for prompt replies. However, I do agree with Shambhu. I couldn't find any way to insert at a specific index in DB table.

Prashant I tried F1 help however, not much use for my case.

Suhas, thanks but the orderby also wud not work here.

Dhivya, I cannot do so as I have to add a record in idoc table which wud lead to huge performance issues.

Thank you all.

Read only

0 Likes
1,184

I think there is room for misunderstanding here. If you would tell us more about your actual requirement, the involved DB table (EDID4?) and give a detailed example with data, then there might be a chance to help, e.g. by suggesting alternative ways.

Thomas