我在editplus里写的if...then总是报错
SP2-0734: unknown command beginning "if Qty_ord..." - rest of line ignored.
   update part set qty_stock=qty_stock+Qty_ordered where part_no=      3001
                                       *
ERROR at line 1:
ORA-00904: invalid column name
哪位高手帮帮我???

解决方案 »

  1.   

    把你写的SQL语句给我们看看。
      

  2.   

    if Qty_ordered=Qty_recieved+&rece where order_no=&rec then
    update part set qty_stock=qty_stock+(select Qty_recieved from detail where order_no=&rec)
    where part_no=#
    小妹初学者,这个问题困扰我好久了~~~
      

  3.   

    语法确实不符合pl/sql的语法规则啊
    根据楼主的语句意思,修改如下:
    if Qty_ordered=Qty_recieved+&rece and order_no=&rec then 
       update from part 
          set qty_stock = qty_stock || 'select Qty_recieved from detail where order_no=&rec' 
        where part_no=#
    end if;不知道语句有没有理解错,如果不妥,请楼主用文字详细叙述,本人再行修改。
      

  4.   

    这种控制语句,你在sqlplus中用匿名块的方式写:
    begin
    if ... then
    ......
    end if
    end;