Query Returns Invalid Column Index

I am setting up a couple of named queries to run a database. I have a table made, but when I try to execute the query below, I get an error saying invalid column index

Screenshot 2025-09-05 171930

This is the table I am trying to insert into

Screenshot 2025-09-05 172046

I have tried just about everything to try and get this to work, but can’t seem to fix the issue. Any ideas? We use oracle.

Double quotes delimit column names, table names, and other structural names (identifiers). Strings and other values that need delimiting use single quotes. Per the SQL standard, which Oracle follows closely. Other brands default to other quotes for identifiers and may tolerate double quotes for values. Oracle will not.

Further, Oracle handles unquoted identifiers as if entirely upper case. Other brands have various other behaviors when identifiers are not quoted. The standard requires that quoted identifiers be treated as case-sensitive, and all brands do, that I know.

same issue with single quotes…

Isn't the correct syntax as shown below?

INSERT INTO FPI_Dwell_history
    (Work_Order)
VALUES
    ('123')

Note the plural, VALUES, and the single quotes.

Tip: post formatted code - not pictures - so we don't have to type it all out again.

will do, that still didn’t work

Try matching case exactly.

didn’t work, that was one of the first things I tried

You may need a schema prefix on the table name. No way to tell with what is shown.

how would I tell what that prefix would be?

Repost your Query instead of just saying you tried each time. You’d be surprised how often you overlook syntax mistakes.

1 Like

Fair.

INSERT INTO FPI_DWELL_HISTORY
	(WORK_ORDER)
VALUES
	('123')
1 Like

Try:

SELECT * FROM INFORMATION_SCHEMA.TABLES
   WHERE TABLE_NAME='FPI_DWELL_HISTORY'

Look at the schema column returned.

OK, weird thing just happened. I had a bunch of commented out lines in the query I assumed didn’t do anything (my bad I guess). Deleted all of them and tried solution, that errored out with table or view does not exist. Then tried this

INSERT INTO FPI_DWELL_HISTORY
	(WORK_ORDER)
VALUES
	('123')

again, and it seemed to work. Any ideas why using the /* commenting method would cause it not to work?

Ignition uses vanilla JDBC, and JDBC doesn't play well with comments (or other SQL scripting keywords). Especially in named queries.

For best results, feed JDBC single statements with no comments.

In the future, when posting queries for commentary here, post the entire thing.

damn, thank you guys for the help!