Re: conditional sql scripts?

From: Michael Carmack <>
Date: 1997/05/07
Message-ID: <5kpstq$>#1/1

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?

The solutions provided will certainly work, but I have some thoughts:

If you're just providing the script at the OS level for users to run through SQL*Plus, for example, what is to stop them from editing the script themselves to remove the user id check? It seems more logical to me to make your script a stored procedure in the database and grant execute privilege only to those users who should run it. Simple!

"Villains, I say to you now:       |   Mike Carmack
 KNOCK OFF ALL THAT EVIL!"         |   Vulcan Dragon -==(UDIC)==-
    S P O O N !!!!    - The Tick   |
Received on Wed May 07 1997 - 00:00:00 CEST

Original text of this message