I've implemented the case statement shown below with native SQL:
CASE WHEN ((#prompt('choice')#)=0) THEN
(select /*+ FIRST ROWS */ "Request"."REQUESTID" "Request_ID"
from "ECASH"."REQUEST" "Request" where "Request"."VOID"=0)
ELSE
(select /*+ FIRST ROWS */ "Request"."REQUESTID" "Request_ID"
from "ECASH"."REQUEST" "Request" where "Request"."VOID"=1)
END
Unfortunately, I get the error:
QE-DEF-0177 An error occurred while performing operation 'sqlPrepareWithOptions' status='-9'. UDA-SQL-0446 Oracle returned an error message. ORA-24333: zero iteration count UDA-SQL-0450 An unexpected error encountered during the "prepare" operation.
David,
Sorry - no Oracle experience, so I'd only be guessing from here as to the zero iteration count. It might be worth posting this on one of the Oracle Fora.
Thanks guys, Draoued code works well. I also got a variation using 'CASE WHEN...THEN....ELSE...END' as suggested by drlex. For anyone wanting to use Draoued's code, the compiler requests a couple more brackets. I've shown the final code below.
(select /*+ FIRST ROWS */ "Request"."REQUESTID" "Request_ID"
from "ECASH"."REQUEST" "Request" where "Request"."VOID"= decode((#prompt('choice')#), '0' , 0 , 1 ))
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.