Application Development 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: 

INSERT at dbtab values wa

Former Member
0 Kudos
211

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

Former Member
0 Kudos
154

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

Former Member
0 Kudos
155

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.

0 Kudos
154

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

former_member386202
Active Contributor
0 Kudos
154

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    

Dhivya
Active Participant
0 Kudos
154

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.

Former Member
0 Kudos
154

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.

0 Kudos
154

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