Re: Converting SQL View to Oracle View

From: Jusung Yang <jusungyang_at_yahoo.com>
Date: 2 Aug 2002 07:19:56 -0700
Message-ID: <42ffa8fa.0208020619.19458c2d_at_posting.google.com>


You might want to try Migration Work Bench, which is free from ORACLE. It takes some getting used to. But once you get used to it, you will find it very useful. It helps you understand both ORACLE and SQL server better. And you often can find out quickly how to convert a SQL server T-SQL statement to ORACLE equivalent.

email_at_colletta.com (Jack Colletta) wrote in message news:<7b81cff.0208010648.2e3d2479_at_posting.google.com>...
> I am new to Oracle (8i in particular), but I need to convert this
> Mssql view to Oracle. I have tried but I keep fighting with db
> studio... Any help would be great. Thanks in advance
>
> Jack
>
> *******
>
> Create View ForgeShopProduction (
> sShift,
> lOEEConfigWorkcellId,
> sWorkcellDescription,
> tstart,
> tEnd,
> sPartDescription,
> sHeatCode,
> sJobNumber,
> dCutWeight
>
> )
> as
>
> select e.sShift, e.lOEEConfigWorkcellId, cwc.sDescription,
> min(e.tstart),e.tEnd,
>
> sPartDescription=(select max(sStartVal) from OEEEvent
> where lOEEConfigEventId in (select lOEEConfigEventId from
> OEEConfigEvent where sDescription = 'Part Description')
> and tEnd = e.tEnd
> and lOEEConfigWorkcellId = e.lOEEConfigWorkcellId
> ),
>
> sHeatCode=(select max(sStartVal) from OEEEvent
> where lOEEConfigEventId in (select lOEEConfigEventId from
> OEEConfigEvent where sDescription = 'Heat Code')
> and tEnd = e.tEnd
> and lOEEConfigWorkcellId = e.lOEEConfigWorkcellId
> ),
>
> sJobNumber=(select max(sStartVal) from OEEEvent
> where lOEEConfigEventId in (select lOEEConfigEventId from
> OEEConfigEvent where sDescription = 'Job Number')
> and tEnd = e.tEnd
> and lOEEConfigWorkcellId = e.lOEEConfigWorkcellId
> ),
>
> dCutWeight=(select round(convert(float,max(sStartVal)), 1) from
> OEEEvent
> where lOEEConfigEventId in (select lOEEConfigEventId from
> OEEConfigEvent where sDescription = 'Cut Weight')
> and tEnd = e.tEnd
> and lOEEConfigWorkcellId = e.lOEEConfigWorkcellId
> )
>
> from OEEEvent e, OEEConfigWorkcell cwc, OEEConfigEvent ce
> where e.lOEEConfigEventId = ce.lOEEConfigEventId
> and e.lOEEConfigWorkcellId = cwc.lOEEConfigWorkcellId
> and e.sFolder = 'Additional Data'
>
> group by e.sShift, e.lOEEConfigWorkcellId, cwc.sDescription, e.tEnd
Received on Fri Aug 02 2002 - 16:19:56 CEST

Original text of this message