# SQL CODE definitions

#
#
#
#
# @author Campbell Burnet (campbell-burnet@users dot sourceforge.net)
# @author Fred Toussi (fredt@users dot sourceforge.net)
# @version 2.3.5
# @since 1.9.0
#
# do not translate this section
0001=: $$ required: $$
0002=; $$ table: $$
0003=; $$ table: $$ column: $$

# message parts
0021=\u0020table $$ row count error : $$ read, needed $$
0022=\u0020 wrong data for insert operation
0023=attempt to connect while db opening /closing
0024=\u0020line:\u0020
0025=\u0020line: $$ $$
0026=\u0020$$ $$
0027=\u0020$$.properties $$
0028=properties name is null or empty

# message parts
0041=S1000 Error in text source field
0042=openning file: $$ error: $$
0043=closing file: $$ error: $$
0044=purging file: $$ error: $$

# message parts
0051=error $$ reading row - file $$
0052=error $$ opening file - file $$
0053=error $$ closing file - file $$

# message parts
0061=Invalid address : $$\nTry one of: $$
0062=Invalid address : $$
0063=Server certificate has no Common Name
0064=Server certificate has empty Common Name
0065=Certificate Common Name[$$] does not match host name[$$]

# message parts
0070=; ResultSet is empty
0071=; ResultSet is positioned before first row
0072=; ResultSet is positioned after last row

# message parts
0081=; in LIMIT, OFFSET or FETCH

# SQLSTATE definitions
# successful completion
0000=00000 successful completion

# HSQLDB operations
0201=S0500 unsupported internal operation
0301=S0501 no file name specified for source
0302=S0502 no value specified for field
0303=S0503 zero-length separator
0304=S0504 length of text quote character must be 1
0320=S0521 operation is not allowed on text table with data
0321=S0522 invalid statemnet - text table required
0331=S0531 text file encode / decode error
0332=S0532 UTF-16 encoding string required

# HSQLDB authentication
0391=S1000 password complexity

# Server
0401=S1000 Transfer corrupted
0402=S0504 database disconnected
0403=S0504 HSQLDB server version is '$$'  \
           client version '$$' is not compatible.
0404=S0504 Network client is not a HSQLDB JDBC driver
0405=S0504 Client using HSQLDB http protocol instead of hsql
0406=S0504 Incomplete read of handshaking bytes
0407=S1000 no valid database paths

# JDBC
0421=S1000 Column not found
0422=S1000 InputStream error
0423=S1000 Invalid argument in JDBC call
0424=S1000 Parameter not set
0425=S1000 Unknown JDBC escape sequence: {

# HSQLDB non-core and file
0451=S1000 Database lock acquisition failure
0452=S1000 file input/output error
0453=S1000 wrong database file version
0454=S1000 .data file is modified but .backup file does not exist
0455=S1000 The database is in read only mode
0456=S1000 The table data is read only
0457=S1000 Access is denied
0458=S1000 General error
0459=S1000 Database is memory only
0460=S1000 Out of Memory
0461=S1000 error in script file
0462=S1000 Unsupported suffix in file name '$$'.  (Supported suffixes:  $$)
0463=S1000 Mismatch between specified compression mode '$$' and file name '$$'
0464=S1000 Database is non-file type
0465=S1000 Database does not exists
0466=S1000 Data File input/output error
0467=S1000 IO error
0468=S1000 Data File size limit is reached
0469=S1000 Data File is in use
0470=S1000 Backup error
0471=S1000 Data cache size limit is reached
0472=S1000 problem with log file

# text tables
0481=S1000 The table's data source has not been defined
0482=S1000 Invalid TEXT table source string
0483=S1000 bad TEXT table source file - line number: $$ $$
0484=S1000 TEXT table source file - IO error
0485=S1000 end-of-line characters not allowed
0486=S1000 Header not allowed or too long
0487=S1000 Text source file already exists
0488=S1000 No end sep.

# warning
1000=01000 warning
1001=01001 warning: cursor operation conflict
1002=01002 warning: disconnect error
1003=01003 warning: null value eliminated in set function
1004=01004 warning: string data, right truncation
1005=01005 warning: insufficient item descriptor areas
1006=01006 warning: privilege not revoked
1007=01007 warning: privilege not granted
1009=01009 warning: search condition too long for information schema
1010=0100A warning: query expression too long for information schema
1011=0100B warning: default value too long for information schema
1012=0100C warning: result sets returned
1013=0100D warning: additional result sets returned
1014=0100E warning: attempt to return too many result sets
1015=0100F warning: statement too long for information schema
1016=01011 warning: SQL-Java path too long for information schema
1017=0102F warning: array data, right truncation

# no data
1100=02000 no data
1101=02001 no data: no additional result sets returned

# dynamic SQL error
1200=07000 dynamic SQL error
1201=07001 dynamic SQL error: using clause does not match dynamic parameter specifications
1202=07002 dynamic SQL error: using clause does not match target specifications
1203=07003 dynamic SQL error: cursor specification cannot be executed
1204=07004 dynamic SQL error: using clause required for dynamic parameters
1205=07005 dynamic SQL error: prepared statement not a cursor specification
1206=07006 dynamic SQL error: restricted data type attribute violation
1207=07007 dynamic SQL error: using clause required for result fields
1208=07008 dynamic SQL error: invalid descriptor count
1209=07009 dynamic SQL error: invalid descriptor index
1211=0700B dynamic SQL error: data type transform function violation
1212=0700C dynamic SQL error: undefined DATA value
1213=0700D dynamic SQL error: invalid DATA target
1214=0700E dynamic SQL error: invalid LEVEL value
1215=0700F dynamic SQL error: invalid DATETIME_INTERVAL_CODE

# HSQLDB
1251=07501 statement is closed
1252=07502 statement is invalid
1253=07503 statement does not generate a row count
1254=07504 statement does not generate a result set
1255=07505 statement is in batch mode
1256=07506 statement is not in batch mode

# connection exception
1300=08000 connection exception
1301=08001 connection exception: SQL-client unable to establish SQL-connection
1302=08002 connection exception: connection name in use
1303=08003 connection exception: connection does not exist
1304=08004 connection exception: SQL-server rejected establishment of SQL-connection
1305=08006 connection exception: connection failure
1306=08007 connection exception: transaction resolution unknown

# HSQLDB connection exception
1351=08501 connection exception: timed out
1352=08502 warning: unsupported client info
1353=08503 connection exception: closed

# triggered action exception
1400=09000 triggered action exception

# feature not supported
1500=0A000 feature not supported
1501=0A001 feature not supported: multiple server transactions

# HSQLDB feature not supported
1551=0A501 feature not supported:

# invalid target type specification
1600=0D000 invalid target type specification

# invalid schema name list specification
1700=0E000 invalid schema name list specification

# locator exception
1800=0F000 locator exception
1801=0F001 locator exception: invalid specification

# HSQLDB locator
1852=0F502 lob is no longer valid
1853=0F503 lob stream is closed

# resignal when handler not active
1900=0K000 resignal when handler not active

# invalid grantor
2000=0L000 invalid grantor

# HSQLDB
2051=0L501 invalid grantor - lacks CREATE_SCHEMA privilege

# invalid SQL-invoked procedure reference
2100=0M000 invalid SQL-invoked procedure reference

# invalid role specification
2200=0P000 invalid role specification

# HSQLDB
2251=0P501 invalid role specification - circular grant
2252=0P502 invalid role specification - already granted
2253=0P503 invalid role specification - does not have role

# invalid transform group name specification
2300=0S000 invalid transform group name specification

# target table disagrees with cursor specification
2400=0T000 target table disagrees with cursor specification

# attempt to assign to non-updatable column
2500=0U000 attempt to assign to non-updatable column

# attempt to assign to ordering column
2600=0V000 attempt to assign to ordering column

# prohibited statement encountered during trigger execution
2700=0W000 prohibited statement encountered during trigger execution

# invalid foreign server specification
2800=0X000 invalid foreign server specification

# pass-through specific condition
2900=0Y000 pass-through specific condition
2901=0Y001 pass-through specific condition: invalid cursor option
2902=0Y002 pass-through specific condition: invalid cursor allocation

# diagnostics exception
3000=0Z000 diagnostics exception
3001=0Z001 diagnostics exception: maximum number of stacked diagnostics areas exceeded

# 04-PSM
3003=0Z002 diagnostics exception: stacked diagnostics accessed without active handler

# 04-PSM
3100=20000 case not found for case statement

# cardinality violation
3201=21000 cardinality violation

# data exception
3400=22000 data exception
3401=22001 data exception: string data, right truncation
3402=22002 data exception: null value, no indicator parameter
3403=22003 data exception: numeric value out of range
3404=22004 data exception: null value not allowed
3405=22005 data exception: error in assignment
3406=22006 data exception: invalid interval format
3407=22007 data exception: invalid datetime format
3408=22008 data exception: datetime field overflow
3409=22009 data exception: invalid time zone displacement value
3410=2200B data exception: escape character conflict
3411=2200C data exception: invalid use of escape character
3412=2200D data exception: invalid escape octet
3413=2200E data exception: null value in array target
3414=2200F data exception: zero-length character string
3415=2200G data exception: most specific type mismatch
3416=2200H data exception: sequence generator limit exceeded
3417=2200J data exception: nonidentical notations with the same name
3418=2200K data exception: nonidentical unparsed entities with the same name
3419=2200L data exception: not an XML document
3420=2200M data exception: invalid XML document
3421=2200N data exception: invalid XML content
3422=2200P data exception: interval value out of range
3423=2200Q data exception: multiset value overflow
3424=2200R data exception: XML value overflow
3425=2200S data exception: invalid comment
3426=2200T data exception: invalid processing instruction
3427=2200U data exception: not an XQuery document node
3428=2200V data exception: invalid XQuery context item
3429=2200W data exception: XQuery serialization error
3430=22010 data exception: invalid indicator parameter value
3431=22011 data exception: substring error
3432=22012 data exception: division by zero
3433=22013 data exception: invalid preceding or following size in window function
3434=22014 data exception: invalid argument for NTILE function
3435=22015 data exception: interval field overflow
3436=22016 data exception: invalid argument for NTH_VALUE function
3437=22017 data exception: invalid data specified for datalink
3438=22018 data exception: invalid character value for cast
3439=22019 data exception: invalid escape character
3440=2201A data exception: null argument passed to datalink constructor
3441=2201B data exception: invalid regular expression
3442=2201C data exception: null row not permitted in table
3443=2201D data exception: datalink value exceeds maximum length
3444=2201E data exception: invalid argument for natural logarithm
3445=2201F data exception: invalid argument for power function
3446=2201G data exception: invalid argument for width bucket function
3447=2201J data exception: XQuery sequence cannot be validated
3448=2201S data exception: invalid XQuery regular expression
3449=2201T data exception: invalid XQuery option flag
3450=2201U data exception: attempt to replace a zero-length string
3451=2201V data exception: invalid XQuery replacement string
3452=2201W data exception: invalid row count in fetch first clause
3453=2201X data exception: invalid row count in result offset clause
3454=22021 data exception: character not in repertoire
3455=22022 data exception: indicator overflow
3456=22023 data exception: invalid parameter value
3457=22024 data exception: unterminated C string
3458=22025 data exception: invalid escape sequence
3459=22026 data exception: string data, length mismatch
3460=22027 data exception: trim error
3461=22029 data exception: noncharacter in UCS string
3462=22020 data exception: invalid period value

# HSQLDB data exception
3471=22501 value cannot be converted to target type
3472=22511 invalid function argument
3473=22521 object serialization failure
3474=22522 query execution reached limit of recursion

# 04-PSM
3488=2202A data exception: null value in field reference
3489=2202D data exception: null value substituted for mutator subject parameter
3490=2202E data exception: array element error
3491=2202F data exception: array data, right truncation
3492=2202G data exception: invalid repeat argument in a sample clause
3493=2202H data exception: invalid sample size

# integrity constraint violation
3500=23000 integrity constraint violation
3501=23001 integrity constraint violation: restrict violation
0010=23502 integrity constraint violation: NOT NULL check constraint
0177=23503 integrity constraint violation: foreign key no parent
0008=23504 integrity constraint violation: foreign key no action
0104=23505 integrity constraint violation: unique constraint or index violation
0157=23513 integrity constraint violation: check constraint

# invalid cursor state
3600=24000 invalid cursor state
3601=24501 invalid cursor state: identified cursor is not open
3602=24502 invalid cursor state: identified cursor is already open
3603=24504 invalid cursor state: identifier cursor not positioned on row in UPDATE, DELETE, SET, or GET statement
3604=24513 invalid cursor state: cannot FETCH NEXT, PRIOR, CURRENT, or RELATIVE, cursor position is unknown
3605=24514 invalid cursor state: cursor disabled by previous error
3606=24515 invalid cursor state: all column must be set before insert
3621=24521 invalid cursor state: row has been modified outside the cursor

# invalid transaction state
3700=25000 invalid transaction state
3701=25001 invalid transaction state: active SQL-transaction
3702=25002 invalid transaction state: branch transaction already active
3703=25003 invalid transaction state: inappropriate access mode for branch transaction
3704=25004 invalid transaction state: inappropriate isolation level for branch transaction
3705=25005 invalid transaction state: no active SQL-transaction for branch transaction
3706=25006 invalid transaction state: read-only SQL-transaction
3707=25007 invalid transaction state: schema and data statement mixing not supported
3708=25008 invalid transaction state: held cursor requires same isolation level

# invalid SQL statement name
3800=26000 invalid SQL statement name

# triggered data change violation
3900=27000 triggered data change violation

# invalid authorization specification
4000=28000 invalid authorization specification

# HSQLDB invalid authorization specification
4001=28501 invalid authorization specification - not found
4002=28502 invalid authorization specification - system identifier
4003=28503 invalid authorization specification - already exists

# syntax error or access rule violation in direct statement
4100=2A000 syntax error or access rule violation in direct statement

# dependent privilege descriptors still exist
4200=2B000 dependent privilege descriptors still exist

# invalid character set name
4300=2C000 invalid character set name

# invalid transaction termination
4400=2D000 invalid transaction termination
4401=2D522 invalid transaction termination: COMMIT and ROLLBACK not allowed in ATOMIC compound statement

# invalid connection name
4500=2E000 invalid connection name

# SQL routine exception
4600=2F000 SQL routine exception
4602=2F002 SQL routine exception: modifying SQL-data not permitted
4603=2F003 SQL routine exception: prohibited SQL-statement attempted
4604=2F004 SQL routine exception: reading SQL-data not permitted
4605=2F005 SQL routine exception: function did not execute return statement

# invalid collation name
4650=2H000 invalid collation name

# invalid SQL statement identifier
4660=30000 invalid SQL statement identifier

# invalid SQL descriptor name
4670=33000 invalid SQL descriptor name

# invalid cursor name
4680=34000 invalid cursor name

# invalid condition number
4690=35000 invalid condition number

# cursor sensitivity exception
4700=36000 cursor sensitivity exception
4701=36001 cursor sensitivity exception: request rejected
4702=36002 cursor sensitivity exception: request failed

# cursor compatibility warnings
4711=36501 cursor sensitivity mismatch
4712=36502 cursor updatability mismatch
4713=36503 cursor holdability mismatch

# syntax error or access rule violation in dynamic statement
4790=37000 syntax error or access rule violation in dynamic statement

# external routine exception
4800=38000 external routine exception
4801=38001 external routine exception: containing SQL not permitted
4802=38002 external routine exception: modifying SQL-data not permitted
4803=38003 external routine exception: prohibited SQL-statement attempted
4804=38004 external routine exception: reading SQL-data not permitted

# external routine invocation exception
4810=39000 external routine invocation exception
4811=39004 external routine invocation exception: null value not allowed

# savepoint exception
4820=3B000 savepoint exception
4821=3B001 savepoint exception: invalid specification
4822=3B002 savepoint exception: too many

# ambiguous cursor name
4830=3C000 ambiguous cursor name

# invalid catalog name
4840=3D000 invalid catalog name

# invalid schema name
4850=3F000 invalid schema name

# transaction rollback
4860=40000 transaction rollback
4861=40001 transaction rollback: serialization failure
4862=40002 transaction rollback: integrity constraint violation
4863=40003 transaction rollback: statement completion unknown
4864=40004 transaction rollback: triggered action exception

# HSQLDB internal transactions
4871=40501 transaction rollback: row change by multiple transactions
4872=40502 statement execution aborted: timeout reached

# syntax error or access rule violation
5000=42000 syntax error or access rule violation

# HSQLDB database object names
5501=42501 user lacks privilege or object not found
5502=42502 dependent objects exist
5503=42503 system object cannot be modified
5504=42504 object name already exists
5505=42505 invalid schema name - name mismatch
5506=42506 invalid catalog name
5507=42507 admin rights required
5508=42508 label not found
5509=42509 type not found or user lacks privilege
5510=42510 name too long

# genrated columns
5512=42512 invalid expression in CHECK or GENERATED clause
5513=42513 assignment to generated column

# constraint defintition issues
5520=42520 SET NULL requires nullable column
5521=42521 SET DEFAULT requires column default expression for
5522=42522 a UNIQUE constraint already exists on the set of columns
5523=42523 table has no primary key
5524=42524 constraint definition not allowed
5525=42525 identity definition not allowed
5526=42526 column is in primary key
5527=42527 column is in constraint
5528=42528 a FOREIGN KEY constraint already exists on the set of columns
5529=42529 a UNIQUE constraint does not exist on referenced columns
5530=42530 primary key definition not allowed
5531=42531 default expression needed
5532=42532 primary key already exist
5533=42533 is referenced by FOREIGN KEY constraint
5534=42534 column of LOB or ARRAY type cannot be used in operation

# other definition issues
5535=42535 not an identity column
5536=42536 column is referenced in
5537=42537 cannot use WITH CHECK OPTION for read-only view
5538=42538 TRIGGER definition not compatible with table
5539=42539 cannot drop a user that is currently connected

# DML
5541=42541 requires DEFAULT keyword
5542=42542 requires OVERRIDING clause
5543=42543 requires either DEFAULT keyword or OVERRIDING clause
5544=42544 DEFAULT keyword cannot be used as column has no DEFAULT
5545=42545 INSERT, UPDATE, DELETE or TRUNCATE not permitted for table or view
5546=42546 number of target columns does not match that of query expression
5547=42547 WHEN MATCHED already used in MERGE
5548=42548 WHEN NOT MATCHED already used in MERGE
5549=42549 LIMIT, OFFSET or FETCH already used

#
5551=42551 too many identifier parts
5555=42555 invalid property name
5556=42556 invalid property value

# HSQLDB type conversion
5561=42561 incompatible data type in conversion
5562=42562 incompatible data types in combination
5563=42563 incompatible data type in operation
5564=42564 row column count mismatch
5565=42565 row expression not allowed
5566=42566 interval qualifier missing or not valid
5567=42567 data type cast needed for parameter or null literal
5568=42568 data type of expression is not boolean
5569=42569 quoted identifier required
5570=42570 concatenation exceeds maximum type length

#
5571=42571 NULL literal not allowed
5572=42572 invalid GROUP BY expression
5573=42573 invalid HAVING expression
5574=42574 expression not in aggregate or GROUP BY columns
5575=42575 parameter marker not allowed
5576=42576 invalid ORDER BY expression
5577=42577 duplicate column name in column list
5578=42578 duplicate column name in derived table
5579=42579 duplicate update of column
5580=42580 ambiguous column reference

# lexical elements
5581=42581 unexpected token
5582=42582 unknown token
5583=42583 malformed quoted identifier
5584=42584 malformed string
5585=42585 malformed numeric constant
5586=42586 malformed unicode string
5587=42587 malformed binary string
5588=42588 malformed bit string
5589=42589 malformed comment
5590=42590 unexpected end of statement

# other
5591=42591 needs column or cannot drop sole column of table
5592=42592 precision or scale out of range
5593=42593 column count mismatch in column name list
5594=42594 column number mismatch detected in rows of UNION, INTERSECT, EXCEPT, or VALUES operation
5595=42595 invalid privilege specified - ALL PRIVILEGES required
5596=42596 schema qualifier does not match enclosing create schema statement.
5597=42597 number out of the valid range for sequence generator
5598=42598 sequence expression cannot be used in this context
5599=42599 length must be specified in type definition

# HSQLDB - PSM definition and calls
5601=42601 repeat handler declaration
5602=42602 invalid statement
5603=42603 dynamic parameter or variable required as INOUT or OUT argument
5604=42604 SQL routine exception: incompatible declaration attributes
5605=42605 SQL routine exception: routine signature already exists
5606=42606 SQL routine exception: variable name already exists
5607=42607 invalid SQLSTATE value
5608=42608 wrong or missing data impact clause in declaration
5609=42609 routine signature not found for
5610=42610 wrong signature for aggregate function declaration
5611=42611 type incompatible with declared return type
5612=42612 SQL exception already used

# with check option violation
5700=44000 with check option violation

# 04-PSM
# unhandled user-defined exception
5800=45000 unhandled user-defined exception

# Java execution
6000=46000 Java execution
6001=46001 Java execution: invalid URL
6002=46002 Java execution: invalid JAR name
6003=46003 Java execution: invalid class deletion
6004=46005 Java execution: invalid replacement
6007=4600A Java execution: attempt to replace uninstalled JAR
6008=4600B Java execution: attempt to remove uninstalled JAR
6009=4600C Java execution: invalid JAR removal
6010=4600D Java execution: invalid path
6011=4600E Java execution: self-referencing path
6012=46102 Java execution: invalid JAR name in path
6013=46103 Java execution: unresolved class name, method name or signature

# HSQLDB - SQL/JRT
6021=46511 declared parameter types do not match method signature

# Unknown Error: Catch-All
6500=99000 Unknown Error: Catch-All
6501=99099 Unknown Error: Error converting vendor code to SQL state code

# FDW-specific condition
6600=HV000 FDW-specific condition
6601=HV001 FDW-specific condition: memory allocation error
6602=HV002 FDW-specific condition: dynamic parameter value needed
6603=HV004 FDW-specific condition: invalid data type
6604=HV005 FDW-specific condition: column name not found
6605=HV006 FDW-specific condition: invalid data type descriptors
6606=HV007 FDW-specific condition: invalid column name
6607=HV008 FDW-specific condition: invalid column number
6608=HV009 FDW-specific condition: invalid use of null pointer
6609=HV00A FDW-specific condition: invalid string format
6610=HV00B FDW-specific condition: invalid handle
6611=HV00C FDW-specific condition: invalid option index
6612=HV00D FDW-specific condition: invalid option name
6613=HV00J FDW-specific condition: option name not found
6614=HV00K FDW-specific condition: reply handle
6615=HV00L FDW-specific condition: unable to create execution
6616=HV00M FDW-specific condition: unable to create reply
6617=HV00N FDW-specific condition: unable to establish connection
6618=HV00P FDW-specific condition: no schemas
6619=HV00Q FDW-specific condition: schema not found
6620=HV00R FDW-specific condition: table not found
6621=HV010 FDW-specific condition: function sequence error
6622=HV014 FDW-specific condition: limit on number of handles exceeded
6623=HV021 FDW-specific condition: inconsistent descriptor information
6624=HV024 FDW-specific condition: invalid attribute value
6625=HV090 FDW-specific condition: invalid string length or buffer length
6626=HV091 FDW-specific condition: invalid descriptor field identifier

# datalink exception
6700=HW000 datalink exception
6701=HW001 datalink exception: external file not linked
6702=HW002 datalink exception: external file already linked
6703=HW003 datalink exception: referenced file does not exist
6704=HW004 datalink exception: invalid write token
6705=HW005 datalink exception: invalid datalink construction
6706=HW006 datalink exception: invalid write permission for update
6707=HW007 datalink exception: referenced file not valid

# CLI-specific condition
6800=HY093 CLI-specific condition: invalid datalink value

