DB2-sqlcode
- 格式:pdf
- 大小:472.39 KB
- 文档页数:14
DB2错误代码/SQL返回码信息对用COBOL链接DB2时,出现DB2错误信息时,如果你当然你也可以直接在db2的命令行下输入:db2 ? sqlcode sqlstate0001xxx12154598156810020001101561111159011715251621514203155220415322061533218153721915322201546236100523715942381005239100530415153311520339156939416293951628402152140315224341608445100446201Hxx46416094661610494161449516165351591541154355115485521542558151656115235621560585162559915966101566625151862615296451528 6501538 6531551 6551597 6581600 6641540 7381530 799157 8021519 8061553 8071554 8631539 200056094 20021624 20071602 301001558 -742601 -1042603 -2942601 -6042815 -8442612 -9742601 -10154001 -10254002 -10342604 -10442601 -10542604 -10742622 -10842601 -10942601 -11042606 -11142901 -11242607 -11342602 -11442961 -11542601 -11742802 -11842902 -11942803 -12042903 -12142701 -12242803 -12342601 -12542805 -12642829 -12742905 -12842601 -12954004 -1302201922025 -13142818 -13242824 -13342906-13442907 -13654005 -13754006 -13822011-14242612-14458003 -14742809 -14842809 -15042807 -15142808 -15242809 -15342908 -15442909 -15642809 -15742810 -15842811 -15942089 -16042813 -16144000 -16442502 -17042605 -17142815 -17342801 -18022007 -18122001 -18242816 -18322008 -18442610 -18557008 -18622505 -18722506 -18822503 -18922522 -19042837 -19122504 -19742877 -19842617 -19942601 -20342702 -20442704 -20542703 -20642703 -20842707 -21242712 -21442822 -21942704 -22055002 -22155002 -22942708 -240428B4-25042718 -25142602 -30022024 -30142895 -3022200122003 -30342806 -30422003 -30522002 -30922512 -31022501 -31122501 -31242618 -3137001 -31442714 -32722525 -33022021 -33122021 -33257017 -33356010 -33842972 -33956082 -35042962 -35156084 -35256084 -35542993 -372428C1 -39042887 -39242855 -39638505 -397428D3 -398428D2 -39922511 -40054027 -40142818 -40242819 -40422001 -40542820 -40622003 -40723502 -40842821 -40942607 -41042820 -41156040 -41242823 -41322003 -41442824 -41542825 -41642907 -41742609 -41842610 -41942911 -42022018 -42142826-4230F001 -4262D528 -4272D529 -43038503 -43322001 -435428B3 -438xxxxx -44042884 -44142601 -44342601 -44442724 -44942878 -45039501 -45142815 -45342880 -45442723 -45542882 -45642710 -45742939 -45842883 -46339001 -46942886 -47039002 -47155023 -47224517 -47342918 -47542866 -47642725 -47842893 -48051030 -48251030 -48342885 -48738001-49142601-49242879 -49557051 -49651033-49754041-49924516 -50024501 -50124501 -50224502 -50342912 -50434000 -50724501 -50824504 -50942827-51042828 -51142829 -51256023 -51342924-51626501 -5177005 -5187003 -51924506 -52551015 -52642995 -53023503-53123504-53223504 -53321501 -53421502 -53521502 -53642914 -53742709 -53842830 -53942888-54057001-54242831-54323511-54423512 -54523513 -54642621 -54842621 -54942509 -55142501 -55242502 -55342503 -55442502 -55542502 -55642504 -55742852 -55856025 -55957002 -56742501 -57125000 -57342890 -57442864 -57738002-57938004 -58042625 -58142804 -58242625 -58342845 -58542732 -58642907 -587428C6 -59042734-60142710 -60254008 -60323515 -60442611 -60742832 -61153088 -61242711 -61354008 -61454008 -61555006 -61642893-61756089-61842832 -61955011 -62053001 -62158001 -62256031 -62355012 -62442889 -62555014 -62655015 -62755016-62842613 -62942834 -63056089 -63154008 -63242915 -63342915 -63442915 -63542915 -63656016 -63742614 -63842601 -63956027 -64056089 -64254021 -64354024 -64442615 -64655017 -64757003 -65056090 -65154025 -65223506 -65357004 -65556036 -65842917 -66053035 -66153036 -66253037 -66353038-66553039 -66657005 -66742917 -66856018 -66942917 -67054010 -67153040 -67255035 -67653041 -67757011 -67853045 -67957006 -68054011 -68123507 -68257010 -68342842 -68454012 -68558002 -68653043 -68753044 -68858002 -68954011 -69023508 -69157018 -69257018 -69355003 -69457023 -69642898-69742899-71342815-71556064-71656065 -71756066 -71856067 -71942710 -72042710 -72142710 -72242704 -7239000 -72454038 -72542721 -72655030 -72856080 -729429B1 -73056053 -73156054 -73256055 -73356056 -73456057 -73555004 -73653014 -73753056-73956088-74051034 -74155030 -74253004 -74657053 -74757054 -74854042 -75042986-75142987-7520A001 -763560A1 -764560A2 -765560A3 -766560A4 -76742626 -768560A50 -76953096 -770530A6 -771428C7 -79742987 -798428C9 -8022201222003 -80323505 -8047002 -80551002 -80723509 -8088001 -81121000 -81222508 -81542920-81725000-8185103-81958004 -82058004 -82251004 -84054004 -8428002 -8438003 -87058026 -87251302 -87353090 -87453901 -87542988 -87653092 -87753093 -87853094 -87953095-9008003 -90158004 -90258005 -90457011 -90557014 -90651005 -90823510 -90957007 -91057007 -91140001 -91357033 -91742969 -91851021 -91956045 -92242505 -92357015 -92458006 -9252D521 -9262D521 -92751006 -92958002 -93951021 -94756038 -94856062 -95042705 -96551021 -98157015 -99157015 -200153089 -20003560A7 -20004560A8 -2000554035 -2000653097 -2007053098 -2007153099 -2007256052 -2007342927 -2007442939 -2010056059 -2010156059 -2010242849 -2010442856 -2010642945 -3000058008 -3000257057 -3002058009 -3002158010 -3003058013 -3004057012 -3004157013 -3005058011 -3005158012 -3005242932 -3005342506-300608004 -300618004 -3007058014 -3007158015 -3007258016 -3007358017 -3007458018 -300808001 -3008158019 -300828001 -3009025000 -3010456095 -3010556096信息对照<!--newcoin-->如果你不懂代码是什么意思,可以用这份资料查找,db2 ? SQLN"错误代码",系统会给出一些提示信息.DB2错误信息(按sqlcode排序)SQL语句成功完成SQL语句成功完成,但是有警告未限定的列名被解释为一个有相互关系的引用动态SQL语句用分号结束没有找到满足SQL语句的行用DATA CAPTURE定义的表的更新操作不能发送到原来的子系统为2型索引设置了SUBPAGES语句要插入的值的个数不等于被插入表的列数指定的表空间被置为检查挂起状态使用非唯一的名字来解决命名的限定列命名的对象未在DB2中定义命名的列不在SQL语句中指定的任何表中存在因为SQL语句引用一个远程对象,不能为该SQL语句执行EXPLAIN命名的PLAN TABLE不存在不正确定义PLAN TABLE,检查命名列的定义SQLDA中的SQLN的值至少应于所描述的列的个数一样大至少有一个被描述的列应该是单值类型,因此扩展的SQLVAR条目需要另外的空间至少应有一个被描述的列是一个LOB,因此扩展的SQLVAR条目需要另外的空间至少应有一个被描述的列应是单值类型,因此扩展的SQLVAR条目需要另外的空间该值不能被分配给宿主变量,因为该值不再数据类型的范围之内不能被翻译的字符串,因此被设置为NULL由于与DB2 2.2版本的子系统连接,所以可能存在字符转换问题使用优化提示来选择访问路径设置了无效的优化提示,原因代码指定了为什么,忽略优化提示未知的位置本地不存在CREAT ALIAS对象在DB2未来发布的版本中将不支持指定的特性,IBM建议你停止使用这些特性值被CAST函数截取由用户定义的函数或存储过程发出的警告命名的存储过程超出了它可能返回的查询结果集的个数限制指定由命名的存储过程返回的查询结果集的个数。
一、db2 基础 基本语法 注释:“--”(两个减号) 字符串连接:“||” 如set msg=’aaaa’||’bbbb’,则msg为’aaaabbbb’ 字符串的引用:‘’(一定用单引号),如果需要输入单引号,输入两个单引号即可。 语句结束:“;” 语法来源:PASCLE
转义字符 如果你想查询字符串中包含‘%’或‘_’ ,就得使用转义字符(Escape Characters)。比如,要想查询book_title中包含字符串’99%’的纪录: SELECT * FROM books WHERE book_title like ‘%99!%%’ escape ‘!’ 后面的escape ‘!’是定一个转义字符‘!’, 指明紧跟着转义字符’!'后的%不再是统配符。
DB2命令参数选项 Db2 list command options 可以查看 -a 显示 SQLCA OFF -c 自动落实 ON -e 显示 SQLCODE/SQLSTATE OFF -f 读取输入文件 OFF -l 将命令记录到历史文件中 OFF -n 除去换行字符 OFF -o 显示输出 ON -p 显示交互式输入提示 ON -r 将输出保存到报告文件 OFF -s 在命令出错时停止执行 OFF -t 设置语句终止字符 OFF -v 回送当前命令 OFF -w 显示 FETCH/SELECT 警告信息 ON -x 不打印列标题 OFF -z 将所有输出保存到输出文件 OFF
这些选项的具体功能及其缺省设置为: .a 显示 SQLCA 的数据,缺省为 OFF。 .c 是否自动落实 SQL 命令,缺省为 ON。 .e {c|s} 显示 SQLCODE 或 SQLSTATE,缺省为 OFF。 .f 文件名将命令的输入从标准输入指定到某一文件,缺省为 OFF。 注:命令“db2 < 文件名”与“db2 -f 文件名”作用相同。 .l 文件名将命令记录到历史文件中,缺省为 OFF。 .n 除去换行字符,缺省为 OFF。 .o 将输出数据及信息送到标准输出,缺省为 ON。 .p 在交互方式下显示命令行处理器的提示信息,缺省为 ON。 .r 将输出保存到指定文件中,缺省为 OFF。 .s 执行批处理文件中或交互方式下的命令出错时即停止执行操作,缺省为 OFF。 .t 设置语句终止字符,缺省为 OFF。 .v 回送当前命令到标准输出,缺省为 OFF。 .w 显示 FETCH 或 SELECT 警告信息,缺省为 ON。 .x 不打印列标题,缺省为 OFF。 .z 文件名将所有输出保存到输出文件,缺省为 OFF。 SQLSTATE含义
sqlcode sqlstate错误信息000 00000SQL语句成功完成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 01005SQLDA中的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指定由定名的存储过程返回的查询成果集的个数。
Db2数据库SQL编码摘要本文主要是关于用SR做报表,编写SQL代码的心得,文章从select语句的执行顺序,临时表,自定义函数,索引,存储过程这几个方面的使用,来讨论如何优化SQL代码,加快速查询速度,增强代码的可读性。
其中select语句的执行顺序和索引主要是为了加快SQL的查询速度。
自定义函数,临时表,存储过程的使用是为了处理逻辑复杂的sql代码,让代码的可读性加强。
关键字:SQL 查询速度可读性/envelope/archive/2010/3/18.html1 SQL 执行顺序根据SQL的执行顺序和表数据具体情况,在多表边接之前删除多余的数据,加快查询速度。
详解如下:从sql的执行方式的来优化SQL代码的执行速度。
首先,看看where ,group by ,order by 等的执行顺序。
Sql语句的执行顺序其实是如下的:Select A.id, COUNT(B.字段)AS num 6FROM table1 AS A 1LEFT OUTER JOIN table2 AS B 2ON A.id = A.id 3WHERE A.字段 = 条件 4GROUP BY A.字段 5HAVING COUNT(B.字段) < 3 7ORDER BY num 8首先,on 和where 两者的区别:上面的一段SQL是按标号的顺序执行的,SELECT的执行顺序是放在最后的,而FROM则是第一步,并且是两个表先做外连接,然后通过ON滤掉不符合条件的结果。
注意,这里写在on后面的过滤条件和where后面的过滤条件的是不同的,主要是根据连接的类型而定(例如:FROM TableA LEFT JOIN TableB ON TableA.DATE <> '1981-01-01'当做完LEFT连接后不符合条件的TableA表中的记录是会添加进来的,因为这里使用的是LFET JOIN)。
1 限制结果表大小Select * from tabname fetch first 5 rows only;2 cast用法Select * from tabnameA where coln = cast( ‘TR01’ as tabnameB)CAST(salary AS DOUBLE) 类型转换3 连接内连接selet a.col,b.col from tab a,tab b where a.t1=b.t1;外连接:左连接:select a.col,b.col from tab a left join tab b on a.t1=b.t1 (left outer join)右连接:4 输出排序Order by col DESC 降序排列缺省为升序5 限制输出结果,与order共用Select * from tabA order by col desc fetch first 5 rows only6 substr函数Substr(col,1,2); col为char或varchar型7 列函数可以参照数据库中FUNCTIONS中的说明用Quest Centeral查看,以下是常用的Max 、avg、count…DB2中的VARCHAR转换为INTEGER的函数为CAST()DB2中的INTEGER转换为VARCHAR的函数为CHAR()DB2中的VARCHAR转换为DATE的函数为DATE()DB2中的DATE转换为VARCHAR的函数为CHAR() char(col,iso) 输出yyyy-mm-ddYEAR() 返回date数值的年部分Month()返回date数值的月部分HOUR() 返回一个数值的小时部分SELECT HOUR('18:34:23')FROMSECOND() 返回一个数值的秒部分RTRIM()删除字符串尾部的空格Ltrim()删除字符串左边的空格Replace(col,exp1,exp2)替换col中exp1为exp2MOD(EXP1,EXP2) 返回EXP1除以EXP2的余数DOUBLE()如果参数是一个数字表达式,返回与其相对应的浮点数,如果参数是字符串表达式,则返回该数的字符串表达式.FLOA T() 返回一个数的浮点表示FLOOR() 返回小于或等于参数的最大整数8 group by分组Select a, sum(fse) from tab group by a having sum(fse)>1000 Having过滤条件9 取消重复值distinctSelect distinct col from tab10 字符串匹配like11 范围查找between and12 否定条件查找not like13 空值查询col is null14 查找一组值col in (1,2);15 子查询Select * from tabA where col1 in (select col from tabB); Select * from tabA where col1 not in (select col from tabB);16 case 表达式Select caseWhen score < 65 then ‘not passed’When score<=90 then ‘passed’Else ‘excellent’EndFrom tabA18 基础-多表的关联更新方法db2的update语法不支持“update table1 set t1.col1=t2.value1 from table1 t1,table2 t2 where …”的写法,但是可以通过如下方法解决:update table1 t1 set t1.col1=(select t2.col1 from table2 t2 where …)例:update test t1 set (ername,t1.instcode) = (selectt2.instcode,t2.instname from sysinsttb t2 wheret2.instcode=t1.instcode);19 集合运算符union intersect except并:union select col from tabA union select col from tabB交: intersect select col from tabA intersect select col from tabB差:except select col from tabA except select col from tabB20 insert …selectInsert into tabA select col1, col2 from tabB选择的列与插入的列数目、类型一致.21 DB2如何得到错误代码的说明?DB2 ?SQLCODE例:db2 ? sql080322 在命令行创建存储过程Db2 –td@ -vf sp.sqlSp.sql为脚本注意,一个可能的脚本如下:Sp.sql#注释Drop PROCEDURE db2inst1.spname@Create PROCEDURE db2inst1.spname(in cs1 char(1), in cs2 int, out outcode int)Language sqlBegindeclare SQLCODE int default 0;end@注意在客户端工具中不能加@实例名字也应该注意。
DB2不允许访问表空间解决1. DB2进行异常操作后,如命令未执行完将其中断,或对DB2表进行load/restore操作后,DB2将只能select,不能update,altet,insert,报错如下:DB2 SQL Error: SQLCODE=-290, SQLSTATE=55039, SQLERRMC=null,DRIVER=3.50.152消息:不允许访问表空间。
. SQLCODE=-290, SQLSTATE=55039, DRIVER=3.50.1522. 可查看DB2的表空间状态,确认状态后进行相应的处理解决$ db2 "list tablespace show detail"Tablespaces for Current DatabaseTablespace ID = 0Name = SYSCATSPACEType = System managed spaceContents = Any dataState = 0x0000Detailed explanation:NormalTotal pages = 2519Useable pages = 2519Used pages = 2519Free pages = Not applicableHigh water mark (pages) = Not applicablePage size (bytes) = 4096Extent size (pages) = 32Prefetch size (pages) = 32Number of containers = 1Tablespace ID = 1Name = TEMPSPACE1Type = System managed spaceContents = System Temporary dataState = 0x0000Detailed explanation:NormalTotal pages = 1Useable pages = 1Used pages = 1Free pages = Not applicableHigh water mark (pages) = Not applicablePage size (bytes) = 4096Extent size (pages) = 32Prefetch size (pages) = 32Number of containers = 1Tablespace ID = 2Name = USERSPACE1Type = System managed spaceContents = Any dataState = 0x0004 这个代码意义就是“停顿的独占”,正常状态为0x0000,非0就是有问题,都可以用下面方法解决。
reorg报错sqlcode-291的解决方法如何解决SQLCODE291 错误SQLCODE291是一种主要用于IBM DB2 数据库的错误代码,表示一个表或者视图的重新组织操作失败。
当数据库管理员或者开发人员试图对表或者视图执行重新组织操作,但出现问题时,就会产生该错误代码。
本文将一步一步解释如何解决SQLCODE291 错误,帮助您快速定位和解决问题。
1. 确认错误的来源首先,您需要确定哪个表或者视图导致了SQLCODE291 错误。
通常,数据库系统会为每个错误提供一条具体的错误消息,其中包含了导致错误的对象的名称。
您可以通过检查错误消息来确定具体的对象,例如:REORG TABLE schema_name.table_nameREORG INDEXES ALL FOR TABLE schema_name.table_name2. 检查表或者视图的状态在执行重新组织操作之前,您需要确保目标表或者视图处于正确的状态。
有时,表或者视图可能已被标记为不可用或者正在进行其他操作。
您可以通过执行以下查询来检查目标表或者视图的状态:SELECT TABNAME, STATUS FROM SYSCAT.TABLESWHERE TABSCHEMA = 'schema_name' AND TABNAME ='table_name'确保STATUS 列返回正常值,如"N" 表示正常,"R" 表示表被重整,"C" 表示表正在进行复制等。
如果表或者视图处于不正确的状态,您可能需要等待其他操作完成,或者手动重置它们的状态。
3. 检查重新组织操作的权限执行重新组织操作需要相应的权限。
确保您具有足够的权限来执行重新组织操作。
通常,有一下几种权限:- SYSADM 或SYSCTRL 角色。
- DBADM 或DBCTRL 角色。
- 对表空间的REORG 权限。
DB2911错误的解释SQL0911N 因为死锁或超时,所以当前事务已回滚。
原因码为 "<原因码>"。
说明:
当前⼯作单元参与了未解决的对象争⽤,因此必须回滚。
原因码如下所⽰:
2 由于死锁⽽导致事务已回滚。
68 由于锁定超时⽽导致事务已回滚。
72 因为存在与事务中所涉及的 DB2 Data Links Manager 有关的错误,所
以事务已回滚。
注: 必须再次输⼊与⼯作单元相关的更改。
应⽤程序已回滚⾄上⼀次 COMMIT。
⽤户响应:
为了帮助避免死锁或锁定超时,对长时间运⾏的应⽤程序或有可能遇到死锁的应
⽤程序频繁发出 COMMIT 操作(如果有可能)。
联合系统⽤户:联合服务器或数据源处可能会发⽣死锁。
没有检测跨越数据源并
潜在地跨越联合系统的死锁的机制。
有可能标识使请求失败的数据源(请参阅
Problem Determination Guide 以确定哪⼀个数据源使 SQL 语句的处理失败)。
当处理 SQL 语句的某些组合时,通常会发⽣死锁或者预期会发⽣死锁。
建议您设
计应⽤程序来尽可能避免死锁。
有关防⽌发⽣死锁或锁定超时的更详细信息,请使⽤诸如"防⽌死锁"之类的短语
和诸如"死锁"和"锁定超时"之类的术语在 DB2 信息中⼼(http://
/infocenter/db2luw/v9)中进⾏搜索。
sqlcode: -911
sqlstate: 40001。
SQLCODE=-xxx是DB2数据库中特定错误代码的表示。
这个错误代码通常意味着一个事务试图执行一个更新操作,但由于某种原因执行失败。
在本文中,我们将讨论SQLCODE=-xxx的可能原因以及解决方法。
让我们来看一下可能导致SQLCODE=-xxx错误的几种常见情况:1. 死锁:当多个事务同时试图获取对同一资源的排他访问权限时,可能会导致死锁。
这种情况下,DB2会选择一个事务作为死锁牺牲者,并回滚这个事务的更新操作,从而触发SQLCODE=-xxx错误。
2. 数据完整性约束冲突:如果一个事务试图插入或更新的数据违反了表的数据完整性约束,DB2会回滚这个事务并返回SQLCODE=-xxx错误。
3. 超出表空间限制:如果一个表空间的存储空间已经用完,DB2会阻止任何进一步的数据插入或更新操作,并返回SQLCODE=-xxx错误。
现在让我们来讨论一下解决SQLCODE=-xxx错误的可能方法:1. 识别问题:我们需要通过分析错误日志和数据库日志来识别导致SQLCODE=-xxx错误的具体原因。
这样可以帮助我们更好地定位问题并采取适当的解决措施。
2. 优化事务:如果错误是由于死锁或数据完整性约束冲突导致的,我们可以尝试优化事务的执行顺序或重新设计数据操作逻辑,以减少这些冲突的发生。
3. 扩展表空间:如果错误是由于表空间的存储空间用完导致的,我们可以尝试扩展相关的表空间来解决这个问题。
4. 清理无用数据:有时,SQLCODE=-xxx错误可能是由于数据库中存在大量无用数据导致的。
在这种情况下,我们可以尝试删除或归档这些无用数据,从而释放存储空间并减少数据操作的复杂度。
5. 通联DBA团队:如果我们无法确定错误的具体原因或无法解决这个问题,我们可以通联数据库管理员团队寻求帮助。
他们可能有更多的经验和技巧来解决这个问题。
SQLCODE=-xxx是一个常见的DB2数据库错误代码,可能由多种原因导致。
在面对这个错误时,我们首先需要识别问题的具体原因,然后采取相应的措施来解决。
SQLSTATE 消息
本节列示 SQLSTATE 及其含义。
SQLSTATE 是按类代码进行分组的;对于子代码,请参阅相应的表。
类代码 00 完全成功完成
类代码 01 警告
类代码 02 无数据
类代码 07 动态 SQL 错误
类代码 08 连接异常
类代码 09 触发操作异常
类代码 0A 不支持功能部件
类代码 0D 目标类型规范无效
类代码 0F 无效标记
类代码 0K RESIGNAL 语句无效
类代码 20 找不到 CASE 语句的条件
类代码 21 基数违例
类代码 22 数据异常
类代码 23 约束违例
类代码 24 无效游标状态
类代码 25 无效事务状态
类代码 26 无效 SQL 语句标识
类代码 27 触发的数据更改违例
类代码 28 无效权限规范
类代码 2D 无效事务终止
类代码 2E 无效连接名
类代码 34 无效游标名
类代码 36 无效游标规范
类代码 38 外部函数异常
类代码 39 外部函数调用异常
类代码 3B SAVEPOINT 无效
类代码 40 事务回滚
类代码 42 语法错误或存取规则违例
类代码 44 WITH CHECK OPTION 违例
类代码 46 Java DDL
类代码 51 无效应用程序状态
类代码 53 无效操作数或不一致的规范
类代码 54 超过 SQL 或产品限制
类代码 55 对象不处于先决条件状态
类代码 56 其它 SQL 或产品错误
类代码 57 资源不可用或操作员干预
类代码 58 系统错误。
1. DB2进行异常操作后,如命令未执行完将其中断,或对DB2表进行load/restore操作后,DB2将只能select,不能update,altet,insert,报错如下:DB2 SQL Error: SQLCODE=-290, SQLSTATE=55039, SQLERRMC=null,DRIVER=3.50.152消息:不允许访问表空间。
. SQLCODE=-290, SQLSTATE=55039, DRIVER=3.50.1522. 可查看DB2的表空间状态,确认状态后进行相应的处理解决$ db2 "list tablespace show detail"Tablespaces for Current DatabaseTablespace ID = 0Name = SYSCATSPACEType = System managed spaceContents = Any dataState = 0x0000Detailed explanation:NormalTotal pages = 2519Useable pages = 2519Used pages = 2519Free pages = Not applicableHigh water mark (pages) = Not applicablePage size (bytes) = 4096Extent size (pages) = 32Prefetch size (pages) = 32Number of containers = 1Tablespace ID = 1Name = TEMPSPACE1Type = System managed spaceContents = System Temporary dataState = 0x0000Detailed explanation:NormalTotal pages = 1Useable pages = 1Used pages = 1Free pages = Not applicableHigh water mark (pages) = Not applicablePage size (bytes) = 4096Extent size (pages) = 32Prefetch size (pages) = 32Number of containers = 1Tablespace ID = 2Name = USERSPACE1Type = System managed spaceContents = Any dataState = 0x0004 这个代码意义就是“停顿的独占”,正常状态为0x0000,非0就是有问题,都可以用下面方法解决。
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。
DB2错误码(续)SQL6010N下载的 QMF ⽂件带有 255 个以上的数据列。
SQL6011N不能处理列名称(第列号列)的数据类型号码(类型⽂本)。
SQL6012N对命令指定了太多参数。
SQL6013N主机⽂件名主机⽂件名太长,或未以字母字符开头。
SQL6014N⽆效命令语法,冒号(“:”)应跟随着关键字。
SQL6015N不识别关键字。
SQL6016NSystem/370 ⽂件名名称的操作数太多。
SQL6017NImport 消息记录名称中可能包含更多信息。
SQL6018N未指定 S/370 ⽂件名。
SQL6019N通信短会话标识标识太长或⽆效。
SQL6020N指定了导⼊选项,但未同时提供数据库名称。
SQL6021N数据导⼊成功。
SQL6022N系统数据库⽬录不被所有节点共享。
SQL6023N⽤户没有在表名称上运⾏“获取表分区信息”实⽤程序的权限。
SQL6024E未在节点节点号上定义表或索引名称。
SQL6025N不能将在节点节点-1 上备份的数据库复原到节点节点-2 上。
SQL6026N不能将⽬录节点为节点-1 的数据库复原到⽬录节点为节点-2 的数据库。
SQL6027N数据库⽬录路径路径⽆效。
SQL6028N因为在本地数据库⽬录中找不到数据库数据库名称,所以⽬录数据库失败。
SQL6030NSTART 或 STOP DATABASE MANAGER 失败。
原因码为原因码。
SQL6031N在 db2nodes.cfg ⽂件的第⾏号⾏上出错。
原因码为原因码。
SQL6032W在总数个节点上尝试了启动命令处理。
成功启动了已启动的数⽬个节点。
已启动了已启动的数⽬个节点。
未能启动未启动的数⽬个节点。
SQL6033W在总数个节点上尝试了停⽌命令处理。
成功停⽌了已停⽌的数⽬个节点。
已停⽌了已停⽌的数⽬个节点。
未能停⽌未停⽌的数⽬个节点。
SQL6034W节点节点未被任何数据库使⽤。
SQL6035W数据库数据库正使⽤数据库分区分区名称。