sql - DB2 declared temporary table varchar returns error -443 -
i'm trying query db2 , declare temporary table this
declare global temporary table session.results (code_statement varchar, count_statement integer) replace on commit preserve rows not logged; delete session.results;
i insert table multiple statements one
insert session.results(code_statement, count_statement) values ('ta full join tb', (select count(*) count_statement tablea full join tableb b on a.key = b.key));
the problem when of insertions (no matter if use full join
or other) , use >= 21 characters varchar
value, sql returns [error code: -433, sql state: 22001] db2 sql error: sqlcode=-433, sqlstate=22001, sqlerrmc=<text>, driver=3.50.152
i've tested , i'm 100% sure problem. whenever insert 21+ characters in string, crashes.
i've tried use varchar(50)
, varchar(400)
, char(50)
, not solved.
i've checked docs , googled hours , haven't found solution.
thanks in advance.
update: have no idea how working expected. requires set size varchar, , accepts bigger strings. point have no idea happened , why it's solved. kept playing around , split declare
multiple lines. changed "max chars
" in dbvis (from -1 100) have set , it's still working.
it makes no sense me. i'll keep question opened since don't know solved issue.
db2 requires specify integer value size varchar. otherwise db2 should throw sqlcode -604 exception. need size column appropriately, taking account character encoding if using utf-8. if have reproducible, portable, scenario shows -433 (value long) exception when using valid syntax , values update question.
Comments
Post a Comment