Re: Help : Convert interbase stored proc
From: mcstock <mcstockx_at_xenquery.com>
Date: Tue, 4 Nov 2003 15:04:12 -0500
Message-ID: <v5WdnYDGaq3xmzWiRVn-gw_at_comcast.com>
Date: Tue, 4 Nov 2003 15:04:12 -0500
Message-ID: <v5WdnYDGaq3xmzWiRVn-gw_at_comcast.com>
study out the PL/SQL Users' Guide for syntax details
'if' structures are terminated with 'end if'
(i assume your code omitted the logic that sets LastVal)
-- Mark C. Stock email mcstock -> enquery(dot)com www.enquery.com (888) 512-2048 "William Buchanan" <william.buchanan_at_freenet.co.uk> wrote in message news:26d39d38.0311030426.768726eb_at_posting.google.com...Received on Tue Nov 04 2003 - 21:04:12 CET
> Hi
>
> I have the following stored proc in interbase (which might contain
> errors - i'm doing it off the top of my head), which I would like to
> convert into oracle. Can you help? What I want back is a dataset of
> all the records where Ch_Val is different to the previous value.
>
> Thanks for any help.
>
> create procedure GetChanges(StartDate timestamp, EndDate timestamp)
> returns(SettDate timestamp, Ch_ID integer, Ch_Val integer)
> as
> declare variable lastVal integer;
> begin
> lastVal = -1;
> for select * from ChData
> where SettDate between :StartDate and :EndDate
> order by SetDate
> do
> begin
> if Ch_Val <> lastVal then
> suspend;
> end;
> end