Path: news.easynews.com!easynews!news.he.net!chekhov.conxion.net!news.oracle.com!not-for-mail
Sender: cjones@iron2-au
Newsgroups: comp.databases.oracle.misc
Subject: Re: checking the input of ACCEPT
References: <ag4991$i3e$1@newsreader2.netcologne.de> <c2d690f2.0207051029.2c8b034e@posting.google.com>
From: Christopher.Jones@oracle.comX
Message-ID: <ud6tz2af7.fsf@oracle.comX>
Lines: 42
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Date: 08 Jul 2002 12:58:04 +1000
NNTP-Posting-Host: 140.83.23.8
X-Trace: news.oracle.com 1026097263 140.83.23.8 (Sun, 07 Jul 2002 20:01:03 PDT)
NNTP-Posting-Date: Sun, 07 Jul 2002 20:01:03 PDT
Xref: easynews comp.databases.oracle.misc:83916
X-Received-Date: Sun, 07 Jul 2002 19:56:01 MST (news.easynews.com)

rsarwar@ifsna.com (Rauf Sarwar) writes:

In addition to the suggestion below, investigate the usefulness of the
FORMAT option to the ACCEPT command.  See http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/server.920/a90842/ch13.htm#1006991

For example:

    ACCEPT drop_user DEFAULT 'N' FORMAT A1 PROMPT 'Drop user? Y/[N] :'

Chris
 
> "J?g Schneider" <Joerg.Schneider@ORGAPLAN_NOSP.de> wrote in message news:<ag4991$i3e$1@newsreader2.netcologne.de>...
> > Hello together,
> > 
> > we want to drop users in a database by a script with sqlplus. There should
> > be warnings and an input like "The user will be deleted. Are you shure?
> > (Y/N)" before the drop. Now we have to check the input wether there is "Y"
> > or "N"? How can we do this?
> > 
> > Source:
> > 
> > ACCEPT x char PROMPT "The user will be deleted. Are you shure? (Y/N)"
> > 
> > Thank you for helping
> > 
> > Jörg
> 
> 
> ACCEPT drop_user DEFAULT 'N' PROMPT 'The user will be deleted. Are you sure? (Y/N) '
> 
> BEGIN
>    IF Upper(Substr('&drop_user', 1, 1)) = 'Y'  THEN
>       EXECUTE IMMEDIATE '.......';
>    END IF;
> END;
> /
> 
> HTH
> //Rauf Sarwar

-- 
Christopher Jones, Oracle Corporation, Australia.
