execute immediate 缺少关键字
createtableyuangong(idnumberprimarykey,namevarchar2(20))这是数据表declareidnumber:=1;count...
create table yuangong(
id number primary key,
name varchar2(20)
)这是数据表
declare
id number:=1;
counte varchar2(20);
psql varchar2(150);
cuo exception;
begin
psql:='select count(*) into counte from yuangong where id = 1';
execute immediate psql;
if (counte=0)then
raise cuo;
else
dbms_output.put_line(counte);
end if;
exception
when cuo then
dbms_output.put_line('数据库中没有该纪录');
end;
运行就说execute immediate psql;这行缺少关键字..到底缺啥啊 展开
id number primary key,
name varchar2(20)
)这是数据表
declare
id number:=1;
counte varchar2(20);
psql varchar2(150);
cuo exception;
begin
psql:='select count(*) into counte from yuangong where id = 1';
execute immediate psql;
if (counte=0)then
raise cuo;
else
dbms_output.put_line(counte);
end if;
exception
when cuo then
dbms_output.put_line('数据库中没有该纪录');
end;
运行就说execute immediate psql;这行缺少关键字..到底缺啥啊 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询