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

Home -> Community -> Usenet -> c.d.o.server -> Conditional execution of a select statement

Conditional execution of a select statement

From: <russellwright_at_my-deja.com>
Date: 2000/05/08
Message-ID: <8f7hov$bsg$1@nnrp1.deja.com>#1/1

In Oracle, how can I write a select statement that is different based on the user?

SELECT User INTO sLoggedOnUser FROM Dual;

IF sLoggedOnUser <> 'Admin' THEN
  SELECT ....
ELSE
  SELECT ....
END IF; Seems like it should be simple, but I get errors stating it is expecting SELECT INTO. Do you have to use a cursor for this?

Thanks

Russ

RussellWright_at_earthling.net

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Mon May 08 2000 - 00:00:00 CDT

Original text of this message

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