CREATE OR REPLACE procedure Sales_Insert(
     keyid in varchar2,
                       CTNOS in varchar2,
                       CUSTOMERS in varchar2) 
isbeginif (keyid!="" and keyid!= null) 
then
update sales set CTNO=CTNOS,CUSTOMER=CUSTOMERS WHERE CTID=keyid;
else
         insert into sales(CTID, CTNO, CUSTOMER)            values(test_seq.nextval, CTNOS, CUSTOMERS);
END IF;end Sales_Insert;
/

解决方案 »

  1.   

    提示:
    ORA-00604: 递归 SQL 层 1 出现错误
    ORA-01400: 无法将 NULL 插入 ("SYS"."OBJ$"."NAME")
      

  2.   

    是否为空要用 keyid is not null
    if keyid is not null then
      

  3.   

    if (keyid!="" and keyid!= null) 
    ========>
    if (keyid!="" and keyid is not null) 
      

  4.   

    为什么我改成下面这个语句可以:
    if (keyid is not null)但改成下面这个语句却不行???if (keyid is not null and keyid!="") 难道keyid is not null和keyid!=""是一样的功能吗????
      

  5.   

    keyid!=''
    ORACLE 是用单引号的
    ORACLE 里 null!=''