Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2003
    Posts
    4

    Unanswered: Please tell me why?(SQL command didn't work)

    Table altered.

    SQL> DESC BOOK
    Name Null? Type
    ----------------------------------------- -------- ----------------------------
    BOOK_CODE NOT NULL CHAR(5)
    CATEGORY_CODE NOT NULL VARCHAR2(10)
    COST NUMBER(7,2)

    SQL> INSERT INTO BOOK
    2 VALUES(&BOOK_CODE, &CATEGORY_CODE, &COST);
    Enter value for book_code: B0001
    Enter value for category_code: CC0003
    Enter value for cost: 340.00
    old 2: VALUES(&BOOK_CODE, &CATEGORY_CODE, &COST)
    new 2: VALUES(B0001, CC0003, 340.00)
    VALUES(B0001, CC0003, 340.00)
    *
    ERROR at line 2:
    ORA-00984: column not allowed here

  2. #2
    Join Date
    Jun 2003
    Posts
    4

    Re: Please tell me why?(SQL command didn't work)

    Sorry reader!
    That command not worked because I missing comma.

  3. #3
    Join Date
    Jun 2003
    Location
    Chennai,India
    Posts
    1
    Hi nghiadnt,
    Your SQL command is not worked because for inputting columns of datatype CHAR and VARCHAR2 , you need to give the input string in sigle quotes('). So your proper correction is to be as follows:

    SQL> INSERT INTO BOOK VALUES
    ('&BOOK_CODE', '&CATEGORY_CODE', &COST);


    for eg:
    INSERT INTO BOOK VALUES('B0001','CC0003',340.00);


    You said like problem is with comma.(,).
    But problem is with SINGLE QUOTES(').


    HTH

    Cheers
    Nanda

Posting Permissions

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