用参数创建序列起始值时,如下:
declare num number;
begin
select id into num from dual;
if num>1 then
execute immediate ' create sequence seq_id minvalue 1
maxvalue 999999999999999999999999999
increment by 1
cache 20
start with :num' ;
end if;
end;
不知哪里用错了!
declare num number;
begin
select id into num from dual;
if num>1 then
execute immediate ' create sequence seq_id minvalue 1
maxvalue 999999999999999999999999999
increment by 1
cache 20
start with :num' ;
end if;
end;
不知哪里用错了!
错了
num number;
id number:=2;
begin
select id into num from dual;
if num>1 then
execute immediate ' create sequence seq_id minvalue 1
maxvalue 999999999999999999999999999
increment by 1
cache 20
start with '||num;
end if;
end;
begin
select id into num from 表名;
if num>1 then
execute immediate ' create sequence seq_id minvalue 1
maxvalue 999999999999999999999999999
increment by 1
cache 20
start with :num' ;
end if;
end; 我不知道这个:start with :num要怎么写.
num number;
id number:=100;
begin
select id into num from dual;
if num>1 then
execute immediate ' create sequence seq_id minvalue 1
maxvalue 999999999999999999999999999
increment by 1
cache 20
start with '||num;
end if;
end;
maxvalue 999999999999999999999999999
increment by 1
cache 20
start with :num' using num;
这句是没有问题的.现在就是不知道在创建序列的时候如何用参数去创建序列的起始值.