DB2 SQL error: SQLCODE: -270, SQLSTATE: 42997, SQLERRMC: 63

DB2 SQL error: SQLCODE: -270, SQLSTATE: 42997, SQLERRMC: 63

Post by xix » Sat, 07 Jun 2003 07:10:55



i am using db2 v8.1 on NT, with db2jcc driver

i try to retrieve text column with create view statement

sqlStr = "select text from syscat.views  WHERE viewname='ATWAWL03'";

resultSet = statement.executeQuery(sqlStr);

but have the error

DB2 SQL error: SQLCODE: -270, SQLSTATE: 42997, SQLERRMC: 63

what is the problem? please help.

 
 
 

DB2 SQL error: SQLCODE: -270, SQLSTATE: 42997, SQLERRMC: 63

Post by Knut Stolz » Sat, 07 Jun 2003 16:10:45


xixi wrote on Friday 06 June 2003 00:10:

Quote:> i am using db2 v8.1 on NT, with db2jcc driver

> i try to retrieve text column with create view statement

> sqlStr = "select text from syscat.views  WHERE viewname='ATWAWL03'";

> resultSet = statement.executeQuery(sqlStr);

> but have the error

> DB2 SQL error: SQLCODE: -270, SQLSTATE: 42997, SQLERRMC: 63

> what is the problem? please help.

SQLCODE -270 correpsonds to the error message SQL0270.  And that one says:

    SQL0270N Function not supported (Reason code = "<rc>").

So you have to look at SQLERRMC to get the token (reason code).  Reason code
63 says:

     63 A column with a LOB type, distinct type on a LOB type, or
    structured type cannot be specified in the select-list of an
    insensitive scrollable cursor.

The user response suggests that you should not include a LOB column in the
select clause.  But that is obviously not an option for you.  So you could
altenatively change your environment to not use a scrollable cursor for this
query.

p.s: You can also get a short help for SQLSTATE 42997 by simply typing:

    db2 "? 42997"

--
Knut Stolze
Information Integration
IBM Germany / University of Jena

 
 
 

1. com.ibm.db2.jcc.c.SQLException: DB2 SQL error: SQLCODE: -302, SQLSTATE: 22001, SQLERRMC:

hi, we are using db2 v8.1 fixpack 2 on NT. i have create a database
with code set UTF-8, when i try to copy the table from AS400 to DB2, i
got the error
com.ibm.db2.jcc.c.SQLException: DB2 SQL error: SQLCODE: -302,
SQLSTATE: 22001, SQLERRMC:

the table on AS400 contains Japanese data, i try to create the table
to store Japanese data on DB2.

But if i change the length of each field to 4 times of the original
length, i can pass and generate the table with data.

Since now on DB2 the length stored in sysibm.syscolomuns is 4 times of
the actual length, so i have to divide this length by 4 to get the
actual length of each field. But the problem is some of the fields is
substring of another field, e.g. apkey on AS400 is 8 length now, after
copy the table to DB2, it becomes 32 bytes long. i have key2
substr(apkey,1,6), then key2's actual length stored in
sysibm.syscolomuns, so looks like some of the fields are 4 times of
original field, some are the actual length. that causes my program
problem , because i assumes all the fiels definition must divide by 4
to get the right length .

i don't understand why i need to 4 times length, because as i see all
the value occupy one byte for up to 8 if the length is 8 bytes, if i
times 4 , that would be 32 length, so the rest 24 byte are space.
please help. thanks

2. Best design

3. Wrong values in sqlca.sqlcode, SQLCODE, and SQLSTATE

4. Need Help with Statement

5. Error -270 when having extra condition in where clause

6. Data Reports

7. How to trap MS SQL Server SQLCode and SQLState for exception handling

8. PxErr 13 PXERR_XSORTVERSION from Paradox Engine 3.0

9. Accessing SQLCODE,SQLSTATE in trigger SQL/PL ?

10. need 2 columns but table has 270

11. Retrieving SQLState or SQLCode

12. ct_diag and ct_con_pros to retreive SQLCA, SQLCODE, SQLSTATE

13. ifx_connect : E [SQLSTATE=IX 001 SQLCODE=-1829]+client win+server iif2000 on sun