SQLCode

合集下载

sqlcode大模型 中文

sqlcode大模型 中文

sqlcode大模型中文英文回答:SQLCODE, short for Structured Query Language Code, is a code that identifies the type of error or warning that occurred during the execution of an SQL statement. It is a three-digit numeric code, where the first digit indicates the class of the error, the second digit indicates the subtype of the error, and the third digit indicates the specific error.SQLCODE values can be positive or negative. Positive values indicate a warning, while negative values indicate an error. The most common SQLCODE values are:0: No error or warning.100: Warning.200: Syntax error.300: Data type error.400: Constraint violation.500: Privileges error.600: System error.SQLCODE values can be used to identify the cause of an error or warning, and to take appropriate action to resolve the issue. For example, if a SQLCODE value of 200 is returned, it indicates that a syntax error occurred. The developer can then check the SQL statement for typos or other syntax errors.SQLCODE values can also be used to provide more information about an error or warning. For example, a SQLCODE value of 400 can be returned with a message that indicates the specific constraint that was violated. The developer can then use this information to determine how to resolve the issue.中文回答:SQLCODE,即结构化查询语言代码,是一个用于标识在执行 SQL 语句期间发生的错误或警告类型的代码。

oracle procedure sqlcode用法

oracle procedure sqlcode用法

oracle procedure sqlcode用法Oracle PL/SQL中的SQLCODE是一个系统变量,用于返回最近一次SQL语句执行时的错误代码。

它可以被用来判断SQL语句的执行是否成功,并根据错误代码进行相应的处理。

在这篇文章中,我将逐步介绍SQLCODE的用法和相关的注意事项。

第一步:了解SQLCODE的概念和基本用法(300字)SQLCODE是一个整数值,用于表示最近一次SQL语句执行的结果状态。

如果SQL语句执行成功,SQLCODE将返回0;如果SQL语句执行失败,SQLCODE 将返回一个非零的错误代码。

在PL/SQL中,我们可以使用SQLCODE来检查上一次SQL语句的执行结果,然后根据错误代码来进行处理。

第二步:使用SQLCODE检查语句执行结果(600字)为了使用SQLCODE来检查SQL语句的执行结果,我们可以在SQL语句执行后立即使用SQLCODE来获取错误代码。

以下是一个示例:sqlDECLAREl_error_code INTEGER;BEGIN执行SQL语句UPDATE employeesSET salary = salary * 1.1WHERE department_id = 10;获取错误代码l_error_code := SQLCODE;判断是否执行成功IF l_error_code = 0 THENDBMS_OUTPUT.PUT_LINE('SQL statement executed successfully.'); ELSEDBMS_OUTPUT.PUT_LINE('Error occurred. Error code: 'l_error_code);END IF;END;/在上面的示例中,我们执行了一个更新语句,将部门ID为10的员工的薪水增加10%。

然后,我们使用SQLCODE将错误代码存储在一个变量中,并根据错误代码判断SQL语句是否执行成功。

sqlca.sqlcode error message -回复

sqlca.sqlcode error message -回复

sqlca.sqlcode error message -回复SQLCA.SQLCODE是一个变量,用于存储SQL语句执行时返回的错误代码。

当执行SQL语句出现错误时,可以通过检查SQLCA.SQLCODE 的值来确定错误类型和原因。

本文将详细介绍SQLCA.SQLCODE的作用、常见错误代码及其含义,并提供一些解决这些错误的方法。

第一步:介绍SQLCA.SQLCODE的作用和意义(200字)SQLCA.SQLCODE是一个在SQL编程中经常使用的变量,它用于存储SQL语句执行时返回的错误代码。

这个错误代码是数据库管理系统(DBMS)根据SQL语句的执行情况自动设定的,它可以告诉开发人员在SQL语句执行过程中出现了什么问题。

在编程中,我们通常需要处理各种可能出现的错误情况。

当执行SQL 语句时,如果发生错误,DBMS将会设定一个与该错误对应的错误代码,并将其存储在SQLCA.SQLCODE变量中。

我们可以通过检查SQLCA.SQLCODE的值来确定错误的类型和原因,从而根据具体情况进行处理。

第二步:常见错误代码及其含义(800字)下面是一些常见的SQL错误代码及其含义:1. SQLCODE = -911:表示发生了死锁。

这意味着在多个进程之间存在竞争资源的冲突,导致无法继续执行当前的SQL语句。

解决方法可以是等待片刻后重试,或者重新设计数据库结构以减少资源竞争。

2. SQLCODE = -904:表示找不到相关的表或视图。

这可能是由于表或视图不存在、没有权限访问或者表名拼写错误导致的。

解决方法可以是检查表名或视图名的拼写是否正确,并确保具有访问相应表的权限。

3. SQLCODE = -818:表示数据类型不匹配。

这一错误通常发生在尝试将不兼容的数据类型赋值给变量或进行比较运算时。

解决方法可以是检查数据类型是否正确匹配,并进行必要的数据转换。

4. SQLCODE = -305:表示在对表进行修改时违反了完整性约束。

SQLCODE错误参数

SQLCODE错误参数
+495 01616 因为倒台SQL的成本估算超出了在ELST中指定的警告阀值,所以发出警告
+535 01591 请求一个主健的定位更新,或请求一个使用自我引出约束的表的删除操作
+541 01543 命名外健是一个重复的引用约束
+551 01548 命名的授权ID缺少在命名的DB2对象上执行命名操作的权限
+30100 01558 分布式协议错误被检测到,提供原来的SQLCODE和SQLSTATE
-007 42601 SQL语句中由非法字符
-010 42603 字符串常量非正常终止;检查到有遗漏的引号标志 Biblioteka 029 42601 需要INTO语句
CHANGES表的列
-150 42807 触发活动的INSERT,UPDATE或DELETE语句中指定了无效的视图更新或一个无效的转换表
-151 42808 试图更新一个不可更新的视图的列、一个DB2 CATALOG表的列或者一个ROWID列
-152 42809 DROP CHECK试图删除一个参照约束,或者DROP FOREIGN试图删除一个检查约束
+100 02000 没有找到满足SQL语句的行
+110 01561 用DATA CAPTURE定义的表的更新操作不能发送到原来的子系统
+111 01590 为2型索引设置了SUBPAGES语句
+117 01525 要插入的值的个数不等于被插入表的列数
+552 01542 命名的授权ID缺少执行命名操作的权限
+558 01516 已经被授权该PUBLIC,因此WITH GRANT OPTION不可用

sqlcode详细说明

sqlcode详细说明
...
WHEN DUP_VAL_ON_INDEX THEN -- ORA-00001 SQLCODE = -1 向唯一索引中插入重复数据
...
WHEN INVALID_CURSOR THEN -- ORA-01001 SQLCODE = -1001 非法游标操作
...
WHEN INVALID_NUMBER THEN -- ORA-01722 SQLCODE = -1722 字符向数字转换失败
...
WHEN TOO_MANY_ROWS THEN -- ORA-01422 SQLCODE = -1422 返回多行
...
WHEN TRANSACTION_BACKED_OUT THEN -- ORA-00061 SQLCODE = -61
...
WHEN VALUE_ERROR THEN -- ORA-06502 SQLCODE = -6502 数值转换错误
例:
DECLARE
ZERO_DIVIDE1 EXCEPTION;
PRAGMA EXCEPTION_INIT(ZERO_DIVIDE1, -1476);
BEGIN
...
EXCEPTION
WHEN ZERO_DIVIDE1 THEN
...
END;
ORACLE PL/SQL 例外处理
1) 基本结构
BEGIN
...
WHEN LOGIN_DENIED THEN -- ORA-01017 SQLCODE = -1017
...
WHEN NO_DATA_FOUND THEN -- ORA-01403 SQLCODE = +100 没有找到数据
...
WHEN NOT_LOGGED_ON THEN -- ORA-01012 SQLCODE = -1012

db2 sqlcode命令

db2 sqlcode命令

db2 sqlcode命令
DB2sqlcode命令是在DB2数据库中用于查询错误码的命令。

通常情况下,可以通过以下方式使用该命令:
在DB2命令行中输入`db2 ? sql(sqlcode)n`,DBMS会给出相应的错误码提示。

通过DB2sqlcode命令,可以获取到错误码所代表的具体意义,从而帮助开发人员或管理员更快速地定位和解决问题。

需要注意的是,不同的错误码可能代表不同的问题,具体的解决方案需要根据实际情况进行判断。

如果你在使用DB2过程中遇到问题,建议查阅相关的文档或参考手册,或者联系DB2数据库的支持团队以获取更多帮助和指导。

DB2SQLCODE大全

DB2SQLCODE大全

DB2SQLCODE⼤全DB2错误信息sqlcode sqlstate 说明000 00000 SQL语句成功完成01xxx SQL语句成功完成,但是有警告+012 01545 未限定的列名被解释为⼀个有相互关系的引⽤+098 01568 动态SQL语句⽤分号结束+100 02000 没有找到满⾜SQL语句的⾏+110 01561 ⽤DATA CAPTURE定义的表的更新操作不能发送到原来的⼦系统+111 01590 为2型索引设置了SUBPAGES语句+117 01525 要插⼊的值的个数不等于被插⼊表的列数+162 01514 指定的表空间被置为检查挂起状态+203 01552 使⽤⾮唯⼀的名字来解决命名的限定列+204 01532 命名的对象未在DB2中定义+206 01533 命名的列不在SQL语句中指定的任何表中存在+218 01537 因为SQL语句引⽤⼀个远程对象,不能为该SQL语句执⾏EXPLAIN+219 01532 命名的PLAN TABLE不存在+220 01546 不正确定义PLAN TABLE,检查命名列的定义+236 01005 SQLDA中的SQLN的值⾄少应于所描述的列的个数⼀样⼤+237 01594 ⾄少有⼀个被描述的列应该是单值类型,因此扩展的SQLVAR条⽬需要另外的空间+238 01005 ⾄少应有⼀个被描述的列是⼀个LOB,因此扩展的SQLVAR条⽬需要另外的空间+239 01005 ⾄少应有⼀个被描述的列应是单值类型,因此扩展的SQLVAR条⽬需要另外的空间+304 01515 该值不能被分配给宿主变量,因为该值不再数据类型的范围之内+331 01520 不能被翻译的字符串,因此被设置为NULL+339 01569 由于与DB2 2.2版本的⼦系统连接,所以可能存在字符转换问题+394 01629 使⽤优化提⽰来选择访问路径+395 01628 设置了⽆效的优化提⽰,原因代码指定了为什么,忽略优化提⽰+402 01521 未知的位置+403 01522 本地不存在CREAT ALIAS对象+434 01608 在DB2未来发布的版本中将不⽀持指定的特性,IBM建议你停⽌使⽤这些特性+445 01004 值被CAST函数截取+462 01Hxx 由⽤户定义的函数或存储过程发出的警告+464 01609 命名的存储过程超出了它可能返回的查询结果集的个数限制+466 01610 指定由命名的存储过程返回的查询结果集的个数。

SQLCODE错误参数

SQLCODE错误参数

‎ SQL‎C ODE ‎S QLST‎A TE S‎Q LSTA‎T E 说明‎‎ 00‎0 000‎00 SQ‎L语句成功‎完成‎‎ 01‎x xx S‎Q L语句成‎功完成,但‎是有警告‎‎ +01‎2 015‎45 未限‎定的列名被‎解释为一个‎有相互关系‎的引用‎‎+098‎0156‎8动态S‎Q L语句用‎分号结束‎‎ +10‎0 020‎00 没有‎找到满足S‎Q L语句的‎行‎ +‎110 0‎1561 ‎用DATA‎CAPT‎U RE定义‎的表的更新‎操作不能发‎送到原来的‎子系统‎‎+111‎0159‎0为2型‎索引设置了‎S UBPA‎G ES语句‎‎ +1‎17 01‎525 要‎插入的值的‎个数不等于‎被插入表的‎列数‎‎+162 ‎01514‎指定的表‎空间被置为‎检查挂起状‎态‎ +‎203 0‎1552 ‎使用非唯一‎的名字来解‎决命名的限‎定列‎‎+204 ‎01532‎命名的对‎象未在DB‎2中定义‎‎ +20‎6 015‎33 命名‎的列不在S‎Q L语句中‎指定的任何‎表中存在‎‎ +21‎8 015‎37 因为‎S QL语句‎引用一个远‎程对象,不‎能为该SQ‎L语句执行‎E XPLA‎I N‎‎+219 ‎01532‎命名的P‎L AN T‎A BLE不‎存在‎‎+220 ‎01546‎不正确定‎义PLAN‎TABL‎E,检查命‎名列的定义‎‎ +2‎36 01‎005 S‎Q LDA中‎的SQLN‎的值至少应‎于所描述的‎列的个数一‎样大‎‎+237 ‎01594‎至少有一‎个被描述的‎列应该是单‎值类型,因‎此扩展的S‎Q LVAR‎条目需要另‎外的空间‎‎ +23‎8 010‎05 至少‎应有一个被‎描述的列是‎一个LOB‎,因此扩展‎的SQLV‎A R条目需‎要另外的空‎间‎ +‎239 0‎1005 ‎至少应有一‎个被描述的‎列应是单值‎类型,因此‎扩展的SQ‎L VAR条‎目需要另外‎的空间‎‎+304‎0151‎5该值不‎能被分配给‎宿主变量,‎因为该值不‎再数据类型‎的范围之内‎‎ +3‎31 01‎520 不‎能被翻译的‎字符串,因‎此被设置为‎N ULL ‎‎ +33‎9 015‎69 由于‎与DB2 ‎2.2版本‎的子系统连‎接,所以可‎能存在字符‎转换问题‎‎ +39‎4 016‎29 使用‎优化提示来‎选择访问路‎径‎ +‎395 0‎1628 ‎设置了无效‎的优化提示‎,原因代码‎指定了为什‎么,忽略优‎化提示‎‎+402‎0152‎1未知的‎位置‎‎+403 ‎01522‎本地不存‎在CREA‎T ALI‎A S对象‎‎ +43‎4 016‎08 在D‎B2未来发‎布的版本中‎将不支持指‎定的特性,‎I BM建议‎你停止使用‎这些特性‎‎ +44‎5 010‎04 值被‎C AST函‎数截取‎‎+462‎01Hx‎x由用户‎定义的函数‎或存储过程‎发出的警告‎‎ +4‎64 01‎609 命‎名的存储过‎程超出了它‎可能返回的‎查询结果集‎的个数限制‎‎ +4‎66 01‎610 指‎定由命名的‎存储过程返‎回的查询结‎果集的个数‎。

最新DB2的常见SQLCODE所表示负数的含义

最新DB2的常见SQLCODE所表示负数的含义

DB2的常见SQLCODE所表示负数的含义SQL0007 SQLCODE -07 SQLSTATE 42601Explanation: Character &1 (HEX &2) not valid in SQL statement. SQL0010 SQLCODE -10 SQLSTATE 42603Explanation: String constant beginning &1 not delimited.SQL0029 SQLCODE -29 SQLSTATE 42601Explanation: INTO clause missing from embedded SELECT statement. SQL0051 SQLCODE -51 SQLSTATE 3C000Explanation: Cursor or procedure &1 previously declared.SQL0060 SQLCODE -60 SQLSTATE 42815Explanation: Value &3 for argument &1 of &2 function not valid. SQL0078 SQLCODE -78 SQLSTATE 42629Explanation: Parameter name required for routine &1 in &2.SQL0080 SQLCODE -80 SQLSTATE 42978Explanation: Indicator variable &1 not SMALLINT type.SQL0084 SQLCODE -84 SQLSTATE 42612Explanation: SQL statement not allowed.SQL0090 SQLCODE -90 SQLSTATE 42618Explanation: Host variable not permitted here.SQL0097 SQLCODE -97 SQLSTATE 42601 Explanation: Use of data type not valid.SQL0099 SQLCODE -99 SQLSTATE 42992 Explanation: Operator in join condition not valid.SQL0101 SQLCODE -101 SQLSTATE 54001, 54010, 54011 Explanation: SQL statement too long or complex.SQL0102 SQLCODE -102 SQLSTATE 54002 Explanation: String constant beginning with &1 too long. SQL0103 SQLCODE -103 SQLSTATE 42604 Explanation: Numeric constant &1 not valid.SQL0104 SQLCODE -104 SQLSTATE 42601 Explanation: Token &1 was not valid. Valid tokens: &2. SQL0105 SQLCODE -105 SQLSTATE 42604 Explanation: Mixed or graphic string constant not valid. SQL0106 SQLCODE -106 SQLSTATE 42611 Explanation: Precision specified for FLOAT column not valid.SQL0107 SQLCODE -107 SQLSTATE 42622Explanation: &1 too long. Maximum &2 characters.SQL0109 SQLCODE -109 SQLSTATE 42601Explanation: &1 clause not allowed.SQL0110 SQLCODE -110 SQLSTATE 42606Explanation: Hexadecimal constant beginning with &1 not valid.SQL0112 SQLCODE -112 SQLSTATE 42607Explanation: Argument of function &1 is another function.SQL0113 SQLCODE -113 SQLSTATE 28000, 2E000, 42602 Explanation: Name &1 not allowed.SQL0114 SQLCODE -114 SQLSTATE 42961Explanation: Relational database &1 not the same as current server &2. SQL0115 SQLCODE -115 SQLSTATE 42601Explanation: Comparison operator &1 not valid.SQL0117 SQLCODE -117 SQLSTATE 42802Explanation: Statement inserts wrong number of values.SQL0118 SQLCODE -118 SQLSTATE 42902Explanation: Table &1 in &2 also specified in a FROM clause.SQL0119 SQLCODE -119 SQLSTATE 42803 Explanation: Column &1 in HAVING clause not in GROUP BY. SQL0120 SQLCODE -120 SQLSTATE 42903 Explanation: Use of column function &2 not valid.SQL0121 SQLCODE -121 SQLSTATE 42701Explanation: Duplicate column name &1 in INSERT or UPDATE. SQL0122 SQLCODE -122 SQLSTATE 42803 Explanation: Column specified in SELECT list not valid.SQL0125 SQLCODE -125 SQLSTATE 42805 Explanation: ORDER BY column number &1 not valid.SQL0128 SQLCODE -128 SQLSTATE 42601 Explanation: Use of NULL is not valid.SQL0129 SQLCODE -129 SQLSTATE 54004 Explanation: Too many tables in SQL statement.SQL0130 SQLCODE -130 SQLSTATE 22019, 22025 Explanation: Escape character &1 or LIKE pattern not valid. SQL0131 SQLCODE -131 SQLSTATE 42818Explanation: Operands of LIKE not compatible or not valid.SQL0132 SQLCODE -132 SQLSTATE 42824Explanation: LIKE predicate not valid.SQL0133 SQLCODE -133 SQLSTATE 42906Explanation: Operator on correlated column in SQL function not valid.SQL0134 SQLCODE -134 SQLSTATE 42907Explanation: Argument of function too long.SQL0136 SQLCODE -136 SQLSTATE 54005Explanation: ORDER BY or GROUP BY columns too long.SQL0137 SQLCODE -137 SQLSTATE 54006Explanation: Result too long.SQL0138 SQLCODE -138 SQLSTATE 22011Explanation: Argument &1 of SUBSTR function not valid.SQL0144 SQLCODE -144 SQLSTATE 58003Explanation: Section number not valid.SQL0145 SQLCODE -145 SQLSTATE 55005Explanation: Recursion not supported for an application server other than the AS/400 system. SQL0150 SQLCODE -150 SQLSTATE 42807Explanation: View or logical file &1 in &2 read-only.SQL0151 SQLCODE -151 SQLSTATE 42808Explanation: Column &1 in table &2 in &3 read-only.SQL0152 SQLCODE -152 SQLSTATE 42809Explanation: Constraint type not valid for constraint &1 in &2. SQL0153 SQLCODE -153 SQLSTATE 42908Explanation: Column list required for CREATE VIEW.SQL0154 SQLCODE -154 SQLSTATE 42909Explanation: UNION and UNION ALL for CREATE VIEW not valid. SQL0156 SQLCODE -156 SQLSTATE 42809Explanation: &1 in &2 not a table.SQL0157 SQLCODE -157 SQLSTATE 42810Explanation: View &1 in &2 not valid in FOREIGN KEY clause. SQL0158 SQLCODE -158 SQLSTATE 42811Explanation: Number of columns specified not consistent. SQL0159 SQLCODE -159 SQLSTATE 42809Explanation: &1 in &2 not correct type.SQL0160 SQLCODE -160 SQLSTATE 42813Explanation: WITH CHECK OPTION not allowed for view &1 in &2. SQL0161 SQLCODE -161 SQLSTATE 44000Explanation: INSERT/UPDATE not allowed due to WITH CHECK OPTION. SQL0170 SQLCODE -170 SQLSTATE 42605Explanation: Number of arguments for function &1 not valid.SQL0171 SQLCODE -171 SQLSTATE 42815Explanation: Argument &1 of function &2 not valid.SQL0175 SQLCODE -175 SQLSTATE 58028Explanation: COMMIT failed.SQL0180 SQLCODE -180 SQLSTATE 22007Explanation: Syntax of date, time, or timestamp value not valid.SQL0181 SQLCODE -181 SQLSTATE 22007Explanation: Value in date, time, or timestamp string not valid.SQL0182 SQLCODE -182 SQLSTATE 42816Explanation: A date, time, or timestamp expression not valid.SQL0183 SQLCODE -183 SQLSTATE 22008Explanation: The result of a date or timestamp expression not valid.SQL0184 SQLCODE -184 SQLSTATE 42610Explanation: Parameter marker not valid in expression.SQL0187 SQLCODE -187 SQLSTATE 42816Explanation: Use of labeled duration is not valid.SQL0188 SQLCODE -188 SQLSTATE 22503, 28000, 2E000Explanation: &1 is not a valid string representation of an authorization name or a relational database name.SQL0189 SQLCODE -189 SQLSTATE 22522Explanation: Coded Character Set Identifier &1 is not valid.SQL0190 SQLCODE -190 SQLSTATE 42837Explanation: Attributes of column &3 in &1 in &2 not compatible.SQL0191 SQLCODE -191 SQLSTATE 22504Explanation: MIXED data not properly formed.SQL0192 SQLCODE -192 SQLSTATE 42937Explanation: Argument of TRANSLATE function not valid.SQL0194 SQLCODE -194 SQLSTATE 42848Explanation: KEEP LOCKS not allowed.SQL0195 SQLCODE -195 SQLSTATE 42814Explanation: Last column of &1 in &2 cannot be dropped.SQL0196 SQLCODE -196 SQLSTATE 42817Explanation: Column &3 in &1 in &2 cannot be dropped with RESTRICT. SQL0197 SQLCODE -197 SQLSTATE 42877Explanation: Column &1 cannot be qualified.SQL0198 SQLCODE -198 SQLSTATE 42617Explanation: SQL statement empty or blank.SQL0199 SQLCODE -199 SQLSTATE 42601Explanation: Keyword &1 not expected. Valid tokens: &2.SQL0203 SQLCODE -203 SQLSTATE 42702Explanation: Column &1 is ambiguous.SQL0204 SQLCODE -204 SQLSTATE 42704Explanation: &1 in &2 type *&3 not found.SQL0205 SQLCODE -205 SQLSTATE 42703Explanation: Column &1 not in table &2.SQL0206 SQLCODE -206 SQLSTATE 42703Explanation: Column &1 not in specified tables.SQL0208 SQLCODE -208 SQLSTATE 42707Explanation: ORDER BY column &1 not in results table.SQL0212 SQLCODE -212 SQLSTATE 42712Explanation: Duplicate table designator &1 not valid.SQL0214 SQLCODE -214 SQLSTATE 42822Explanation: ORDER BY expression is not valid.SQL0221 SQLCODE -221 SQLSTATE 42873Explanation: Number of rows &2 not valid.SQL0225 SQLCODE -225 SQLSTATE 42872Explanation: FETCH not valid; cursor &1 not declared with SCROLL. SQL0226 SQLCODE -226 SQLSTATE 24507Explanation: Current row deleted or moved for cursor &1.SQL0227 SQLCODE -227 SQLSTATE 24513Explanation: FETCH not valid, cursor &1 in unknown position.SQL0228 SQLCODE -228 SQLSTATE 42620Explanation: FOR UPDATE OF clause not valid with SCROLL for cursor &1. SQL0231 SQLCODE -231 SQLSTATE 22006Explanation: Position of cursor &1 not valid for FETCH of current row. SQL0250 SQLCODE -250 SQLSTATE 42718Explanation: Local relational database not defined in the directory. SQL0251 SQLCODE -251 SQLSTATE 2E000, 42602 Explanation: Character in relational database name &1 is not valid. SQL0255 SQLCODE -255 SQLSTATE 42999Explanation: DB2 Multisystem query error.SQL0256 SQLCODE -256 SQLSTATE 42998Explanation: Constraint &1 in &2 not allowed on distributed file. SQL0270 SQLCODE -270 SQLSTATE 42997Explanation: Unique index not allowed.SQL0301 SQLCODE -301 SQLSTATE 07006,42895 Explanation: Input host variable &2 or argument &1 not valid. SQL0302 SQLCODE -302 SQLSTATE 22001, 22003, 22023, 22024 Explanation: Conversion error on input host variable &2.SQL0303 SQLCODE -303 SQLSTATE 22001, 42806 Explanation: Host variable &1 not compatible with SELECT item. SQL0304 SQLCODE -304 SQLSTATE 22003, 22023, 22504 Explanation: Conversion error in assignment to host variable &2.SQL0305 SQLCODE -305 SQLSTATE 22002Explanation: Indicator variable required.SQL0306 SQLCODE -306 SQLSTATE 42863Explanation: Undefined host variable in REXX.SQL0311 SQLCODE -311 SQLSTATE 22501Explanation: Length in a varying-length host variable not valid. SQL0312 SQLCODE -312 SQLSTATE 42618Explanation: Host variable &1 not defined or not usable. SQL0313 SQLCODE -313 SQLSTATE 07001, 07004 Explanation: Number of host variables not valid.SQL0328 SQLCODE -328 SQLSTATE 42996Explanation: Column &1 not allowed in partitioning key.SQL0329 SQLCODE -329 SQLSTATE 0E000Explanation: The SET PATH name list is not valid.SQL0330 SQLCODE -330 SQLSTATE 22021Explanation: Character conversion cannot be performed. SQL0331 SQLCODE -331 SQLSTATE 22021Explanation: Character conversion cannot be performed.SQL0332 SQLCODE -332 SQLSTATE 57017Explanation: Character conversion between CCSID &1 and CCSID &2 not valid.SQL0334 SQLCODE -334 SQLSTATE 22524Explanation: Character conversion has resulted in truncation.SQL0338 SQLCODE -338 SQLSTATE 42972Explanation: JOIN expression not valid.SQL0340 SQLCODE -340 SQLSTATE 42726Explanation: Duplicate name &1 for common table expression.SQL0341 SQLCODE -341 SQLSTATE 42835Explanation: Cyclic references between common table expressions.SQL0346 SQLCODE -346 SQLSTATE 42836Explanation: Recursion not allowed for common table expressions.SQL0350 SQLCODE -350 SQLSTATE 42962Explanation: Column &1 is not valid as key field for index or constraint.SQL0351 SQLCODE -351 SQLSTATE 56084Explanation: The AR is not at the same level and DB2/400 cannot transform the data type to a compatible type.SQL0352 SQLCODE -352 SQLSTATE 56084Explanation: The AS is not at the same level and DB2/400 cannot transform the data type to a compatible type.SQL0357 SQLCODE -357 SQLSTATE 57050Explanation: File server &1 used in DataLink not currently available.SQL0358 SQLCODE -358 SQLSTATE 428D1Explanation: Error &1 occurred using DataLink data type.SQL0392 SQLCODE -392 SQLSTATE 42855Explanation: Assignment of LOB to specified host variable not allowed.SQL0398 SQLCODE -398 SQLSTATE 428D2Explanation: AS LOCATOR cannot be specified for a non-LOB parameter.SQL0401 SQLCODE -401 SQLSTATE 42818Explanation: Comparison operator &1 operands not compatible.SQL0402 SQLCODE -402 SQLSTATE 42819Explanation: &1 use not valid.SQL0404 SQLCODE -404 SQLSTATE 22001Explanation: Value for column &1 too long.SQL0405 SQLCODE -405 SQLSTATE 42820Explanation: Numeric constant &1 out of range.SQL0406 SQLCODE -406 SQLSTATE 22003, 22023, 22504 Explanation: Conversion error on assignment to column &2.SQL0407 SQLCODE -407 SQLSTATE 23502Explanation: Null values are not allowed in column &1.SQL0408 SQLCODE -408 SQLSTATE 42821Explanation: INSERT or UPDATE value for column &1 not compatible. SQL0410 SQLCODE -410 SQLSTATE 42820Explanation: Floating point literal &1 not valid.SQL0412 SQLCODE -412 SQLSTATE 42823Explanation: Subquery with more than one result column not valid. SQL0414 SQLCODE -414 SQLSTATE 42824Explanation: Column &1 not valid in LIKE predicate.SQL0415 SQLCODE -415 SQLSTATE 42825Explanation: UNION operands not compatible.SQL0417 SQLCODE -417 SQLSTATE 42609Explanation: Combination of parameter markers not valid.SQL0418 SQLCODE -418 SQLSTATE 42610Explanation: Use of parameter marker is not valid.SQL0419 SQLCODE -419 SQLSTATE 42911Explanation: Negative scale not valid.SQL0420 SQLCODE -420 SQLSTATE 22018Explanation: Character in CAST argument not valid.SQL0421 SQLCODE -421 SQLSTATE 42826Explanation: Number of UNION operands not equal.SQL0423 SQLCODE -423 SQLSTATE 0F001Explanation: LOB locator &1 not valid.SQL0428 SQLCODE -428 SQLSTATE 25501Explanation: SQL statement cannot be run.SQL0429 SQLCODE -429 SQLSTATE 54028Explanation: The maximum number of concurrent LOB locators has been reached. SQL0432 SQLCODE -432 SQLSTATE 42841Explanation: A parameter marker cannot have the user-defined type name &1. SQL0433 SQLCODE -433 SQLSTATE 22001Explanation: Significant digits truncated during CAST from numeric to character. SQL0440 SQLCODE -440 SQLSTATE 42884Explanation: Number of arguments on CALL must match procedure. SQL0441 SQLCODE -441 SQLSTATE 42601Explanation: Clause or keyword &1 not valid where specified.SQL0442 SQLCODE -442 SQLSTATE 54023Explanation: Maximum # of parameters on CALL exceeded.SQL0443 SQLCODE -443 SQLSTATE 2Fxxx, 38501Explanation: Trigger program or external procedure detected on error. SQL0444 SQLCODE -444 SQLSTATE 42724Explanation: External program &4 in &1 not found.SQL0446 SQLCODE -446 SQLSTATE 22003Explanation: Conversion error in assignment of argument &2.SQL0448 SQLCODE -448 SQLSTATE 54023Explanation: Maximum parameters on DECLARE PROCEDURE exceeded. SQL0449 SQLCODE -449 SQLSTATE 42878Explanation: External program name for procedure &1 in &2 not valid. SQL0451 SQLCODE -451 SQLSTATE 42815Explanation: Attributes of parameter &1 not valid for procedure.SQL0452 SQLCODE -452 SQLSTATE 428A1Explanation: Unable to access a file that is referred to by a file reference variable. SQL0453 SQLCODE -453 SQLSTATE 42880Explanation: Return type for function &1 in &2 not compatible with CAST TO type. SQL0454 SQLCODE -454 SQLSTATE 42723Explanation: Function &1 in &2 with the same signature already exists.SQL0455 SQLCODE -455 SQLSTATE 42882Explanation: Specific name not same as procedure name.SQL0456 SQLCODE -456 SQLSTATE 42710Explanation: Specific name &3 in &2 already exists.SQL0457 SQLCODE -457 SQLSTATE 42939Explanation: Name &1 in &2 not allowed for function.SQL0458 SQLCODE -458 SQLSTATE 42883Explanation: Function &1 in &2 not found with matching signature.SQL0461 SQLCODE -461 SQLSTATE 42846Explanation: Cast from &1 to &2 not supported.SQL0463 SQLCODE -463 SQLSTATE 39001Explanation: SQLSTATE &4 returned from routine &1 in &2 not valid..SQL0469 SQLCODE -469 SQLSTATE 42886Explanation: IN, OUT, INOUT not valid for parameter &4 in procedure &1 in &2. SQL0470 SQLCODE -470 SQLSTATE 39002Explanation: NULL values not allowed for parameter &4 in procedure.SQL0473 SQLCODE -473 SQLSTATE 42918Explanation: User-defined type &1 cannot be created.SQL0475 SQLCODE -475 SQLSTATE 42866Explanation: RETURNS data type for function &3 in &4 not valid.SQL0476 SQLCODE -476 SQLSTATE 42725Explanation: Function &1 in &2 not unique.SQL0478 SQLCODE -478 SQLSTATE 42893Explanation: Object &1 in &2 of type &3 cannot be dropped.SQL0483 SQLCODE -483 SQLSTATE 42885Explanation: Parameters for function &1 in &2 not same as sourced function. SQL0484 SQLCODE -484 SQLSTATE 42733Explanation: Routine &1 in &2 already exists.SQL0487 SQLCODE -487 SQLSTATE 38001Explanation: SQL statements not allowed.SQL0490 SQLCODE -490 SQLSTATE 428B7Explanation: Numeric value &1 not valid.SQL0491 SQLCODE -491 SQLSTATE 42601Explanation: RETURNS clause required on CREATE FUNCTION statement. SQL0492 SQLCODE -492 SQLSTATE 42879Explanation: Data type for function &1 in &2 not valid for source type. SQL0501 SQLCODE -501 SQLSTATE 24501Explanation: Cursor &1 not open.SQL0502 SQLCODE -502 SQLSTATE 24502Explanation: Cursor &1 already open.SQL0503 SQLCODE -503 SQLSTATE 42912Explanation: Column &3 cannot be updated.SQL0504 SQLCODE -504 SQLSTATE 34000Explanation: Cursor &1 not declared.SQL0507 SQLCODE -507 SQLSTATE 24501Explanation: Cursor &1 not open.SQL0508 SQLCODE -508 SQLSTATE 24504Explanation: Cursor &1 not positioned on locked row.SQL0509 SQLCODE -509 SQLSTATE 42827 Explanation: Table &2 in &3 not same as table in cursor &1. SQL0510 SQLCODE -510 SQLSTATE 42828 Explanation: Cursor &1 for file &2 is read-only.SQL0511 SQLCODE -511 SQLSTATE 42829 Explanation: FOR UPDATE OF clause not valid.SQL0513 SQLCODE -513 SQLSTATE 42924 Explanation: Alias &1 in &2 cannot reference another alias. SQL0514 SQLCODE -514 SQLSTATE 26501 Explanation: Prepared statement &2 not found.SQL0516 SQLCODE -516 SQLSTATE 26501 Explanation: Prepared statement &2 not found.SQL0517 SQLCODE -517 SQLSTATE 07005 Explanation: Prepared statement &2 not SELECT statement. SQL0518 SQLCODE -518 SQLSTATE 07003 Explanation: Prepared statement &1 not found.SQL0519 SQLCODE -519 SQLSTATE 24506Explanation: Prepared statement &2 in use.SQL0520 SQLCODE -520 SQLSTATE 42828Explanation: Cannot UPDATE or DELETE on cursor &1.SQL0525 SQLCODE -525 SQLSTATE 51015Explanation: Statement not valid on application server.SQL0527 SQLCODE -527 SQLSTATE 42874Explanation: ALWCPYDTA(*NO) specified but temporary result required for &1.SQL0530 SQLCODE -530 SQLSTATE 23503Explanation: Insert or UPDATE value not allowed by referential constraint.SQL0531 SQLCODE -531 SQLSTATE 23001, 23504Explanation: Update prevented by referential constraint.SQL0532 SQLCODE -532 SQLSTATE 23001, 23504Explanation: Delete prevented by referential constraint.SQL0536 SQLCODE -536 SQLSTATE 42914Explanation: Delete not allowed because table referenced in subquery can be affected. SQL0537 SQLCODE -537 SQLSTATE 42709Explanation: Duplicate column name in definition of key.SQL0538 SQLCODE -538 SQLSTATE 42830Explanation: Foreign key attributes do not match parent key.SQL0539 SQLCODE -539 SQLSTATE 42888Explanation: Table does not have primary key.SQL0541 SQLCODE -541 SQLSTATE 42891Explanation: Duplicate UNIQUE constraint already exists.SQL0543 SQLCODE -543 SQLSTATE 23511Explanation: Constraint &1 conflicts with SET NULL or SET DEFAULT rule. SQL0544 SQLCODE -544 SQLSTATE 23512Explanation: CHECK constraint &1 cannot be added.SQL0545 SQLCODE -545 SQLSTATE 23513Explanation: INSERT or UPDATE not allowed by CHECK constraint.SQL0546 SQLCODE -546 SQLSTATE 42621Explanation: CHECK condition of constraint &1 not valid.SQL0551 SQLCODE -551 SQLSTATE 42501Explanation: Not authorized to object &1 in &2 type *&3.SQL0552 SQLCODE -552 SQLSTATE 42502Explanation: Not authorized to &1.SQL0557 SQLCODE -557 SQLSTATE 42852Explanation: Privilege not valid for table or view &1 in &2.SQL0573 SQLCODE -573 SQLSTATE 42890Explanation: Table does not have matching parent key.SQL0574 SQLCODE -574 SQLSTATE 42894Explanation: Default value not valid.SQL0577 SQLCODE -577 SQLSTATE 38002, 2F002Explanation: Modifying SQL data not permitted.SQL0578 SQLCODE -578 SQLSTATE 2F005Explanation: RETURN statement not executed for SQL function &1 in &2. SQL0579 SQLCODE -579 SQLSTATE 38004, 2F004Explanation: Reading SQL data not permitted.SQL0580 SQLCODE -580 SQLSTATE 42625Explanation: At least one result in CASE expression must be not NULL. SQL0581 SQLCODE -581 SQLSTATE 42804Explanation: The results in a CASE expression are not compatible.SQL0583 SQLCODE -583 SQLSTATE 42845Explanation: Use of function &1 in &2 not valid.SQL0585 SQLCODE -585 SQLSTATE 42732Explanation: Library &1 is used incorrectly on the SET PATH statement SQL0590 SQLCODE -590 SQLSTATE 42734Explanation: Name &1 specified in &2 not unique.SQL0601 SQLCODE -601 SQLSTATE 42710Explanation: Object &1 in &2 type *&3 already exists.SQL0602 SQLCODE -602 SQLSTATE 54008Explanation: More than 120 columns specified for CREATE INDEX. SQL0603 SQLCODE -603 SQLSTATE 23515Explanation: Unique index cannot be created because of duplicate keys. SQL0604 SQLCODE -604 SQLSTATE 42611Explanation: Attributes of column not valid.SQL0607 SQLCODE -607 SQLSTATE 42832Explanation: Operation not allowed on system table &1 in &2.SQL0612 SQLCODE -612 SQLSTATE 42711Explanation: &1 is a duplicate column name.SQL0613 SQLCODE -613 SQLSTATE 54008Explanation: Primary or unique key constraint too long.SQL0614 SQLCODE -614 SQLSTATE 54008Explanation: Length of columns for CREATE INDEX too long. SQL0615 SQLCODE -615 SQLSTATE 55006Explanation: Object &1 in &2 type *&3 not dropped. It is in use. SQL0616 SQLCODE -616 SQLSTATE 42893Explanation: &1 in &2 type &3 cannot be dropped with RESTRICT. SQL0624 SQLCODE -624 SQLSTATE 42889Explanation: Table already has primary key.SQL0628 SQLCODE -628 SQLSTATE 42613Explanation: Clauses are mutually exclusive.SQL0629 SQLCODE -629 SQLSTATE 42834Explanation: SET NULL not allowed for referential constraint. SQL0631 SQLCODE -631 SQLSTATE 54008Explanation: Foreign key for referential constraint too long.SQL0637 SQLCODE -637 SQLSTATE 42614Explanation: Duplicate &1 keyword.SQL0642 SQLCODE -642 SQLSTATE 54021Explanation: Maximum number of constraints exceeded.SQL0658 SQLCODE -658 SQLSTATE 42917Explanation: Function cannot be dropped.SQL0666 SQLCODE -666 SQLSTATE 57005Explanation: Estimated query processing time exceeds limit.SQL0667 SQLCODE -667 SQLSTATE 23520Explanation: Foreign key does not match a value in the parent key.SQL0675 SQLCODE -675 SQLSTATE 42892Explanation: Specified delete rule not allowed with existing trigger.SQL0679 SQLCODE -679 SQLSTATE 57006Explanation: Object &1 in &2 type *&3 not created due to pending operation. SQL0683 SQLCODE -683 SQLSTATE 42842Explanation: FOR DATA or CCSID clause not valid for specified type.SQL0707 SQLCODE -707 SQLSTATE 42939Explanation: Name &1 in &2 not allowed for distinct type.SQL0713 SQLCODE -713 SQLSTATE 42815Explanation: Host variable for &2 is NULL.SQL0724 SQLCODE -724 SQLSTATE 54038Explanation: Too many cascaded trigger programs.SQL0751 SQLCODE -751 SQLSTATE 42987Explanation: SQL statement &1 not allowed in stored procedure or trigger. SQL0752 SQLCODE -752 SQLSTATE 0A001Explanation: Connection cannot be changed. Reason code is &1.SQL0773 SQLCODE -773 SQLSTATE 20000Explanation: Case not found for CASE statement.SQL0774 SQLCODE -774 SQLSTATE 2D522Explanation: Statement cannot be executed within a compound SQL statement. SQL0775 SQLCODE -775 SQLSTATE 42910Explanation: Statement not allowed in a compound SQL statement.SQL0776 SQLCODE -776 SQLSTATE 428D4Explanation: Cursor &1 specified in FOR statement not allowed.SQL0777 SQLCODE -777 SQLSTATE 42919Explanation: Nested compound statements not allowed.SQL0778 SQLCODE -778 SQLSTATE 428D5Explanation: End label &1 not same as begin label.SQL0779 SQLCODE -779 SQLSTATE 42736Explanation: Label &1 specified on LEAVE statement not valid.SQL0780 SQLCODE -780 SQLSTATE 428D6Explanation: UNDO specified for a handler and ATOMIC not specified. SQL0781 SQLCODE -781 SQLSTATE 42737Explanation: Condition &1 specified in handler not defined.SQL0782 SQLCODE -782 SQLSTATE 428D7Explanation: Condition value &1 specified in handler not valid.SQL0783 SQLCODE -783 SQLSTATE 42738Explanation: Select list for cursor &1 in FOR statement not valid. SQL0784 SQLCODE -784 SQLSTATE 42860Explanation: Check constraint &1 cannot be dropped.SQL0785 SQLCODE -785 SQLSTATE 428D8Explanation: Use of SQLCODE or SQLSTATE not valid.SQL0802 SQLCODE -802 SQLSTATE 22003, 22012, 22023, 22504 Explanation: Data conversion or data mapping error.SQL0803 SQLCODE -803 SQLSTATE 23505Explanation: Duplicate key value specified.SQL0804 SQLCODE -804 SQLSTATE 07002Explanation: SQLDA not valid.SQL0805 SQLCODE -805 SQLSTATE 51002Explanation: SQL package &1 in &2 not found.SQL0811 SQLCODE -811 SQLSTATE 21000Explanation: Result of SELECT INTO or subquery more than one row. SQL0818 SQLCODE -818 SQLSTATE 51003Explanation: Consistency tokens do not match.SQL0822 SQLCODE -822 SQLSTATE 51004Explanation: Address in SQLDA not valid.SQL0827 SQLCODE -827 SQLSTATE 42862Explanation: &1 in &2 type *SQLPKG cannot be accessed.SQL0840 SQLCODE -840 SQLSTATE 54004Explanation: Number of selected items exceeds 8000.SQL0842 SQLCODE -842 SQLSTATE 08002Explanation: Connection already exists.SQL0843 SQLCODE -843 SQLSTATE 08003Explanation: Connection does not exist.SQL0858 SQLCODE -858 SQLSTATE 08501Explanation: Cannot disconnect relational database due to LU 6.2 protected conversation. SQL0862 SQLCODE -862 SQLSTATE 55029Explanation: Local program attempted to connect to a remote relational database.SQL0871 SQLCODE -871 SQLSTATE 54019Explanation: Too many CCSID values specified.SQL0900 SQLCODE -900 SQLSTATE 08003Explanation: Application process not in a connected state.SQL0901 SQLCODE -901 SQLSTATE 58004Explanation: SQL system error.SQL0904 SQLCODE -904 SQLSTATE 57011Explanation: Resource limit exceeded.SQL0906 SQLCODE -906 SQLSTATE 24514Explanation: Operation not performed because of previous error.SQL0907 SQLCODE -907 SQLSTATE 27000Explanation: Attempt to change same row twice.SQL0910 SQLCODE -910 SQLSTATE 57007Explanation: Object &1 in &2 type *&3 has a pending change.SQL0913 SQLCODE -913 SQLSTATE 57033Explanation: Row or object &1 in &2 type *&3 in use.SQL0917 SQLCODE -917 SQLSTATE 42969Explanation: Package not created.SQL0918 SQLCODE -918 SQLSTATE 51021Explanation: Rollback required.SQL0950 SQLCODE -950 SQLSTATE 42705Explanation: Relational database &1 not in relational database directory.SQL0951 SQLCODE -951 SQLSTATE 55007Explanation: Object &1 in &2 not altered. It is in use.SQL0952 SQLCODE -952 SQLSTATE 57014Explanation: Processing of the SQL statement ended by ENDRDBRQS command. SQL0969 SQLCODE -969 SQLSTATE 58033Explanation: Unexpected client driver error.SQL0971 SQLCODE -971 SQLSTATE 57011Explanation: Referential constraint &4 in check pending state.SQL5001 SQLCODE -5001 SQLSTATE 42703。

sql code=1024的解决方法

sql code=1024的解决方法

sql code=1024的解决方法如何解决SQLCODE=-1024的数据库连接异常什么是SQLCODE=-1024的数据库连接异常SQLCODE=-1024的数据库连接异常是一种常见的数据库错误,表示没有数据库连接,无法执行其他的SQL语句。

这个错误通常发生在使用DB2、MySQL等数据库时,尝试执行查询、更新、删除等操作时,没有先建立数据库连接,或者数据库连接已经断开或失效。

这个错误的完整信息如下:SQL1024N A database connection does not exist. Explanation: There is no connection to a database. Other SQL statements cannot be processed unless an SQL CONNECT was previously executed. The command cannot be processed. User response: If the error occurred when disconnecting from the database, continue processing. If the error occurred on another SQL statement, issue an SQL CONNECT statement and resubmit the command or statement. sqlcode: -1024 sqlstate: 08003为什么会出现SQLCODE=-1024的数据库连接异常SQLCODE=-1024的数据库连接异常的原因可能有很多,根据不同的数据库类型和场景,可以分为以下几类:- 数据库服务未启动或停止,导致无法连接到数据库,如MySQL服务未启动,或者DB2服务被终止等。

- 数据库连接参数错误或失效,导致无法建立或维持数据库连接,如数据库的地址、端口、用户名、密码、数据库名等参数不正确,或者数据库连接超时、被关闭、被占用等。

sqlcode=-20054

sqlcode=-20054

sqlcode=-20054SQLCODE=-20054并不是一个常见的错误代码,通常只有在执行一些比较复杂的SQL语句时才会出现。

该错误代码通常表示发生了不可恢复的错误,导致数据库无法继续执行该SQL语句或该事务。

在处理这种错误时,我们需要了解该错误代码的原因以及解决方法。

以下是一些可能导致SQLCODE=-20054错误的原因:1. 数据库锁死:如果在执行SQL语句的同时,其他用户或应用程序在访问同一个表或记录,可能导致数据库锁死。

当这种情况发生时,该SQL语句无法继续执行,从而导致SQLCODE=-20054错误。

2. 资源耗尽:另一个可能导致SQLCODE=-20054错误的原因是资源耗尽。

数据库引擎需要大量内存和CPU来执行复杂的SQL查询,如果资源不足,就会导致该错误代码。

3. 数据库损坏:当数据库文件损坏或出现其他错误时,也可能导致SQLCODE=-20054错误。

该错误通常伴随着其他数据库错误,如SQLCODE=-913和SQLCODE=-818。

解决SQLCODE=-20054错误的方法包括:1. 检查数据库锁定情况:如果数据库被锁定,我们需要找出哪个进程或事务正在占用该资源,并将其杀死,以释放数据库资源。

我们还可以尝试增加并发性设置或减少每个事务持有的锁数量来避免这种问题。

2. 增加系统资源:如前所述,SQLCODE=-20054错误可能是因为系统资源不足造成的。

我们可以增加系统的内存,CPU以及其他资源,以确保数据库引擎具有足够的资源来执行SQL查询。

3. 恢复数据库:当数据库文件损坏或出现其他错误时,我们需要使用数据库恢复工具来修复数据库文件。

这通常需要管理员执行。

恢复后,我们应该能够重新运行SQL语句,从而避免SQLCODE=-20054错误。

总的来说,SQLCODE=-20054错误可能是一个非常头痛的问题。

但是,一旦我们了解了它的原因并采取适当的措施来解决它,我们就能够避免它的发生。

sqlcode常见类型

sqlcode常见类型

sqlcode常见类型
SQL代码可以分为多种类型,主要包括数据查询、数据操作、数据定义和数据控制等几种类型。

数据查询是SQL代码中最常见的类型之一,用于从数据库中检索所需的数据。

常见的数据查询包括SELECT语句,用于从表中选择特定的列或计算新的数据。

数据查询还可以包括聚合函数,用于对数据进行汇总统计,以及连接操作,用于将多个表中的数据关联起来。

数据操作类型的SQL代码用于对数据库中的数据进行增加、删除和修改。

INSERT语句用于向数据库表中插入新的数据,UPDATE语句用于更新现有数据,DELETE语句用于删除表中的数据。

这些操作可以对数据库中的数据进行有效管理和维护。

数据定义类型的SQL代码用于定义数据库对象,如表、视图、索引等。

CREATE TABLE语句用于创建新的表,CREATE VIEW语句用于创建视图,CREATE INDEX语句用于创建索引。

这些代码用于设计和构建数据库结构,以及定义数据的组织方式和访问方式。

数据控制类型的SQL代码用于控制数据库用户的访问权限和安全性。

GRANT和REVOKE语句用于授予和撤销用户对数据库对象的访问权限,以及管理用户的安全性设置。

这些代码可以帮助数据库管理员有效地管理数据库用户和保护数据库的安全性。

总的来说,SQL代码的常见类型包括数据查询、数据操作、数据定义和数据控制,每种类型都有其特定的作用和用法。

在实际应用中,根据具体的需求和场景,可以灵活运用这些类型的SQL代码来对数据库进行操作和管理。

DB2的常见SQLCODE所表示负数的含义

DB2的常见SQLCODE所表示负数的含义

DB2的常见SQLCODE所表示负数的含义SQL0007 SQLCODE -07SQLSTATE 42601Explanation: Character &1 (HEX &2) not valid in SQL statement. SQL0010 SQLCODE -10SQLSTATE 42603Explanation: String constant beginning &1 not delimited.SQL0029 SQLCODE -29SQLSTATE 42601Explanation: INTO clause missing from embedded SELECT statement. SQL0051 SQLCODE -51SQLSTATE 3C000Explanation: Cursor or procedure &1 previously declared.SQL0060 SQLCODE -60SQLSTATE 42815Explanation: Value &3 for argument &1 of &2 function not valid. SQL0078 SQLCODE -78SQLSTATE 42629Explanation: Parameter name required for routine &1 in &2.SQL0080 SQLCODE -80SQLSTATE 42978Explanation: Indicator variable &1 not SMALLINT type.SQL0084 SQLCODE -84SQLSTATE 42612Explanation: SQL statement not allowed.SQL0090 SQLCODE -90SQLSTATE 42618Explanation: Host variable not permitted here.SQL0097 SQLCODE -97SQLSTATE 42601Explanation: Use of data type not valid.SQL0099 SQLCODE -99SQLSTATE 42992Explanation: Operator in join condition not valid.SQL0101 SQLCODE -101SQLSTATE 54001, 54010, 54011 Explanation: SQL statement too long or complex.SQL0102 SQLCODE -102SQLSTATE 54002Explanation: String constant beginning with &1 too long. SQL0103 SQLCODE -103SQLSTATE 42604Explanation: Numeric constant &1 not valid.SQL0104 SQLCODE -104SQLSTATE 42601Explanation: Token &1 was not valid. Valid tokens: &2.SQL0105 SQLCODE -105SQLSTATE 42604Explanation: Mixed or graphic string constant not valid. SQL0106 SQLCODE -106SQLSTATE 42611Explanation: Precision specified for FLOAT column not valid.SQL0107 SQLCODE -107SQLSTATE 42622Explanation: &1 too long. Maximum &2 characters.SQL0109 SQLCODE -109SQLSTATE 42601Explanation: &1 clause not allowed.SQL0110 SQLCODE -110SQLSTATE 42606Explanation: Hexadecimal constant beginning with &1 not valid.SQL0112 SQLCODE -112SQLSTATE 42607Explanation: Argument of function &1 is another function.SQL0113 SQLCODE -113SQLSTATE 28000, 2E000, 42602 Explanation: Name &1 not allowed.SQL0114 SQLCODE -114SQLSTATE 42961Explanation: Relational database &1 not the same as current server &2. SQL0115 SQLCODE -115SQLSTATE 42601Explanation: Comparison operator &1 not valid.SQL0117 SQLCODE -117SQLSTATE 42802Explanation: Statement inserts wrong number of values.SQL0118 SQLCODE -118SQLSTATE 42902Explanation: Table &1 in &2 also specified in a FROM clause.SQL0119 SQLCODE -119SQLSTATE 42803Explanation: Column &1 in HAVING clause not in GROUP BY. SQL0120 SQLCODE -120SQLSTATE 42903Explanation: Use of column function &2 not valid.SQL0121 SQLCODE -121SQLSTATE 42701Explanation: Duplicate column name &1 in INSERT or UPDATE. SQL0122 SQLCODE -122SQLSTATE 42803Explanation: Column specified in SELECT list not valid.SQL0125 SQLCODE -125SQLSTATE 42805Explanation: ORDER BY column number &1 not valid.SQL0128 SQLCODE -128SQLSTATE 42601Explanation: Use of NULL is not valid.SQL0129 SQLCODE -129SQLSTATE 54004Explanation: Too many tables in SQL statement.SQL0130 SQLCODE -130SQLSTATE 22019, 22025 Explanation: Escape character &1 or LIKE pattern not valid. SQL0131 SQLCODE -131SQLSTATE 42818Explanation: Operands of LIKE not compatible or not valid.SQL0132 SQLCODE -132SQLSTATE 42824Explanation: LIKE predicate not valid.SQL0133 SQLCODE -133SQLSTATE 42906Explanation: Operator on correlated column in SQL function not valid.SQL0134 SQLCODE -134SQLSTATE 42907Explanation: Argument of function too long.SQL0136 SQLCODE -136SQLSTATE 54005Explanation: ORDER BY or GROUP BY columns too long.SQL0137 SQLCODE -137SQLSTATE 54006Explanation: Result too long.SQL0138 SQLCODE -138SQLSTATE 22011Explanation: Argument &1 of SUBSTR function not valid.SQL0144 SQLCODE -144SQLSTATE 58003Explanation: Section number not valid.SQL0145 SQLCODE -145SQLSTATE 55005Explanation: Recursion not supported for an application server other than the AS/400 system.SQL0150 SQLCODE -150SQLSTATE 42807Explanation: View or logical file &1 in &2 read-only.SQL0151 SQLCODE -151SQLSTATE 42808Explanation: Column &1 in table &2 in &3 read-only.SQL0152 SQLCODE -152SQLSTATE 42809Explanation: Constraint type not valid for constraint &1 in &2.SQL0153 SQLCODE -153SQLSTATE 42908Explanation: Column list required for CREATE VIEW.SQL0154 SQLCODE -154SQLSTATE 42909Explanation: UNION and UNION ALL for CREATE VIEW not valid. SQL0156 SQLCODE -156SQLSTATE 42809Explanation: &1 in &2 not a table.SQL0157 SQLCODE -157SQLSTATE 42810Explanation: View &1 in &2 not valid in FOREIGN KEY clause.SQL0158 SQLCODE -158SQLSTATE 42811Explanation: Number of columns specified not consistent.SQL0159 SQLCODE -159SQLSTATE 42809Explanation: &1 in &2 not correct type.SQL0160 SQLCODE -160SQLSTATE 42813Explanation: WITH CHECK OPTION not allowed for view &1 in &2.SQL0161 SQLCODE -161SQLSTATE 44000Explanation: INSERT/UPDATE not allowed due to WITH CHECK OPTION. SQL0170 SQLCODE -170SQLSTATE 42605Explanation: Number of arguments for function &1 not valid.SQL0171 SQLCODE -171SQLSTATE 42815Explanation: Argument &1 of function &2 not valid.SQL0175 SQLCODE -175SQLSTATE 58028Explanation: COMMIT failed.SQL0180 SQLCODE -180SQLSTATE 22007Explanation: Syntax of date, time, or timestamp value not valid.SQL0181 SQLCODE -181SQLSTATE 22007Explanation: Value in date, time, or timestamp string not valid.SQL0182 SQLCODE -182SQLSTATE 42816Explanation: A date, time, or timestamp expression not valid.SQL0183 SQLCODE -183SQLSTATE 22008Explanation: The result of a date or timestamp expression not valid.SQL0184 SQLCODE -184SQLSTATE 42610Explanation: Parameter marker not valid in expression.SQL0187 SQLCODE -187SQLSTATE 42816Explanation: Use of labeled duration is not valid.SQL0188 SQLCODE -188SQLSTATE 22503, 28000, 2E000Explanation: &1 is not a valid string representation of an authorization name or a relational database name.SQL0189 SQLCODE -189SQLSTATE 22522Explanation: Coded Character Set Identifier &1 is not valid.SQL0190 SQLCODE -190SQLSTATE 42837Explanation: Attributes of column &3 in &1 in &2 not compatible.SQL0191 SQLCODE -191SQLSTATE 22504Explanation: MIXED data not properly formed.SQL0192 SQLCODE -192SQLSTATE 42937Explanation: Argument of TRANSLATE function not valid.SQL0194 SQLCODE -194SQLSTATE 42848Explanation: KEEP LOCKS not allowed.SQL0195 SQLCODE -195SQLSTATE 42814Explanation: Last column of &1 in &2 cannot be dropped.SQL0196 SQLCODE -196SQLSTATE 42817Explanation: Column &3 in &1 in &2 cannot be dropped with RESTRICT. SQL0197 SQLCODE -197SQLSTATE 42877Explanation: Column &1 cannot be qualified.SQL0198 SQLCODE -198SQLSTATE 42617Explanation: SQL statement empty or blank.SQL0199 SQLCODE -199SQLSTATE 42601Explanation: Keyword &1 not expected. Valid tokens: &2.SQL0203 SQLCODE -203SQLSTATE 42702Explanation: Column &1 is ambiguous.SQL0204 SQLCODE -204SQLSTATE 42704Explanation: &1 in &2 type *&3 not found.SQL0205 SQLCODE -205SQLSTATE 42703Explanation: Column &1 not in table &2.SQL0206 SQLCODE -206SQLSTATE 42703Explanation: Column &1 not in specified tables.SQL0208 SQLCODE -208SQLSTATE 42707Explanation: ORDER BY column &1 not in results table.SQL0212 SQLCODE -212SQLSTATE 42712Explanation: Duplicate table designator &1 not valid.SQL0214 SQLCODE -214SQLSTATE 42822Explanation: ORDER BY expression is not valid.SQL0221 SQLCODE -221SQLSTATE 42873Explanation: Number of rows &2 not valid.SQL0225 SQLCODE -225SQLSTATE 42872Explanation: FETCH not valid; cursor &1 not declared with SCROLL.SQL0226 SQLCODE -226SQLSTATE 24507Explanation: Current row deleted or moved for cursor &1.SQL0227 SQLCODE -227SQLSTATE 24513Explanation: FETCH not valid, cursor &1 in unknown position.SQL0228 SQLCODE -228SQLSTATE 42620Explanation: FOR UPDATE OF clause not valid with SCROLL for cursor &1. SQL0231 SQLCODE -231SQLSTATE 22006Explanation: Position of cursor &1 not valid for FETCH of current row.SQL0250 SQLCODE -250SQLSTATE 42718Explanation: Local relational database not defined in the directory. SQL0251 SQLCODE -251SQLSTATE 2E000, 42602Explanation: Character in relational database name &1 is not valid. SQL0255 SQLCODE -255SQLSTATE 42999Explanation: DB2 Multisystem query error.SQL0256 SQLCODE -256SQLSTATE 42998Explanation: Constraint &1 in &2 not allowed on distributed file. SQL0270 SQLCODE -270SQLSTATE 42997Explanation: Unique index not allowed.SQL0301 SQLCODE -301SQLSTATE 07006,42895Explanation: Input host variable &2 or argument &1 not valid.SQL0302 SQLCODE -302SQLSTATE 22001, 22003, 22023, 22024 Explanation: Conversion error on input host variable &2.SQL0303 SQLCODE -303SQLSTATE 22001, 42806 Explanation: Host variable &1 not compatible with SELECT item. SQL0304 SQLCODE -304SQLSTATE 22003, 22023, 22504 Explanation: Conversion error in assignment to host variable &2.SQL0305 SQLCODE -305SQLSTATE 22002Explanation: Indicator variable required.SQL0306 SQLCODE -306SQLSTATE 42863Explanation: Undefined host variable in REXX.SQL0311 SQLCODE -311SQLSTATE 22501Explanation: Length in a varying-length host variable not valid. SQL0312 SQLCODE -312SQLSTATE 42618Explanation: Host variable &1 not defined or not usable.SQL0313 SQLCODE -313SQLSTATE 07001, 07004 Explanation: Number of host variables not valid.SQL0328 SQLCODE -328SQLSTATE 42996Explanation: Column &1 not allowed in partitioning key.SQL0329 SQLCODE -329SQLSTATE 0E000Explanation: The SET PATH name list is not valid.SQL0330 SQLCODE -330SQLSTATE 22021Explanation: Character conversion cannot be performed.SQL0331 SQLCODE -331SQLSTATE 22021Explanation: Character conversion cannot be performed.SQL0332 SQLCODE -332SQLSTATE 57017Explanation: Character conversion between CCSID &1 and CCSID &2 not valid.SQL0334 SQLCODE -334SQLSTATE 22524Explanation: Character conversion has resulted in truncation.SQL0338 SQLCODE -338SQLSTATE 42972Explanation: JOIN expression not valid.SQL0340 SQLCODE -340SQLSTATE 42726Explanation: Duplicate name &1 for common table expression.SQL0341 SQLCODE -341SQLSTATE 42835Explanation: Cyclic references between common table expressions.SQL0346 SQLCODE -346SQLSTATE 42836Explanation: Recursion not allowed for common table expressions.SQL0350 SQLCODE -350SQLSTATE 42962Explanation: Column &1 is not valid as key field for index or constraint.SQL0351 SQLCODE -351SQLSTATE 56084Explanation: The AR is not at the same level and DB2/400 cannot transform the data type to a compatible type.SQL0352 SQLCODE -352SQLSTATE 56084Explanation: The AS is not at the same level and DB2/400 cannot transform the data type to a compatible type.SQL0357 SQLCODE -357SQLSTATE 57050Explanation: File server &1 used in DataLink not currently available.SQL0358 SQLCODE -358SQLSTATE 428D1Explanation: Error &1 occurred using DataLink data type.SQL0392 SQLCODE -392SQLSTATE 42855Explanation: Assignment of LOB to specified host variable not allowed.SQL0398 SQLCODE -398SQLSTATE 428D2Explanation: AS LOCATOR cannot be specified for a non-LOB parameter.SQL0401 SQLCODE -401SQLSTATE 42818Explanation: Comparison operator &1 operands not compatible.SQL0402 SQLCODE -402SQLSTATE 42819Explanation: &1 use not valid.SQL0404 SQLCODE -404SQLSTATE 22001Explanation: Value for column &1 too long.SQL0405 SQLCODE -405SQLSTATE 42820Explanation: Numeric constant &1 out of range.SQL0406 SQLCODE -406SQLSTATE 22003, 22023, 22504 Explanation: Conversion error on assignment to column &2.SQL0407 SQLCODE -407SQLSTATE 23502Explanation: Null values are not allowed in column &1.SQL0408 SQLCODE -408SQLSTATE 42821Explanation: INSERT or UPDATE value for column &1 not compatible. SQL0410 SQLCODE -410SQLSTATE 42820Explanation: Floating point literal &1 not valid.SQL0412 SQLCODE -412SQLSTATE 42823Explanation: Subquery with more than one result column not valid. SQL0414 SQLCODE -414SQLSTATE 42824Explanation: Column &1 not valid in LIKE predicate.SQL0415 SQLCODE -415SQLSTATE 42825Explanation: UNION operands not compatible.SQL0417 SQLCODE -417SQLSTATE 42609Explanation: Combination of parameter markers not valid.SQL0418 SQLCODE -418SQLSTATE 42610Explanation: Use of parameter marker is not valid.SQL0419 SQLCODE -419SQLSTATE 42911Explanation: Negative scale not valid.SQL0420 SQLCODE -420SQLSTATE 22018Explanation: Character in CAST argument not valid.SQL0421 SQLCODE -421SQLSTATE 42826Explanation: Number of UNION operands not equal.SQL0423 SQLCODE -423SQLSTATE 0F001Explanation: LOB locator &1 not valid.SQL0428 SQLCODE -428SQLSTATE 25501Explanation: SQL statement cannot be run.SQL0429 SQLCODE -429SQLSTATE 54028Explanation: The maximum number of concurrent LOB locators has been reached. SQL0432 SQLCODE -432SQLSTATE 42841Explanation: A parameter marker cannot have the user-defined type name &1. SQL0433 SQLCODE -433SQLSTATE 22001Explanation: Significant digits truncated during CAST from numeric to character. SQL0440 SQLCODE -440SQLSTATE 42884Explanation: Number of arguments on CALL must match procedure.SQL0441 SQLCODE -441SQLSTATE 42601Explanation: Clause or keyword &1 not valid where specified.SQL0442 SQLCODE -442SQLSTATE 54023Explanation: Maximum # of parameters on CALL exceeded.SQL0443 SQLCODE -443SQLSTATE 2Fxxx, 38501Explanation: Trigger program or external procedure detected on error. SQL0444 SQLCODE -444SQLSTATE 42724Explanation: External program &4 in &1 not found.SQL0446 SQLCODE -446SQLSTATE 22003Explanation: Conversion error in assignment of argument &2.SQL0448 SQLCODE -448SQLSTATE 54023Explanation: Maximum parameters on DECLARE PROCEDURE exceeded. SQL0449 SQLCODE -449SQLSTATE 42878Explanation: External program name for procedure &1 in &2 not valid. SQL0451 SQLCODE -451SQLSTATE 42815Explanation: Attributes of parameter &1 not valid for procedure.SQL0452 SQLCODE -452SQLSTATE 428A1Explanation: Unable to access a file that is referred to by a file reference variable. SQL0453 SQLCODE -453SQLSTATE 42880Explanation: Return type for function &1 in &2 not compatible with CAST TO type. SQL0454 SQLCODE -454SQLSTATE 42723Explanation: Function &1 in &2 with the same signature already exists.SQL0455 SQLCODE -455SQLSTATE 42882Explanation: Specific name not same as procedure name.SQL0456 SQLCODE -456SQLSTATE 42710Explanation: Specific name &3 in &2 already exists.SQL0457 SQLCODE -457SQLSTATE 42939Explanation: Name &1 in &2 not allowed for function.SQL0458 SQLCODE -458SQLSTATE 42883Explanation: Function &1 in &2 not found with matching signature.SQL0461 SQLCODE -461SQLSTATE 42846Explanation: Cast from &1 to &2 not supported.SQL0463 SQLCODE -463SQLSTATE 39001Explanation: SQLSTATE &4 returned from routine &1 in &2 not valid..SQL0469 SQLCODE -469SQLSTATE 42886Explanation: IN, OUT, INOUT not valid for parameter &4 in procedure &1 in &2. SQL0470 SQLCODE -470SQLSTATE 39002Explanation: NULL values not allowed for parameter &4 in procedure.SQL0473 SQLCODE -473SQLSTATE 42918Explanation: User-defined type &1 cannot be created.SQL0475 SQLCODE -475SQLSTATE 42866Explanation: RETURNS data type for function &3 in &4 not valid.SQL0476 SQLCODE -476SQLSTATE 42725Explanation: Function &1 in &2 not unique.SQL0478 SQLCODE -478SQLSTATE 42893Explanation: Object &1 in &2 of type &3 cannot be dropped.SQL0483 SQLCODE -483SQLSTATE 42885Explanation: Parameters for function &1 in &2 not same as sourced function.SQL0484 SQLCODE -484SQLSTATE 42733Explanation: Routine &1 in &2 already exists.SQL0487 SQLCODE -487SQLSTATE 38001Explanation: SQL statements not allowed.SQL0490 SQLCODE -490SQLSTATE 428B7Explanation: Numeric value &1 not valid.SQL0491 SQLCODE -491SQLSTATE 42601Explanation: RETURNS clause required on CREATE FUNCTION statement. SQL0492 SQLCODE -492SQLSTATE 42879Explanation: Data type for function &1 in &2 not valid for source type. SQL0501 SQLCODE -501SQLSTATE 24501Explanation: Cursor &1 not open.SQL0502 SQLCODE -502SQLSTATE 24502Explanation: Cursor &1 already open.SQL0503 SQLCODE -503SQLSTATE 42912Explanation: Column &3 cannot be updated.SQL0504 SQLCODE -504SQLSTATE 34000Explanation: Cursor &1 not declared.SQL0507 SQLCODE -507SQLSTATE 24501Explanation: Cursor &1 not open.SQL0508 SQLCODE -508SQLSTATE 24504Explanation: Cursor &1 not positioned on locked row. SQL0509 SQLCODE -509SQLSTATE 42827 Explanation: Table &2 in &3 not same as table in cursor &1. SQL0510 SQLCODE -510SQLSTATE 42828 Explanation: Cursor &1 for file &2 is read-only.SQL0511 SQLCODE -511SQLSTATE 42829 Explanation: FOR UPDATE OF clause not valid.SQL0513 SQLCODE -513SQLSTATE 42924 Explanation: Alias &1 in &2 cannot reference another alias. SQL0514 SQLCODE -514SQLSTATE 26501 Explanation: Prepared statement &2 not found.SQL0516 SQLCODE -516SQLSTATE 26501 Explanation: Prepared statement &2 not found.SQL0517 SQLCODE -517SQLSTATE 07005 Explanation: Prepared statement &2 not SELECT statement. SQL0518 SQLCODE -518SQLSTATE 07003 Explanation: Prepared statement &1 not found.SQL0519 SQLCODE -519SQLSTATE 24506Explanation: Prepared statement &2 in use.SQL0520 SQLCODE -520SQLSTATE 42828Explanation: Cannot UPDATE or DELETE on cursor &1.SQL0525 SQLCODE -525SQLSTATE 51015Explanation: Statement not valid on application server.SQL0527 SQLCODE -527SQLSTATE 42874Explanation: ALWCPYDTA(*NO) specified but temporary result required for &1.SQL0530 SQLCODE -530SQLSTATE 23503Explanation: Insert or UPDATE value not allowed by referential constraint.SQL0531 SQLCODE -531SQLSTATE 23001, 23504Explanation: Update prevented by referential constraint.SQL0532 SQLCODE -532SQLSTATE 23001, 23504Explanation: Delete prevented by referential constraint.SQL0536 SQLCODE -536SQLSTATE 42914Explanation: Delete not allowed because table referenced in subquery can be affected. SQL0537 SQLCODE -537SQLSTATE 42709Explanation: Duplicate column name in definition of key.SQL0538 SQLCODE -538SQLSTATE 42830Explanation: Foreign key attributes do not match parent key.SQL0539 SQLCODE -539SQLSTATE 42888Explanation: Table does not have primary key.SQL0541 SQLCODE -541SQLSTATE 42891Explanation: Duplicate UNIQUE constraint already exists.SQL0543 SQLCODE -543SQLSTATE 23511Explanation: Constraint &1 conflicts with SET NULL or SET DEFAULT rule. SQL0544 SQLCODE -544SQLSTATE 23512Explanation: CHECK constraint &1 cannot be added.SQL0545 SQLCODE -545SQLSTATE 23513Explanation: INSERT or UPDATE not allowed by CHECK constraint.SQL0546 SQLCODE -546SQLSTATE 42621Explanation: CHECK condition of constraint &1 not valid.SQL0551 SQLCODE -551SQLSTATE 42501Explanation: Not authorized to object &1 in &2 type *&3.SQL0552 SQLCODE -552SQLSTATE 42502Explanation: Not authorized to &1.SQL0557 SQLCODE -557SQLSTATE 42852Explanation: Privilege not valid for table or view &1 in &2.SQL0573 SQLCODE -573SQLSTATE 42890Explanation: Table does not have matching parent key.SQL0574 SQLCODE -574SQLSTATE 42894Explanation: Default value not valid.SQL0577 SQLCODE -577SQLSTATE 38002, 2F002Explanation: Modifying SQL data not permitted.SQL0578 SQLCODE -578SQLSTATE 2F005Explanation: RETURN statement not executed for SQL function &1 in &2. SQL0579 SQLCODE -579SQLSTATE 38004, 2F004Explanation: Reading SQL data not permitted.SQL0580 SQLCODE -580SQLSTATE 42625Explanation: At least one result in CASE expression must be not NULL. SQL0581 SQLCODE -581SQLSTATE 42804Explanation: The results in a CASE expression are not compatible.SQL0583 SQLCODE -583SQLSTATE 42845Explanation: Use of function &1 in &2 not valid.SQL0585 SQLCODE -585SQLSTATE 42732Explanation: Library &1 is used incorrectly on the SET PATH statement SQL0590 SQLCODE -590SQLSTATE 42734Explanation: Name &1 specified in &2 not unique.SQL0601 SQLCODE -601SQLSTATE 42710Explanation: Object &1 in &2 type *&3 already exists.SQL0602 SQLCODE -602SQLSTATE 54008Explanation: More than 120 columns specified for CREATE INDEX. SQL0603 SQLCODE -603SQLSTATE 23515Explanation: Unique index cannot be created because of duplicate keys. SQL0604 SQLCODE -604SQLSTATE 42611Explanation: Attributes of column not valid.SQL0607 SQLCODE -607SQLSTATE 42832Explanation: Operation not allowed on system table &1 in &2.SQL0612 SQLCODE -612SQLSTATE 42711Explanation: &1 is a duplicate column name.SQL0613 SQLCODE -613SQLSTATE 54008Explanation: Primary or unique key constraint too long.SQL0614 SQLCODE -614SQLSTATE 54008Explanation: Length of columns for CREATE INDEX too long. SQL0615 SQLCODE -615SQLSTATE 55006Explanation: Object &1 in &2 type *&3 not dropped. It is in use. SQL0616 SQLCODE -616SQLSTATE 42893Explanation: &1 in &2 type &3 cannot be dropped with RESTRICT. SQL0624 SQLCODE -624SQLSTATE 42889Explanation: Table already has primary key.SQL0628 SQLCODE -628SQLSTATE 42613Explanation: Clauses are mutually exclusive.SQL0629 SQLCODE -629SQLSTATE 42834Explanation: SET NULL not allowed for referential constraint. SQL0631 SQLCODE -631SQLSTATE 54008Explanation: Foreign key for referential constraint too long.SQL0637 SQLCODE -637SQLSTATE 42614Explanation: Duplicate &1 keyword.SQL0642 SQLCODE -642SQLSTATE 54021Explanation: Maximum number of constraints exceeded.SQL0658 SQLCODE -658SQLSTATE 42917Explanation: Function cannot be dropped.SQL0666 SQLCODE -666SQLSTATE 57005Explanation: Estimated query processing time exceeds limit.SQL0667 SQLCODE -667SQLSTATE 23520Explanation: Foreign key does not match a value in the parent key.SQL0675 SQLCODE -675SQLSTATE 42892Explanation: Specified delete rule not allowed with existing trigger.SQL0679 SQLCODE -679SQLSTATE 57006Explanation: Object &1 in &2 type *&3 not created due to pending operation. SQL0683 SQLCODE -683SQLSTATE 42842Explanation: FOR DATA or CCSID clause not valid for specified type.SQL0707 SQLCODE -707SQLSTATE 42939Explanation: Name &1 in &2 not allowed for distinct type.SQL0713 SQLCODE -713SQLSTATE 42815Explanation: Host variable for &2 is NULL.SQL0724 SQLCODE -724SQLSTATE 54038Explanation: Too many cascaded trigger programs.SQL0751 SQLCODE -751SQLSTATE 42987Explanation: SQL statement &1 not allowed in stored procedure or trigger. SQL0752 SQLCODE -752SQLSTATE 0A001Explanation: Connection cannot be changed. Reason code is &1.SQL0773 SQLCODE -773SQLSTATE 20000Explanation: Case not found for CASE statement.SQL0774 SQLCODE -774SQLSTATE 2D522Explanation: Statement cannot be executed within a compound SQL statement. SQL0775 SQLCODE -775SQLSTATE 42910Explanation: Statement not allowed in a compound SQL statement.SQL0776 SQLCODE -776SQLSTATE 428D4Explanation: Cursor &1 specified in FOR statement not allowed.SQL0777 SQLCODE -777SQLSTATE 42919Explanation: Nested compound statements not allowed.SQL0778 SQLCODE -778SQLSTATE 428D5Explanation: End label &1 not same as begin label.SQL0779 SQLCODE -779SQLSTATE 42736Explanation: Label &1 specified on LEAVE statement not valid.SQL0780 SQLCODE -780SQLSTATE 428D6Explanation: UNDO specified for a handler and ATOMIC not specified. SQL0781 SQLCODE -781SQLSTATE 42737Explanation: Condition &1 specified in handler not defined.SQL0782 SQLCODE -782SQLSTATE 428D7Explanation: Condition value &1 specified in handler not valid.SQL0783 SQLCODE -783SQLSTATE 42738Explanation: Select list for cursor &1 in FOR statement not valid.SQL0784 SQLCODE -784SQLSTATE 42860Explanation: Check constraint &1 cannot be dropped.SQL0785 SQLCODE -785SQLSTATE 428D8Explanation: Use of SQLCODE or SQLSTATE not valid.SQL0802 SQLCODE -802SQLSTATE 22003, 22012, 22023, 22504 Explanation: Data conversion or data mapping error.SQL0803 SQLCODE -803SQLSTATE 23505Explanation: Duplicate key value specified.SQL0804 SQLCODE -804SQLSTATE 07002Explanation: SQLDA not valid.SQL0805 SQLCODE -805SQLSTATE 51002Explanation: SQL package &1 in &2 not found.SQL0811 SQLCODE -811SQLSTATE 21000Explanation: Result of SELECT INTO or subquery more than one row. SQL0818 SQLCODE -818SQLSTATE 51003Explanation: Consistency tokens do not match.SQL0822 SQLCODE -822SQLSTATE 51004Explanation: Address in SQLDA not valid.SQL0827 SQLCODE -827SQLSTATE 42862Explanation: &1 in &2 type *SQLPKG cannot be accessed.SQL0840 SQLCODE -840SQLSTATE 54004Explanation: Number of selected items exceeds 8000.SQL0842 SQLCODE -842SQLSTATE 08002Explanation: Connection already exists.SQL0843 SQLCODE -843SQLSTATE 08003Explanation: Connection does not exist.SQL0858 SQLCODE -858SQLSTATE 08501Explanation: Cannot disconnect relational database due to LU 6.2 protected conversation. SQL0862 SQLCODE -862SQLSTATE 55029Explanation: Local program attempted to connect to a remote relational database.SQL0871 SQLCODE -871SQLSTATE 54019Explanation: Too many CCSID values specified.SQL0900 SQLCODE -900SQLSTATE 08003Explanation: Application process not in a connected state.SQL0901 SQLCODE -901SQLSTATE 58004Explanation: SQL system error.SQL0904 SQLCODE -904SQLSTATE 57011Explanation: Resource limit exceeded.SQL0906 SQLCODE -906SQLSTATE 24514Explanation: Operation not performed because of previous error.SQL0907 SQLCODE -907SQLSTATE 27000Explanation: Attempt to change same row twice.SQL0910 SQLCODE -910SQLSTATE 57007Explanation: Object &1 in &2 type *&3 has a pending change.SQL0913 SQLCODE -913SQLSTATE 57033Explanation: Row or object &1 in &2 type *&3 in use.SQL0917 SQLCODE -917SQLSTATE 42969Explanation: Package not created.SQL0918 SQLCODE -918SQLSTATE 51021Explanation: Rollback required.SQL0950 SQLCODE -950SQLSTATE 42705Explanation: Relational database &1 not in relational database directory.SQL0951 SQLCODE -951SQLSTATE 55007Explanation: Object &1 in &2 not altered. It is in use.SQL0952 SQLCODE -952SQLSTATE 57014Explanation: Processing of the SQL statement ended by ENDRDBRQS command. SQL0969 SQLCODE -969SQLSTATE 58033Explanation: Unexpected client driver error.SQL0971 SQLCODE -971SQLSTATE 57011Explanation: Referential constraint &4 in check pending state.SQL5001 SQLCODE -5001SQLSTATE 42703。

sqlcodeSQL状态码

sqlcodeSQL状态码

sqlcodeSQL状态码sqlca通讯区中:sqlcode:=0:该SQL语句被正确执行,没有发生错误和例外>0:oracle执行了该SQL语句,但遇到一个例外。

当ORACLE 未找到满足where 子句检索条件的行时,或者SELECT 或FETCH未有行返回时,就出现例外。

<0:表示由于数据库、系统、网络或应用程序的错误,ORACLE未执行该SQL语句,当出现这类错误时,当前事务一般应回滚。

具体sqlcode代码:0:成功-1:失败100:没有检索到数据可能发生的错误列表:-12, Out of memory in line %d.通常不出现这个错误。

这是你的虚拟内存耗尽的标志。

-200, Unsupported type %s on line %d.通常不出现这个错误.这表明预编译器生成了一些库(函数)不认得的东西.可能你运行的预编译器和当前库不兼容.-201, Too many arguments line %d.这意味着 Postgres 返回了比我们的匹配变量更多的参数.可能你漏了几个INTO :var1,:var2-列表里的宿主变量.-202, Too few arguments line %d.这意味着 Postgres 返回了比我们的对应宿主变量要少的参数.可能你多输入了几个INTO :var1,:var2-列表里的宿主变量.-203, Too many matches line %d.着意味着查询返回了多个行,但你声明的变量不是数组.你执行的 SELECT 可能不是唯一的.-204, Not correctly formatted int type: %s line %d.着意味着宿主变量是一个 int 类型并且 Postgres 数据库里的字段是另一种类型,包含着一个不能转换成一个 int 类型的数值.库(函数)使用 strtol 做此类转换.-205, Not correctly formatted unsigned type: %s line %d.着意味着宿主变量是一个unsigned int(无符号整数)类型而Postgres 数据库里的字段是另外一种类型并且包含一个不能转换成unsigned int 的数值.库(函数)使用 strtoul 做这类转换.-206, Not correctly formatted floating point type: %s line %d.着意味着宿主变量是一个 float (浮点)类型而 Postgres 数据库里的字段是另外一种类型并且包含一个不能转换成float 的数值.库(函数)使用 strtod 做这类转换.-207, Unable to convert %s to bool on line %d.这意味着宿主变量是一个 bool (布尔)类型,而 Postgres 数据库里的字段值既不是 't' 也不是 'f'。

SQLcode返回值

SQLcode返回值

SQL中s‎q lca.‎s qlco‎d e返回值‎的含义‎如果一个‎S QL 语‎句发生了错‎误,那么‎s qlca‎.sqlc‎o de 将‎是非零值。

‎如果 s‎q lca.‎s qlco‎d e 小于‎0 那么‎就是发生了‎某种严重的‎错误,象数‎据库定义与‎查询定义不‎一致等.‎如果大于‎0则是通‎常的错误,‎象表不包括‎所要求的行‎等.s‎q lca.‎s qlco‎d e ==‎0,成功‎sqlc‎a.sql‎c ode ‎== -1‎失败‎(获‎取具体失败‎信息:me‎s sage‎b ox('‎',"出错‎信息:"+‎s qlca‎.SQLE‎r rTex‎t) )-‎-PB里的‎操作方法‎可能发生的‎错误列表:‎-12,‎Out ‎o f me‎m ory ‎i n li‎n e %d‎.通常‎不出现这个‎错误。

这是‎你的虚拟内‎存耗尽的标‎志。

-‎200, ‎U nsup‎p orte‎d typ‎e %s ‎o n li‎n e %d‎.通常‎不出现这个‎错误.这表‎明预编译器‎生成了一些‎库(函数)‎不认得的东‎西.可能你‎运行的预编‎译器和当前‎库不兼容.‎-20‎1, To‎o man‎y arg‎u ment‎s lin‎e %d.‎这意味‎着 Pos‎t gres‎返回了比‎我们的匹配‎变量更多的‎参数.可能‎你漏了几个‎I NTO ‎:var1‎,:var‎2-列表里‎的宿主变量‎.-2‎02, T‎o o fe‎w arg‎u ment‎s lin‎e %d.‎这意味‎着 Pos‎t gres‎返回了比‎我们的对应‎宿主变量要‎少的参数.‎可能你多输‎入了几个I‎N TO :‎v ar1,‎:var2‎-列表里的‎宿主变量.‎-20‎3, To‎o man‎y mat‎c hes ‎l ine ‎%d.‎着意味着查‎询返回了多‎个行,但你‎声明的变量‎不是数组.‎你执行的‎S ELEC‎T可能不‎是唯一的.‎-20‎4, No‎t cor‎r ectl‎y for‎m atte‎d int‎type‎: %s ‎l ine ‎%d.‎着意味着宿‎主变量是一‎个 int‎类型并且‎Post‎g res ‎数据库里的‎字段是另一‎种类型,包‎含着一个不‎能转换成一‎个 int‎类型的数‎值.库(函‎数)使用‎s trto‎l做此类‎转换.‎-205,‎Not ‎c orre‎c tly ‎f orma‎t ted ‎u nsig‎n ed t‎y pe: ‎%s li‎n e %d‎.着意‎味着宿主变‎量是一个‎u nsig‎n ed i‎n t(无符‎号整数)类‎型而Pos‎t gres‎数据库里‎的字段是另‎外一种类型‎并且包含一‎个不能转换‎成unsi‎g ned ‎i nt 的‎数值.库(‎函数)使用‎strt‎o ul 做‎这类转换.‎-20‎6, No‎t cor‎r ectl‎y for‎m atte‎d flo‎a ting‎poin‎t typ‎e: %s‎line‎%d. ‎着意味着‎宿主变量是‎一个 fl‎o at (‎浮点)类型‎而 Pos‎t gres‎数据库里‎的字段是另‎外一种类型‎并且包含一‎个不能转换‎成 flo‎a t 的数‎值.库(函‎数)使用‎s trto‎d做这类‎转换.‎-207,‎Unab‎l e to‎conv‎e rt %‎s to ‎b ool ‎o n li‎n e %d‎.这意‎味着宿主变‎量是一个‎b ool ‎(布尔)类‎型,而 P‎o stgr‎e s 数据‎库里的字段‎值既不是‎'t' 也‎不是 'f‎'。

OraclePLSQL开发基础(第三十二弹:SQLCODE和SQLERRM)

OraclePLSQL开发基础(第三十二弹:SQLCODE和SQLERRM)

OraclePLSQL开发基础(第三十二弹:SQLCODE和
SQLERRM)
尽管一个异常在同一时刻只能抛出一次,但是实际上错误的消息文本可能包含来自多个异常的消息,这是因为异常具有传递性。

在OTHERS处理器中处理异常时,有几种方法可以得到错误信息栈中的错误消息,其中最常用的是SQLCODE和SQLERRM。

SQLCODE函数返回当前的错误编码,对于用户自定义的异常,SQLCODE总是返回1;SQLERRM用于返回错误消息文本,对于自定义的异常,SQLERRM总是返回“User-defined Exception”。

用法如:
...
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('错误编号:'||SQLCODE||' 错误消息:'||SQLERRM);
END;
•1
•2
•3
•4
•5
SQLERRM函数还可以接受一个参数,如:
DBMS_OUTPUT.PUT_LINE(SQLERRM(0)); -- 这将返回:ORA-0000:normal,successful completion
•1
要返回NO_DATA_FOUND的错误消息,可以传递错误号100,将返回ORA-01403错误,如SQLERRM(100)。

大多数情况下使用不带参数的SQLERRM即可,不带参数的函数调用将返回完整的错误信息。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
-157 42810 必须在FOREIGN KEY语句中指定一个表名
-158 42811 视图的列和选择列表中的列不相匹配
-159 42089 无效DROP或COMMENT ON语句
-160 42813 对该视图的WITH CHECK OPTION无效
-161 44000 正被更新的视图WITH CHECK OPTION语句使得这行不能被插入或更新
-118 42902 数据修改语句(UPDATE或DELETE)和FROM语句中的表和视图命名不合法
-119 42803 HAVING语句中的列的列表与GROUP BY语句中的列列表不匹配
-120 42903 不允许WHERE语句、SET语句、VALUES语句或者SET ASSIGNMENT语句引用列函数
-164 42502 用户没有建立这个视图的权限
-170 42605 标量函数指定了无效的参数个数
-171 42815 标量函数指定了无效的数据类型长度或者无效数值
-173 42801 在非只读型的游标上不能指定隔离级别UR
-180 22007 DATE、TIME、TIMESTAMP值的字符串表示法的语法不对
-153 42908 无效的视图建立请求,必须为旋转列表中列出的列出的未命名的列或者重复的列提供一个名字
-154 42909 不能用UNION、UNION ALL或者一个远程表建立视图
-156 42809 在视图上建立索引是非法的,或者在ALTER TABLE,CREATE TRIGGER,DROP TABLE或LOCK TABLE语句上指定一个不是表的其他对象这是无效的
-126 42829 不能为一个UPDATE语句指定ORDER BY语句
-127 42905 在子选择中DISTINCT只能指定一次
-128 42601 SQL谓词中NULL使用不当
-129 54004 SQL语句中包含的表多于15个
-130 22019 ESCAPE语句必须为一个字符
+658 01600 当建立目录索引时,不能指定SUBPAGES语句,SUBPAGES将被忽略,并缺省为1
+664 01540 分区索引的限制关键字超出了最大值
+738 01530 已命名的对象的更改可能像只读系统中对象的改变要求一样
+799 0157 SET语句中引用的特定寄存器不存在,将忽略 SET请求
+2002 01624 因为指定的缓冲池不允许超高速缓存,GNPCACHE指定被忽略
+2007 01602 因为DB2子系统的参数禁用“提示(hiats)”所以不能指定优化提示
+30100 01558 分布式协议错误被检测到,提供原来的SQLCODE和SQLSTATE
-007 42601 SQL语句中由非法字符
+204 01532 命名的对象未在DB2中定义
+206 01533 命名的列不在SQL语句中指定的任何表中存在
+218 01537 因为SQL语句引用一个远程对象,不能为该SQL语句执行EXPLAIN
+219 01532 命名的PLAN TABLE不存在
+220 01546 不正确定义PLAN TABLE,检查命名列的定义
-101 54001 SQL语句超出了已确定的DB2限制:例如,表的数目太多,语句中的字节太多
-102 54002 字符串常量太长
-103 42604 无效数学文字
-104 42601 SQL语句中遇到非法符号
-105 42604 无效的字符串格式;通常引用一个格式不正确的图形字符串
-144 58003 指定的段号无效
-147 42809 某一源函数不能更改。要改变源函数,必须删除该源函数并重新建立他
-148 42809 RENAME和ALTER无法执行。RENAME不能对视图或者活动RI.ST表重新命名。
ALTER不能用于改变列的长度,因为该列参与了RI、一个用户退出程序、全局的临时表或打开DATACAPTURE CHANGES表的列
-150 42807 触发活动的INSERT,UPDATE或DELETE语句中指定了无效的视图更新或一个无效的转换表
-151 42808 试图更新一个不可更新的视图的列、一个DB2 CATALOG表的列或者一个ROWID列
-152 42809 DROP CHECK试图删除一个参照约束,或者DROP FOREIGN试图删除一个检查约束
DB2错误信息
sqlcode sqlstate 说明
000 00000 SQL语句成功完成
01xxx SQL语句成功完成,但是有警告
+012 01545 未限定的列名被解释为一个有相互关系的引用
+098 01568 动态SQL语句用分号结束
+100 02000 没有找到满足SQL语句的行
+535 01591 请求一个主健的定位更新,或请求一个使用自我引出 约束的表的删除操作
+541 01543 命名外健是一个重复的引用约束
+551 01548 命名的授权ID缺少在命名的DB2对象上执行命名操作的权限
+552 01542 命名的授权ID缺少执行命名操作的权限
+558 01516 已经被授权该PUBLIC,因此WITH GRANT OPTION不可用
+464 01609 命名的存储过程超出了它可能返回的查询结果集的个数限制
+466 01610 指定由命名的存储过程返回的查询结果集的个数。成功完成
+494 01614 由存储过程返回的结果集的个数超过了由ASSOCIATE LOCATORS语句指定的结果集定位器的个数
+495 01616 因为倒台SQL的成本估算超出了在ELST中指定的警告阀值,所以发出警告
-107 42622 对象名太长
-108 42601 RENAME语句中指定的名字有错误,不能使用限定词
-109 42601 指定了无效语句;例如CREATE VIEW不能包含ORDER BY 语句
-110 42606 遇到了无效的十六进制的文字
-111 42901 指定的列函数没有给出列名
-121 42701 在INSERT或UPDATE语句中,某一列被非法引用了两次
-122 42803 非法使用了列函数。因为没有用于一个列函数的所有列不再GROUP BY语句中
-123 42601 特定位置的参数必须是一个常数或者一个关键词
-125 42805 ORDER BY语句中指定了无效数字,该数字要么小于1要么大于选定的列数
-136 54005 排序关键字的长度大于4000字节
-137 54006 被连接的字符串太大;字符的最大值为32767;图形的最大值为16382
-138 22011 SUBSTR列函数的第二个或第三个操作符无效
-142 42612 不支持的SQL语句。该语句可能在另外的RDBMS上有效,也有可能在其他的上下文中有效(例如,VALUES只能在触发器中出现)
-181 22001 不是有效的DATE、TIME、TIMESTAMP值
-182 42816 在算术表达式中的日期/时间值无效
-183 22008 在算术表达式中返回的日期/时间值的结果不在有效值的范围内
-112 42607 无效的列函数语法;列函数不能运行与其他的列函数之上
-113 42602 遇到无效字符
-114 42961 该语句的位置名称必须与当前服务器匹配,但是却没有匹配
-115 42601 因为比较运算符没有伴着一个表达式或者列表,遇到了无效谓词
-117 42802 待插入的数值的个数于被插入的行中的列数不相等
+802 数据溢出或者因除法异常而引起的数据异常错误
+806 01553 ISOLATION(RR)与LOCKSIZE PAGE 冲突
+807 01554 由于十进制乘法导致溢出
+863 01539 连接成功,但是只支持SBCS
+2000 56094 SUBPAGES不等于1的1型索引不能成为数据共享环境中的缓冲池组依赖者
+304 01515 该值不能被分配给宿主变量,因为该值不再数据类型的范围之内
+331 01520 不能被翻译的字符串,因此被设置为NULL
+339 01569 由于与DB2 2.2版本的子系统连接,所以可能存在字符转换问题
+394 01629 使用优化提示来选择访问路径
+395 01628 设置了无效的优化提示,原因代码指定了为什么,忽略优化提示
+236 01005 SQLDA中的SQLN的值至少应于所描述的列的个数一样大
+237 01594 至少有一个被描述的列应该是单值类型,因此扩展的SQLVAR条目需要另外的空间
+238 01005 至少应有一个被描述的列是一个LOB,因此扩展的SQLVAR条目需要另外的空间
+239 01005 至少应有一个被描述的列应是单值类型,因此扩展的SQLVAR条目需要另外的空间
+110 01561 用DATA CAPTURE定义的表的更新操作不能发送到原来的子系统
+111 01590 为2型索引设置了SUBPAGES语句
+117 01525 要插入的值的个数不等于被插入表的列数
+162 01514 指定的表空间被置为检查挂起状态
+203 01552 使用非唯一的名字来解决命名的限定列
相关文档
最新文档