0% found this document useful (0 votes)
38 views2 pages

Oracle - Error at Command Line - 1 Column - 698 Error Report - SQL Error - ORA-00984 - Column Not Allowed Here - Stack Overflow

The INSERT statement is causing an error because it includes column names in double quotes, which are not required unless there are mixed cases or spaces in the column names. Additionally, some of the date formats and conversions in the VALUES clause are incorrect - date formats need to be enclosed in single quotes and the month should be represented by MM rather than the month name.

Uploaded by

soydeyudru
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views2 pages

Oracle - Error at Command Line - 1 Column - 698 Error Report - SQL Error - ORA-00984 - Column Not Allowed Here - Stack Overflow

The INSERT statement is causing an error because it includes column names in double quotes, which are not required unless there are mixed cases or spaces in the column names. Additionally, some of the date formats and conversions in the VALUES clause are incorrect - date formats need to be enclosed in single quotes and the month should be represented by MM rather than the month name.

Uploaded by

soydeyudru
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

"Error at Command Line : 1 Column : 698 Error report - SQL

Error: ORA-00984: column not allowed here


Asked 7 years, 2 months ago Modified 7 years, 2 months ago Viewed 3k times

INSERT INTO
FLAG ("OPT_FLAG_KEY","H_KEY","FIRST_NAME","LAST_NAME",
"MIDDLE_NAME","TITLE","CREDENTIALS","ADDRESS_LINE_1",
0 "ADDRESS_LINE_2","ADDRESS_LINE_3","CITY","STATE",
"POSTAL_CODE","PHONE_NUMBER","BUSIN_PHONE","DECEASED",
"OPT_FLAG","OPT_FLAG_DATE","SOU_KEY","SOU_FILE_ID",
"SOU_FILE_ID_TEXT","BAT_ID","PHONE_NUMBER_SOURCE","BIRTH_DATE")
VALUES(37009326,4,'Daniel','Boyle',NULL,NULL,NULL,'368 Road',
NULL,NULL,'Doylown','BVBV',1801,NULL,NULL,'NO','OUT',
TO_CHAR('10-AUG-16','DD/MM/YYYY'),201,
TO_DATE(SUBSTR('vhic_pavir_20160810.txt',12,8),YYYYMMDD),
'2016-08-10',598441,NULL,TO_DATE('03-FEB-1952',DD-MM-YYYY));

I have run this query in my DB am getting some error like below

Error at Command Line : 1 Column : 698


Error report
SQL Error: ORA-00984: column not allowed here
00984. 00000 - "column not allowed here" *Cause:
*Action:"

Edit: this is my desc of my table:

Name Null Type


------------------- ---- -------------
OPT_FLAG_KEY NUMBER(14)
H_KEY NUMBER(14)
FIRST_NAME VARCHAR2(50)
LAST_NAME VARCHAR2(50)
MIDDLE_NAME VARCHAR2(50)
TITLE VARCHAR2(50)
CREDENTIALS VARCHAR2(50)
ADDRESS_LINE_1 VARCHAR2(100)
ADDRESS_LINE_2 VARCHAR2(100)
ADDRESS_LINE_3 VARCHAR2(100)
CITY VARCHAR2(50)
STATE VARCHAR2(20)
POSTAL_CODE VARCHAR2(20)
PHONE_NUMBER VARCHAR2(100)
BUSIN_PHONE VARCHAR2(100)
DECEASED VARCHAR2(5)
OPT_FLAG VARCHAR2(10)
OPT_FLAG_DATE DATE
SOU_KEY NUMBER(14)
SOU_FILE_ID DATE
SOU_FILE_ID_TEXT VARCHAR2(20)
BATCH_ID NUMBER(14)
PHONE_NUMBER_SOURCE VARCHAR2(100)
BIRTH_DATE DATE

oracle
Share Improve this question Follow edited Aug 29, 2016 at 18:58 asked Aug 29, 2016 at 18:38
Kenster PANDIA LAKSHMANAN
23.7k 22 82 106 27 2 6

1 can you provide desc table (using desc table_name command) ? – Abhishek Aug 29, 2016 at 18:39

i cannot give it for all the column here, i have pasted in my answer@abhishek – PANDIA LAKSHMANAN Aug 29,
2016 at 18:43

what is the table name? – Abhishek Aug 29, 2016 at 18:51

table name is FLAG – PANDIA LAKSHMANAN Aug 29, 2016 at 18:57

I don't expect a ORA-00984 error for that reason, but the column names should go without quotes, i.e. INSERT
INTO FLAG (OPT_FLAG_KEY, H_KEY, FIRST_NAME, LAST_NAME, MIDDLE_NAME, TITLE, CREDENTIALS,
ADDRESS_LINE_1, ADDRESS_LINE_2, ADDRESS_LINE_3, CITY, STATE etc Hope it helps. – lrnzcig Aug 29, 2016 at
19:20

1 Answer Sorted by: Highest score (default)

There are several issue with your statement. First, double-quotes are not required on column names
(unless you have mixed cases or space), remove them.
1
TO_CHAR('10-AUG-16','DD/MM/YYYY') -> 10-AUG-16 is a string, not a date. Thus it does not make any
sense to convert a string to a string

TO_DATE(SUBSTR('vhic_pavir_20160810.txt',12,8),YYYYMMDD) -> Format must be in single-quotes, i.e.


TO_DATE(SUBSTR('vhic_pavir_20160810.txt',12,8),'YYYYMMDD')

'2016-08-10' -> do you like to insert a DATE value or a string? You provided a string, not a date.

TO_DATE('03-FEB-1952',DD-MM-YYYY)) -> Format must be in single-quotes, see above. MM means the


month number, not the month name.

Share Improve this answer Follow answered Aug 29, 2016 at 20:43
Wernfried Domscheit
55.2k 9 78 114

You might also like