Re: conditional sql scripts?

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: 1997/05/06
Message-ID: <337693fd.19833278_at_newshost>#1/1


On 6 May 1997 15:02:23 GMT, kirill_at_cs.ualberta.ca (Kirill Richine) wrote:

>Hi!
>
>I would like to check, in the beginning of my sql script, the user
>name who is running it, and if this user is not the right one, not to
>execute the rest of the script.
>
>Is it possible to do?
>
>Thank you.
>k&
>

A script like this will do it:

  • bof ------------------------------ whenever sqlerror exit begin if ( user <> 'TKYTE' ) then raise_application_error( -20001, 'Must be so and so' ); end if; end; / whenever sqlerror continue select * from dual;
  • eof ------------------------------

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Bethesda MD

http://govt.us.oracle.com/ -- downloadable utilities



Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Tue May 06 1997 - 00:00:00 CEST

Original text of this message