Jesse Downing Jesse Downing - 1 year ago 83
SQL Question

SQL Oracle: Where <Col Val> == <Item in a list of characters>


The parenthesis contain a list copied from a .txt file. This is a shortened example.
The error I get is:

ORA-00904: "CHWAHKAH": invalid identifier
00904. 00000 - "%s: invalid identifier"
Error at Line: 3 Column: 9,739

Thanks in advance for your help kind ladies and sirs

Answer Source

Assuming your ID column is a text column, you need to surround your list elements with quotation marks ' like so 'PLAN4808' as they are text.

Without quotations, SQL is interpreting them as some sort of identifier (as the error message states) for a database object (table, column name, function, et cetera) otherwise.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download