Results 1 to 2 of 2

Thread: update table

  1. #1
    Join Date
    Jul 2002
    Posts
    227

    Unanswered: update table

    I've 2 tables
    table cod with more 4000 records:

    code
    axyz-0-12345678
    axfr-0-23456789
    asdf-0-22323232
    aa3r-0-11111122
    ..............
    ..............
    and table code_id with 250 records that are also in table cod

    id
    axyz-0-12345678
    axfr-0-23456789
    ...............

    Can I update table cod with these new codes??

    code
    axyz-Z-12345678
    axfr-Z-23456789

    if cod.code=code_id.id then xxxx-Z-xxxxxxxx

    Coul you help me??
    Thanks
    Raf

  2. #2
    Join Date
    May 2002
    Posts
    29
    Raf,
    Try this update statement instead of the one u plan to use...

    UPDATE table
    SET cod.code = substr(cod.code, 1,4) || TRANSLATE( SUBSTR(cod.code, 5,3), '-0-', '-Z-' ) || SUBSTR(cod.code ,8);

    I didn't try this but should work.

    Regards
    Dinesh

Posting Permissions

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