Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Bind Variable
How are you trying to run the script, the correct syntax to run the script would be:
SQL> @pls01a
You aren't trying something like:
SQL> exec :pls01a
Bind variable "PLS01A" not declared.
are you?
Also, watch out for the use of the semi colon and the /.
You'll find that your query will run twice, once when it sees the semi and once when it sees the slash... Use either or..
On 29 Sep 1997 20:10:54 GMT, gm1056_at_aol.com (GM1056) wrote:
>Could anyone explain why this won't run. Thanks.
>
>SQL>
> 1 rem *********************************************************
> 2 rem * file: pls01a.sql
> 3 rem * desc: This script contains an SQL statement to
> 4 rem * select the last name and first name for a
> 5 rem * student whose ID is specified at runtime.
> 6 rem * args: none
> 7 rem * created: by date:
> 8 rem *********************************************************
> 9 set echo off
> 10 set verify off
> 11 column slname heading "Last Name" format a20
> 12 column sfname heading "First Name" format a15
> 13 clear screen
> 14 prompt Enter a student ID:
> 15 accept v_studid
> 16 prompt
> 17 SELECT slname, sfname
> 18 FROM student
> 19* WHERE studid = &&v_studid;
> 20 /
>Bind variable "PLS01A" not declared.
Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Bethesda MD
http://govt.us.oracle.com/ -- downloadable utilities