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: Bad day, or really not possible?

Re: Bad day, or really not possible?

From: Vladimir M. Zakharychev <bob_at_dpsp-yes.com>
Date: Thu, 28 Feb 2002 18:36:57 +0300
Message-ID: <a5lilp$3pt$1@babylon.agtel.net>


As a workaround you can execute this statement using dynamic SQL since it will go directly to the SQL engine which supports the CASE - something like this will do:

execute immediate 'insert into sometable (somecolumn) select case when z < :b1 then xvalue else yvalue end from someothertable' using 1000;

-- 
Vladimir Zakharychev (bob@dpsp-yes.com)                http://www.dpsp-yes.com
Dynamic PSP(tm) - the first true RAD toolkit for Oracle-based internet applications.
All opinions are mine and do not necessarily go in line with those of my employer.


"Jon Waterhouse" <jonwaterhouse_at_mail.gov.nf.ca> wrote in message news:3c7bea6f.0_at_209.128.1.3...

> Let me rephrase that:
>
> Why is this a perfectly respectable command in SQLPLUS, or to be executed as
> dynamic SQL from a stored procedure, but not valid as static SQL in a stored
> procedure or as a PL/SQL command?
>
> "Jon Waterhouse" <jonwaterhouse_at_mail.gov.nf.ca> wrote in message
> news:3c7bda8b.0_at_209.128.1.3...
> > INSERT into sometable
> > (somecolumn)
> > SELECT CASE WHEN z <1000 THEN xvalue ELSE yvalue END from
> someothertable;
> >
> > Says it's not expecting the symbol case.
> > Just not possible, or am I doing something completely silly?
> >
> >
> >
> >
>
>
Received on Thu Feb 28 2002 - 09:36:57 CST

Original text of this message

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