Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Does Decode work in a REF CURSOR?

Does Decode work in a REF CURSOR?

From: Sean <dolans_at_my-deja.com>
Date: Fri, 08 Dec 2000 15:10:15 GMT
Message-ID: <90qtkg$iq0$1@nnrp1.deja.com>

Platform : Oracle 8.1.5 on NT

Scenario: Package body that returns a REF CURSOR. The sql statement has at the end of it :

ORDER BY  decode(v_OrderBy, 	'A', TICKET.TKT_ID, null) asc,
	  decode(v_OrderBy, 	'D', TICKET.TKT_ID, null) desc;

(where v_OrderBy is either A or D)

More Info: If I run the package in SQL Plus passing in a parameter of D for descending, I ALWAYS get the order as the same which is ascending.

So I took the SQL statement, changed the v_OrderBy by hand and ran THAT within SQL Plus - I got the results I was looking for.

Question : Does a REF CURSOR see decode? Or is that an SQL PLus thing? Or is there a "bug" in the PL/SQL engine for version 8.1.5 ?

Thank you.
Sean

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Fri Dec 08 2000 - 09:10:15 CST

Original text of this message

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