使用SELECT查询表的Oracle SqlDeveloper不返回任何内容

时间:2012-10-01 22:04:02

标签: oracle plsql oracle-sqldeveloper

我打开了与我的架构的连接,我想查看一个表。

为什么这本身就有效:

select * from mytable;

但这不是:

   -- other statements above          

   begin 
      insert into mytable(id, name) values (2, "George");
   exception ... 
   end;

   select * from mytable;

这不会返回任何内容。没有给出查询输出。相反,我看到的是“任务在0.016秒内完成”。

如果我重新启动sqldeveloper并仅运行begin / end和select语句,我会向我发出此错误:

Error report:
ORA-06550: line 7, column 1:
PLS-00103: Encountered the symbol "SELECT" 
06550. 00000 -  "line %s, column %s:\n%s"
*Cause:    Usually a PL/SQL compilation error.
*Action:

1 个答案:

答案 0 :(得分:0)

我想你试图在SqlDeveloper中以脚本(按F5)的形式运行这些命令。然后有几件事情:

1)在insert语句中用单引号替换双引号。

insert into mytable(id, name) values (2, 'George');

2)将斜杠/放在PL / SQL块的末尾。

 begin 
   insert into mytable2(id, name) values (2, 'George');
   commit;
 end;
/

不要忘记提交。

相关问题