【问题标题】:Oracle SqlDeveloper querying for a table using SELECT returns nothing使用 SELECT 查询表的 Oracle SqlDeveloper 不返回任何内容
【发布时间】:2012-10-01 22:04:02
【问题描述】:

我打开了一个到我的架构的连接并且我想查看一个表。

为什么它自己会起作用:

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:

【问题讨论】:

    标签: oracle plsql oracle-sqldeveloper


    【解决方案1】:

    我想您正在尝试在 SqlDeveloper 中将这些命令作为脚本运行(按 F5)。然后有几件事:

    1) 在插入语句中用单引号代替双引号。

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

    2) 在 PL/SQL 块的末尾加上斜线 /

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

    不要忘记提交。

    【讨论】:

    • 这取决于您要达到的目标。
    猜你喜欢
    • 2012-04-14
    • 2018-01-25
    • 1970-01-01
    • 1970-01-01
    • 2021-04-24
    • 2013-09-10
    • 1970-01-01
    相关资源
    最近更新 更多