create or replace procedure getA(
ids in varchar2
)
as
i integer;
counts integer;
v_count number(10);
strtable varchar2(100);
begin
-- i:=0;
--counts:=0;
-- v_count:=0;
strtable:='create table sms_newbasicInfo_wwl(
bid number not null,
newid number not null
)';
select count(*) into v_count from user_objects
where object_name = upper('sms_newbasicInfo_wwl');
if v_count > 0 then
execute immediate 'drop table sms_newbasicInfo_wwl purge';
end if;
execute immediate strtable;
execute immediate 'alter table sms_newbasicInfo_wwl add constraint Pk_bid primary key(bid)';
select count(*) into counts from sms_basic_info order by id;
while i<counts
loop
insert into sms_newbasicInfo_wwl values(i,substr(ids,i*2,1));
i:=i+1;
end loop;
end
ids in varchar2
)
as
i integer;
counts integer;
v_count number(10);
strtable varchar2(100);
begin
-- i:=0;
--counts:=0;
-- v_count:=0;
strtable:='create table sms_newbasicInfo_wwl(
bid number not null,
newid number not null
)';
select count(*) into v_count from user_objects
where object_name = upper('sms_newbasicInfo_wwl');
if v_count > 0 then
execute immediate 'drop table sms_newbasicInfo_wwl purge';
end if;
execute immediate strtable;
execute immediate 'alter table sms_newbasicInfo_wwl add constraint Pk_bid primary key(bid)';
select count(*) into counts from sms_basic_info order by id;
while i<counts
loop
insert into sms_newbasicInfo_wwl values(i,substr(ids,i*2,1));
i:=i+1;
end loop;
end
另外,最好先建sms_newbasicInfo_wwl表,不然你编译不通过的
这个错误内容哦:
Compilation errors for PROCEDURE EDU_BMS.GETAError: PLS-00103: 出现符号 "end-of-file"在需要下列之一时:
;
<an identifier> <a double-quoted delimited-identifier>
current delete exists prior <a single-quoted SQL string>
符号 ";" 被替换为 "end-of-file" 后继续。
Line: 30
Text: end