Results 1 to 2 of 2
  1. #1
    Join Date
    May 2003
    Posts
    3

    Unanswered: conversion from syb to oracle.

    Hi All,

    How to conver the following from SYBASE to ORACLE.

    UPDATE Tb_A A
    SET A.VAL1 = B.VAL1
    , A.VAL2 = B.VAL2
    FROM Tb_B B, Tb_C C
    WHERE B.id = C.id

    please throw some light on this.

    thx

  2. #2
    Join Date
    Mar 2002
    Location
    Reading, UK
    Posts
    1,137
    rewrite your update so

    UPDATE Tb_A A
    SET (A.VAL1, A.VAL2) =
    (select B.VAL1,B.VAL2
    FROM Tb_B B, Tb_C C
    WHERE B.id = C.id
    AND B.<join column> = A.<join column>
    )
    WHERE
    (A.<primary key column list>) IN
    (SELECT <column list>
    FROM Tb_B B, Tb_C C
    WHERE B.id = C.id
    )

    replace the AND B.<join column> = A.<join column>
    with whatever column you use to join A to B or C.
    You can also remove the WHERE clause at eh end if you are updating all rows in A.

    Alan

Posting Permissions

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