比如sql里可以这样写:
select @pid=pid from talbe.
orcale里怎么写.
还有if怎么写。我在oracle里写
if exists(select 1 from ghosthjt.businfo)
  select max(case when nid is null then 0 else nid) from ghosthjt.businfo
else
  select 1 from dualSP2-0734: 未知的命令开头 "if exists(..." - 忽略了剩余的行。
  select max(case when nid is null t如果不能这么写,会带来很多不便,比如调试存储过程。

解决方案 »

  1.   

    select pid into varname from table;
    if .......then
    end if;
      

  2.   

    SELECT PID INTO 变量名 FROM TABLE;
      

  3.   

    if exists(select 1 from ghosthjt.businfo)
      select max(case when nid is null then 0 else nid) from ghosthjt.businfo
    else
      select 1 from dual
    可以写为:
    select 1 into num from ghosthjt.businfo;
    if num>0 then
    .....
    else
      

  4.   

    IF ELSE 那个可以用一个sql,也可以用if else语句
      

  5.   

    我是在sql*plus 工作单里运行代码的。我想像它应该和sql里的查询分析器差不多。但是是不是它和查询分析器有很多不同,只能运行sql 查询语句,不能运行sql 代码。。