set serveroutput on;
begin
declare dnamet varchar(20):='ACCOUNTING';
loc varchar(20):='ACCOUNTING';
idtag number:=0;
dbms_output.put_line('dnamet:'||dnamet);
select DEPTNO,deptno into loc,idtag from dept where dname=dnamet;
dbms_output.put_line('loc:'||loc);
dbms_output.put_line(''||idtag);
end;
/我是按照书上打的,报如下错误:The symbol "begin
ORA-06550: line 12, column 0:
PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following: begin case declare end exception exit for goto if loop mod
null pragma raise return select update while with
<an identifier> <a double-quoted d怎么解决啊?
刚学plsql,不知道从何入手啊?
begin
declare dnamet varchar(20):='ACCOUNTING';
loc varchar(20):='ACCOUNTING';
idtag number:=0;
dbms_output.put_line('dnamet:'||dnamet);
select DEPTNO,deptno into loc,idtag from dept where dname=dnamet;
dbms_output.put_line('loc:'||loc);
dbms_output.put_line(''||idtag);
end;
/我是按照书上打的,报如下错误:The symbol "begin
ORA-06550: line 12, column 0:
PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following: begin case declare end exception exit for goto if loop mod
null pragma raise return select update while with
<an identifier> <a double-quoted d怎么解决啊?
刚学plsql,不知道从何入手啊?
解决方案 »
- oracle开始-程序-的enterprises manager console图表不见了
- oraclexe安装完成后可以使用http://管理,请问怎么在web里面导入数据库呢?
- (linux)多线程写数据库,iostat显示%user经常为0,入库效率很低
- oralce中的clob类型数据模糊查询问题
- 连接linux系统下的oracle92出现问题,着急!
- 如何实现备份的文件名自动生成?
- 减小表空间出错,ORA-03297
- 如何设定视图的superview_name ?
- 如何取出返回记录集的前十条记录?
- 在线等,求大神指导,20多万行insert语句如何快速插入到表中
- snapshot too old怎么解决
- Oracle判断为空函数的使用
declare dnamet varchar(20):='ACCOUNTING';
loc varchar(20):='ACCOUNTING';
idtag number:=0;
begin
dbms_output.put_line('dnamet:'||dnamet);
select DEPTNO,deptno into loc,idtag from dept where dname=dnamet;
dbms_output.put_line('loc:'||loc);
dbms_output.put_line(''||idtag);
end;
/--result
dnamet:ACCOUNTING
loc:10
10PL/SQL procedure successfully completed
loc varchar(20):='ACCOUNTING';
idtag number:=0;
begin
dbms_output.put_line('dnamet:'||dnamet);
select DEPTNO,deptno into loc,idtag from dept where dname=dnamet;
dbms_output.put_line('loc:'||loc);
dbms_output.put_line(''||idtag);
exception
when others
dbms_output.put_line(sqlcode);
dbms_output.put_line(sqlmsg);
end;
语法好像是这样写的,先定义,在执行业务块,通过异常捕捉sqlcode,sqlmsg是系统的消息,你可以试试
...
beginexceptionend;