当前位置 : 首页 » 互动问答 » 正文

SqlException: DB2 SQL error: SQLCODE: -302, SQLSTATE: 22001, SQLERRMC: null

分类 : 互动问答 | 发布时间 : 2012-03-09 05:36:59 | 评论 : 3 | 浏览 : 223214 | 喜欢 : 19

What does sqlcode -302 means? Where do i get the sqlcode definitions?

Please advice

Thanks,

回答(3)

  • 1楼
  • You can find the codes in the DB2 Information Center. Here's a definition of the -302 from the z/OS Information Center:

    THE VALUE OF INPUT VARIABLE OR PARAMETER NUMBER position-number IS INVALID OR TOO LARGE FOR THE TARGET COLUMN OR THE TARGET VALUE

    On Linux/Unix/Windows DB2, you'll look under SQL Messages to find your error message. If the code is positive, you'll look for SQLxxxxW, if it's negative, you'll look for SQLxxxxN, where xxxx is the code you're looking up.

  • 2楼
  • To get the definition of the SQL codes, the easiest way is to use db2 cli!

    at the unix or dos command prompt, just type

    db2 ? SQL302
    

    this will give you the required explanation of the particular SQL code that you normally see in the java exception or your db2 sql output :)

    hope this helped.

  • 3楼
  • As a general point when using a search engine to search for SQL codes make sure you put the sqlcode e.g. -302 in quote marks - like "-302" otherwise the search engine will exclude all search results including the text 302, since the - sign is used to exclude results.

相关阅读:

How to view DB2 Table structure

SqlException: DB2 SQL error: SQLCODE: -302, SQLSTATE: 22001, SQLERRMC: null

DB2 Query to retrieve all table names for a given schema

show all tables in DB2 using the LIST command

DB2 SQL错误:SQLCODE:-206,SQLSTATE:42703

DB2和Oracle Perspective中CLOB和BLOB的区别?

将字符串转换为DB2中的日期

DB2日期格式

在同一数据库DB2中创建表的副本

如何在字符串中找到子字符串(或如何grep变量)?