Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

create sequence with sql plus variable for maxvalue

1932140Dec 6 2017 — edited Dec 7 2017

Hi

I'm trying to create a sequence using a sql plus variable to define the maximum value, but I get the following exception:

SQL> undefine maxminute

variable maxminute number

exec :maxminute := 1440;

begin

execute immediate 'create sequence a_seq increment by 1 maxvalue :1 start with 1 cycle'

    using :maxminute;

end;

/SQL> SQL>

PL/SQL procedure successfully completed.

SQL> SQL>   2    3    4    5 

begin

*

ERROR at line 1:

ORA-01722: invalid number

ORA-06512: at line 2

Can anybody help with this ?

This post has been answered by Solomon Yakobson on Dec 6 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 3 2018
Added on Dec 6 2017
6 comments
611 views