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

Home -> Community -> Usenet -> c.d.o.server -> Re: To convert code from SQL Server.

Re: To convert code from SQL Server.

From: Jim Kennedy <kennedy-family_at_home.com>
Date: Wed, 28 Nov 2001 16:57:31 GMT
Message-ID: <%H8N7.89028$XJ4.48766279@news1.sttln1.wa.home.com>


It isn't a stored procedure. It is a DML statement. That's why it won't compile. Also you should always include the Oracle version. Jim
"Manish" <manish1000_at_hotmail.com> wrote in message news:9d90ea9a.0111280658.57a631c4_at_posting.google.com...
> Dear oracle experts....
>
> This statement works from the SQL Server, however could not be
> compiled as the stored procedure in Oracle, could someone please help
> me with this?
>
> SQL server original statement was:
>
> update TS_TRANSOFFERING_Temp
> set pricedataid=A1.pricedataid
> from TS_TRANSOFFERING_Temp A, TS_TRANSOFFERING_Temp02 A1
> where A1.start_time=A.start_time
> and A1.stop_time=A.stop_time
> and RTRIM(A1.path_name)=RTRIM(A.path_name)
> and RTRIM(A1.service_increment)=RTRIM(A.service_increment)
> and RTRIM(A1.ts_class)=RTRIM(A.ts_class)
> and RTRIM(A1.ts_type)=RTRIM(A.ts_type)
> and RTRIM(A1.ts_period)=RTRIM(A.ts_period)
> and RTRIM(A1.ts_window)=RTRIM(A.ts_window)
> and isnull(RTRIM(A1.ts_subclass),'')=isnull(RTRIM(A.ts_subclass),'')
>
> Oracle translation:
>
> update TS_TRANSOFFERING_TEMP A set pricedataid = nvl((select
> min(A1.pricedataid)
> from TS_TRANSOFFERING_TEMP02 A1
> where A1.start_time = A.start_time
> and A1.stop_time = A.stop_time
> and RTRIM(A1.path_name) = RTRIM(A.path_name)
> and RTRIM(A1.service_increment) = RTRIM(A.service_increment)
> and RTRIM(A1.ts_class) = RTRIM(A.ts_class)
> and RTRIM(A1.ts_type) = RTRIM(A.ts_type)
> and RTRIM(A1.ts_period) = RTRIM(A.ts_period)
> and RTRIM(A1.ts_window) = RTRIM(A.ts_window)
> and NVL(RTRIM(A1.ts_subclass),'NULL') =
> NVL(RTRIM(A.ts_subclass),'NULL')), A.pricedataid)
>
> Thank you,
>
> Manish
Received on Wed Nov 28 2001 - 10:57:31 CST

Original text of this message

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