1.5 Query position numbers
Query specifications and table value constructors specified in an SQL statement are assigned position numbers starting from 1 in order of specification from the beginning. These numbers are called query position numbers. They might be output in an error message for an SQL statement.
- Example:
-
KFAA30202-E Column "C1" is not found in any table. (query number = 2)
The above message is output if, for example, the specified column name is invalid. At this time, the query position number is displayed in the underlined part.
For example, if the above message is output when the following SQL statement is executed, this indicates that an error exists in the query specification or table value constructor whose query position number is 2.
Example of the executed SQL statement
SELECT * FROM "T1" WHERE EXISTS (SELECT "C1" FROM "T2")
This example indicates that the underlined query specification (the second query specification from the beginning of the statement) is invalid. An error occurred in the SQL statement because table T2 does not contain column C1.
▪ Examples of query position numbers
-
For the SELECT statement
-
For the INSERT statement (VALUES specified) or PURGE CHUNK statement
The following shows an example of the INSERT statement (VALUES specified). In the case of the PURGE CHUNK statement, inquiry position numbers are also specified in the same manner.
▪ Notes
-
If the error is caused by a viewed table, the position number of the query specification designating that viewed table is displayed.
Example:
KFAA30323-E The specification of the multiset value expression is invalid. (reason = a subquery of a multiset value expression is a correlated subquery, query number = 2)
Example of the executed SQL statement
SELECT * FROM TABLE (ADB_CSVREAD(MULTISET(SELECT "C1" FROM "V1"), 'COMPRESSION_FORMAT=GZIP;')) "DT"("DC1" INT)
In this example, the underlined query specification (the second query specification from the start of the statement) is invalid. An error occurred in the SQL statement because a disallowed viewed table (a viewed table that includes an external reference column in a view definition) is specified in a table subquery of a multiset value expression.
-
If the invalid part is other than a query specification or table value constructor in an SQL statement, 0 is displayed for the query position number.
(Example)
KFAA30117-E The number of insert values is not equal to the number of insert columns. (query number = 0)
Example of the executed SQL statement
INSERT INTO "T1"("C1") VALUES('XYZ',100)
In this example, an error occurred in the SQL statement because the number of insertion values does not equal the number of insertion columns.