Re: HELP: invalid SQL statement ! (2)

From: Jonathan Gennick <gennick_at_worldnet.att.net>
Date: 1998/04/03
Message-ID: <6g3kjo$p8q_at_bgtnsc03.worldnet.att.net>#1/1


On Fri, 03 Apr 1998 16:47:37 +0200, Thib <Philippart_at_geru.ucl.ac.be> wrote:

> I work with Oracle 8.0.3 and I have a problem.
>
> I would like to use the "ACCEPT var PROMPT string" statement in my SQL
>worksheet and it doesn't work very good...

ACCEPT is a SQL*Plus command. SQL worksheet may not implement it.

<snip>

> Why ? Is ACCEPT really an SQL command ? I have the same problem with
>commands like "COLUMN name HEADER ..."

ACCEPT, COLUMN are both SQL*Plus formatting commands. They are different from SQL. SQL statements, such as SELECT, INSERT, etc are executed by the Oracle database. SQL*Plus commands such as ACCEPT, COLUMN, PROMPT, etc are executed by SQL*Plus.

> Now, I would like to include the ACCEPT command in a PL/SQL program. How can
>I do ? Please, can you help me ?

PL/SQL is like SQL, in that it runs inside the database. There are no facilities for interactive input. What you can do is write a SQL*Plus script to prompt for the input, and then use substitution variables to pass the info to a PL/SQL procedure. Something like this:

accept some_var char prompt 'enter a value >' execute pl_sql_proc_name ('&some_var');

What exactly are you trying to do? Received on Fri Apr 03 1998 - 00:00:00 CEST

Original text of this message