Results 1 to 8 of 8

Thread: update command

  1. #1
    Join Date
    May 2003
    Posts
    45

    Unanswered: update command

    can we update 16 rows of one table with 16 rows of another table or do we need to use a cursor for this.

    i was using the following update for this purpose

    update individual_contact t1 set inv_postal_code=
    (select inv_postal_code from inv_contact t2 where t1.inv_postal_code=t2.inv_postal_code)

    messge 16 rows updated appears ,but it does not update.

    i have many table to do like this.so Please suggest.

    Thanx

  2. #2
    Join Date
    Jan 2004
    Posts
    99
    sounds silly but did you commit;?

  3. #3
    Join Date
    Jan 2004
    Location
    Sochaux (France)
    Posts
    55
    Originally posted by zaki_mtk
    sounds silly but did you commit;?
    +1
    Your request seems to be okay.
    Commit after you update statement.

  4. #4
    Join Date
    Apr 2004
    Location
    India
    Posts
    3

    Re: update command

    Originally posted by itsmanyam
    can we update 16 rows of one table with 16 rows of another table or do we need to use a cursor for this.

    i was using the following update for this purpose

    update individual_contact t1 set inv_postal_code=
    (select inv_postal_code from inv_contact t2 where t1.inv_postal_code=t2.inv_postal_code)

    messge 16 rows updated appears ,but it does not update.

    i have many table to do like this.so Please suggest.

    Thanx
    i think u need to use commit after an update

  5. #5
    Join Date
    May 2003
    Posts
    45

    Re: update command

    I did commit friends......
    still it does not update.

    Also after an update commad ,if you select and see you should be able to see the output with out 'commit'.

  6. #6
    Join Date
    Mar 2002
    Location
    Reading, UK
    Posts
    1,137
    It looks like your query just updates postal code to equal itself. Try joining on something other than postal code.

    Alan

  7. #7
    Join Date
    May 2003
    Posts
    45
    Thanx alan it just worked...

    i was really stupid making the join with the same column which i wanted
    to update.

  8. #8
    Join Date
    Oct 2003
    Posts
    6

    Re: update command

    Originally posted by itsmanyam
    can we update 16 rows of one table with 16 rows of another table or do we need to use a cursor for this.

    i was using the following update for this purpose

    update individual_contact t1 set inv_postal_code=
    (select inv_postal_code from inv_contact t2 where t1.inv_postal_code=t2.inv_postal_code)

    messge 16 rows updated appears ,but it does not update.

    i have many table to do like this.so Please suggest.

    Thanx
    alter that message pls do the following

    commit;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •