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

Home -> Community -> Usenet -> c.d.o.misc -> Re: ACCEPT in SQL*Plus

Re: ACCEPT in SQL*Plus

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 8 Apr 2003 07:18:37 -0700
Message-ID: <2687bb95.0304080618.feb7dd6@posting.google.com>


"Francesco Sblendorio" <sblendorio_at_despammed.com> wrote in message news:<b6u5dl$qte$1_at_newsreader.mailgate.org>...
> I have to write an interactive script within SQL*Plus, so I tried this code:
>
> declare
> ciao varchar(50);
> begin
> accept ciao;
> dbms_output.put_line(ciao);
> end;
> /
>
> but SQL*Plus seems not to recognize the ACCEPT keyword, although it can be
> launched from the command line:
>
> SQL> accept ciao
>
> ...and, in this case, I don't know how it can be useful....
> Can anyone help me?
>
> Thanks in advance.

Sqlplus recognizes the accept statement just fine; pl/sql does not and as soon as Sqlplus hits the declare the code is passed to the pl/sql engine for execution. You cannot mix pl/sql and Sqlplus statements. You may submit pl/sql from sqplus but the code has to be segmented so to speak. You can pass variables between Sqlplus and pl/sql and you can use the Sqlplus substitution string, &, to plug in a value that is then passed to the pl/sql engine as part of the code since Sqlplus performs the substitution before the pl/sql engine sees the code.

HTH -- Mark D Powell -- Received on Tue Apr 08 2003 - 09:18:37 CDT

Original text of this message

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