Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: PL/SQL CREATE SEQUENCE
Thanks, I wasn't aware that the parser would process any &, even in a
comment a s a request for a paramter value.
In article <950301769.886.1.pluto.d4ee154e_at_news.demon.nl>,
"Sybrand Bakker" <postbus_at_sybrandb.demon.nl> wrote:
> Because although it is in a comment statement, it STILL seems to
think it is
> a substiution variable. Looks like a bug to me!
> Try replacing the -- text by /* text */ or replace the & by and.
>
> Hth,
>
> Sybrand Bakker, Oracle DBA
>
> <newopt_at_my-deja.com> wrote in message news:881n24
$m4l$1_at_nnrp1.deja.com...
> > Why does this pl/sql script prompt for the cursor name when I have
> > supplied in the script itself?
> >
> > SQL> get test3.sql
> > 1 Declare
> > 2 cid INTEGER;
> > 3 -- This procedure is used to create a new sequence used to
> > 4 -- populate the seq_number column in each NCR table
> > 5 -- with a unique ascending sequence number starting
> > 6 -- with 1.
> > 7 BEGIN
> > 8 -- Open new cursor and return cursor ID.
> > 9 cid := DBMS_SQL.OPEN_CURSOR;
> > 10 -- Parse and immediately execute dynamic SQL statement built by
> > 11 -- concatenating the sequence name to DROP & CREATE SEQUENCE
> > commands.
> > 12 DBMS_SQL.PARSE(cid, 'DROP SEQUENCE ' || 'seq_number_next',
> > dbms_sql.v7);
> > 13 DBMS_SQL.PARSE(cid, 'CREATE SEQUENCE ' || 'seq_number_next
START
> > WITH 1 MINVALUE 1', dbms_sql.v7);
> > 14 -- Close cursor.
> > 15 DBMS_SQL.CLOSE_CURSOR(cid);
> > 16 EXCEPTION
> > 17 -- If an exception is raised, close cursor before exiting.
> > 18 WHEN OTHERS THEN
> > 19 DBMS_SQL.CLOSE_CURSOR(cid);
> > 20 RAISE; -- reraise the exception
> > 21* END;
> > 22 /
> > Enter value for create:
> > old 11: -- concatenating the sequence name to DROP & CREATE
SEQUENCE
> > commands.
> > new 11: -- concatenating the sequence name to DROP SEQUENCE
commands.
> >
> > PL/SQL procedure successfully completed.
> >
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Mon Feb 14 2000 - 11:33:04 CST
![]() |
![]() |