Column not allowed here Oracle SQL on multiple columns

前端 未结 1 1530
南旧
南旧 2021-01-27 07:50

I\'m trying to insert records into a table, and I\'m getting a \"column not allowed here\" error on my \"item rating column\" (\"PG\" in the example below) when I\'m inserting t

相关标签:
1条回答
  • 2021-01-27 08:20

    PG is in double quotes, which means it is not a string. Strings are delimited by single quotes in SQL. But I would recommend writing this as:

    INSERT INTO ITEM ( list the columns here)
        SELECT item_s1.NEXTVAL, '786936161878', common_lookup_id, 
              'The Sandlot', 'American Baseball Classic', 'PG',
              TO_DATE('1993/04/01 01:00:00', 'yyyy/mm/dd hh24:mi:ss'),
              1, SYSDATE, 1, SYSDATE
        FROM common_lookup
        WHERE common_lookup_type = 'DVD_WIDE_SCREEN';
    
    0 讨论(0)
提交回复
热议问题