Results 1 to 2 of 2

Thread: sub query error

  1. #1
    Join Date
    Jan 2003
    Posts
    67

    Unanswered: sub query error

    Should't this work??? I keep getting a ORA-00936 error "missing expression".

    Code:
     
    INSERT INTO TMOSER.CZCS_CUSTOMER_OPTIONS
    	(CUSTID, OPTIONID, OPTION_CHOICE, UPDATE_DATE, CREATE_DATE, UPDATE_USERID)
    	VALUES
         (1 ,(select OPTIONID from TMOSER.CZCS_OPTIONS where field_name='I_USE_ASL_ADDR'),'Yes', 
           		SYSDATE ,1 )
    Thanks in advance for your thoughts.

  2. #2
    Join Date
    Nov 2002
    Location
    Desk, slightly south of keyboard
    Posts
    697
    Hi,

    You are inserting six values in your columns clause but only five in the values clause. Also, try this...

    PHP Code:
    INSERT INTO TMOSER.CZCS_CUSTOMER_OPTIONS
    (column list,....)
    VALUES
    (select 1,OPTIONID,'Yes',SYSDATE,1 from TMOSER.CZCS_OPTIONS where field_name='I_USE_ASL_ADDR'
    Hth
    Bill

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •