Sql 引用引号
我的代码Sql 引用引号,sql,plsql,Sql,Plsql,我的代码 declare vnm varchar(20); vt varchar(100); begin select ename into vnm from emp where empno=0; exception when others then dbms_output.put_line('Employee ID doesn't exist'); vt := sqlerrm; insert into errlog values(vt,sysdat
declare
vnm varchar(20);
vt varchar(100);
begin
select ename
into vnm
from emp
where empno=0;
exception
when others then
dbms_output.put_line('Employee ID doesn't exist');
vt := sqlerrm;
insert into errlog values(vt,sysdate);
commit;
end;
/
我得到了引号字符串未正确终止的错误,我用单倒逗号更正了insert语句值,但我仍然得到了相同的错误,因此任何对此有帮助的人请在前面使用单引号,如果您希望打印相同的内容,即
dbms_output.put_line('Employee ID doesn''t exist');
Oracle将告诉您错误所在的行号。我几乎100%肯定地猜测它在dbms_output.put_line语句中。您的邮件中有一个n和t之间的撇号。谢谢您的帮助我得到了它。。。。。。