1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Ora-00917: missing comma when no comma is missing.

Discussion in 'SQL PL/SQL' started by Calvin, Oct 6, 2018.

  1. Calvin

    Calvin Starter

    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    10
    Location:
    Melbourne
    INSERT INTO reserve (
    branch_code,
    bc_id,
    TO_DATE('2018-09-20, 4:00 P.M.', 'YYYY-MM-DD, HH:MI P.M.'),
    5 )
    SELECT b.branch_code, c.bc_id
    FROM book_copy c
    JOIN branch b on c.branch_code = b.branch_code
    WHERE b.branch_contact_no = '8888888883'
    AND c.book_call_no = '005.74 C822D 2018';

    I am new to sql, here I want to insert some values into a new table called reserve from two other tables and I cannot make this work.
     
  2. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,635
    Likes Received:
    368
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    You cannot put values in the column list for a table, ONLY Column names. The TO_DATE can only be in the VALUES list:

    insert into t(a,b,c,d)
    values('a','b',TO_DATE('2018-09-20, 4:00 P.M.', 'YYYY-MM-DD, HH:MI P.M.'),'d');