The creation of sequence error. Help, please

I use following script to create the sequence but in error
Error report:
SQL error: ORA-01722: invalid number
01722 00000 - "invalid number."


CREATE SEQUENCES BL_BTN_MASTER_SEQ
MINVALUE 1
MAXVALUE 999999999999999999
INCREMENT BY 1
START WITH (SELECT MAX (BULLETIN_MASTER_ID) + 1
OF BL_BTN_MASTER)
NOCACHE;

FYI... The bulletin_master_id column data type is NUMBER (22.0)
Help, please.

Published by: user11228834 on May 29, 2013 10:22

Published by: user11228834 on May 29, 2013 10:23

Published by: user11228834 on May 29, 2013 10:25

Oracle doesn't like the ' (select max (bulletin_master_id) + 1 bl_btn_master)' statement incorporated in the CREATE SEQUENCE statement because if you look at the syntax it expects an acual number.» You can use run immediately to create the sequence in this way:

{code}
declare
number of v_seq;
v_statement varchar2 (200);
Start
SELECT max (bulletin_master_id) + 1
in v_seq
of bl_btn_master;

v_statement: = 'CREATE the SEQUENCE BL_BTN_MASTER_SEQ |
"MINVALUE 1' |
"MAXVALUE 999999999999999999' |
' INCREMENT OF 1' |
'START WITH ' | v_seq |
"NOCACHE";

execute immediate (v_statement);
end;
{code}

Tags: Oracle Development

Similar Questions

Maybe you are looking for

  • Satellite L650 - 10: PSK1JE - no external signal on TV with HDMI

    I connected my PSK1JE Toshiba L650 - 10 H with TV KDL-26BX320 using an HDMI cable. Win + P dial-up (Fn + F5) to enlarge the screen. TV has no signal (black screen) but the computer recognizes TV. All the drivers are up to date. Screenshot of settings

  • LVM in TDMS file conversion?

    Hello forum members Anyone have an idea on how to convert the LVM TDMS file? I would really appreciate your help on this Thanks again SergeArmz

  • Approved updates

    I would also like to upgrade my hardware system after the upgrade to windows 10. I have the area 51 r2, i7 (2014) 5930, ssd 256 GB / 4 TB HARD drive. I wish 1 mayB 2 s gtx1080, probably upgrade the processor.  I'd only like to know if coolant pump an

  • How to send queries dns to non-standard port in windows 8

    I want to send queries dns to nonstandard port (other then 53). I found this article that describes how do (in the windows registry to add HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\DNS\Parameters   SendOnNonDnsPort parameter of type dword

  • the SEARCH button on my LIGHTROOM will not FIND images. Does not, did not work. Anyone?

    When I go to the option SEARCH and select "ANY SEARCHABLE FIELD" and "CONTAINS" I can put in the exact file name, and it will not always get this image to the top, although I'm looking right there.