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: I give up! Help needed on SQL

Re: I give up! Help needed on SQL

From: Graham C Thornton <graham.thornton_at_ln.ssw.abbott.com>
Date: Wed, 21 Apr 1999 08:59:41 -0500
Message-ID: <7fkll8$ar4@news.abbott.com>


Paul,

I took a quick look at your code and have a couple of questions....

Paul Davies wrote in message <371dc490_at_newsread3.dircon.co.uk>...
>I give up! I'm trying to translate the Transact SQL below to ORACLE SQL.
>I've indicated the bits which are causing problems with the /*problem*/
>flag.

<SNIP>

> (
> (CPM_NUM - (select TOTAL_IMRESSIONS /*problem*/
> from A_REQ_TOTAL_IM arti

What is CPM_NUM? - is it a bind variable or a database column? This type of construct will only work if they are bind variables. What error are you getting?

> +
> ((CLICK_NUM * clickyield) - (select /*problem*/
> TOTAL_IMRESSIONS from A_REQ_TOTAL_IM arti

Same question basically, what are CLICK_NUM and clickyield?

><
>datediff('ss',(select TIMESTAMP from /*problem*/
> A_REQ_TOTAL_IM arti where
> arti.REQ_ID = s.REQ_ID),datenow)
>

Okay, to my knowledge this just isn't going to work. You need to do something like this....

select datediff( 'ss', TIMESTAMP, datenow ) from A_REQ_TOTAL_IM arti
where arti.REQ_ID = s.REQ_ID

You will need to use a pragma in your function definition to tell Oracle you're not updating anything.

Regards

Graham Received on Wed Apr 21 1999 - 08:59:41 CDT

Original text of this message

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