Skip to Content
author's profile photo Former Member
Former Member

Overwriting a record with part of same primary key

Hello Everyone,

Could anyone please give a suggestion about how to overwrite the record with part of same primary key?

I have 5 key fields.

A1

A2

A3

A4

A5

I have to overwrite the record if A5 changes with same A1 A2 A3 A4.

I cannot take off A5 as part of primary key. If I use modify or insert, its creating a new record with the new A5. But I am still having the old record in the table (with old A5), which I don't want it to be there.

Thank you,

Rushi

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 22, 2008 at 01:47 PM

    hi,

    That's right.

    u have to delete record from database table .....

    then u can add a new record...

    use delete <database_table> from table <internal_table>

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 22, 2008 at 01:16 PM

    hi,

    logically, you have to delete the old record in a separate step!

    hope this helps

    ec

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 22, 2008 at 01:16 PM

    That's right. That is the normal behavior, so you would need to manually delete the old record either before of after your insert the new one.

    Regards,

    Rich Heilman

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 22, 2008 at 01:17 PM

    Try using UPDATE...if still doesnot work then first delete the record and then insert the record..

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 22, 2008 at 01:19 PM

    Hi,

    One thing you can do, Make A5 as non key field (If possible). Then modify it.

    If not possible delete the old record and insert a new record.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.