Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to convert Sybase update to suite Oracle ???

Re: How to convert Sybase update to suite Oracle ???

From: DA Morgan <damorgan_at_psoug.org>
Date: Fri, 01 Jul 2005 15:42:38 -0700
Message-ID: <1120257764.948848@yasure>


vipra wrote:
> Hi, what is the equivalent oracle DML for the below mentioned sybase one,
>
> update Table1
> set a.column3 = b.value3,
> a.column4 = b.value4,
> a.column5 = b.value5,
> a.column6 = b.value6
> from Table1 a,
> Table2 b
> where a.column1 = b.column1
> and a.column2 = 1
> and b.column2 > '28-APR-05'
> and b.column2 < '01-MAY-05'
>
> Works fine in Sybase but errors out in Oracle.

UPDATE Table1 a
SET (column3, column4, column5, column6) = (

   SELECT b.value3, b.value4, b.value5, b.value6    FROM Table 2 b
   WHERE a.column1 = b.column1
   AND a.column2 = 1
   AND b.column2 BETWEEN TO_DATE('28-APR-05', 'DD-MON-YY') AND TO_DATE('01-MAY-05')); You can safely assume that Sybase statements, unmodified, either will not work in Oracle or will not be optimal in Oracle.

Bookmark the following:
http://tahiti.oracle.com
http://www.psoug.org (click on Morgan's Library) google.com is your friend too.

And as previously pointed out ... post version, post DDL, post DML, and always post complete Oracle error message.

-- 
Daniel A. Morgan
http://www.psoug.org
damorgan_at_x.washington.edu
(replace x with u to respond)
Received on Fri Jul 01 2005 - 17:42:38 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US