Unix Technical Forum

Need Help with SQL ERROR - 433

This is a discussion on Need Help with SQL ERROR - 433 within the DB2 forums, part of the Database Server Software category; --> Here is SQL_TEXT column in SQL_DATA TABLE: SQL_TEXT ------------------------------------------------------------------------ SELECT RC_L_NAME1, RC_L_NAME2, RC_L_STREET, SUBSTR(RC_L_CITYST,1,LENGTH(STRIP(RC_L_CITYST)) - 3), SUBSTR(RC_L_CITYST,LENGTH(STRIP(RC_L_CITYST)) - 2,3) ...


Go Back   Unix Technical Forum > Database Server Software > DB2

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-17-2008, 07:12 AM
lenygold via DBMonster.com
 
Posts: n/a
Default Need Help with SQL ERROR - 433

Here is SQL_TEXT column in SQL_DATA TABLE:
SQL_TEXT
------------------------------------------------------------------------

SELECT RC_L_NAME1,
RC_L_NAME2,
RC_L_STREET,
SUBSTR(RC_L_CITYST,1,LENGTH(STRIP(RC_L_CITYST)) - 3),
SUBSTR(RC_L_CITYST,LENGTH(STRIP(RC_L_CITYST)) - 2,3)
FROM VALEVSRC
WHERE RC_L_TIN > 000000000000
AND
RC_L_NAME1 = 'BANK OF AMERICA'
AND
RC_L_LEVYTYPE = 'A'
AND
ORDER BYRC_L_NAME2;

I am running the following query trying to parsing using recursion(&
delimiter):


WITH TEMP1(R, C1) AS
( SELECT ROW_NUMBER() OVER() R,STRIP(SQL_TEXT) FROM SQL_DATA),
TEMP2(R, C1) AS
(SELECT R , C1
From TEMP1
WHERE R = 1
UNION ALL
SELECT TEMP2.R + 1
,TEMP2.C1 || '&' || TEMP1.C1
FROM TEMP1, TEMP2
WHERE TEMP1.R = TEMP2.R + 1 )
SELECT C1
FROM TEMP2
WHERE R = (SELECT MAX(R) FROM TEMP2);

And i got an error:

sqlcode: -433

SQL0433N Value "SELECT RC_L_NAME1,&RC_L_NAME2,&RC_L_STREET,&SUBSTR
(RC_L_CITY " is too long.
Explanation:

The value "<value>" required truncation by a system (built-in) cast or
adjustment function, which was called to transform the value in some
way. The truncation is not allowed where this value is used.

How to fix this query. It is working in other cases?
Thank's in advance

--
Message posted via DBMonster.com
http://www.dbmonster.com/Uwe/Forums....m-db2/200803/1

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-17-2008, 07:12 AM
Serge Rielau
 
Posts: n/a
Default Re: Need Help with SQL ERROR - 433

lenygold via DBMonster.com wrote:
> Here is SQL_TEXT column in SQL_DATA TABLE:
> SQL_TEXT
> ------------------------------------------------------------------------
>
> SELECT RC_L_NAME1,
> RC_L_NAME2,
> RC_L_STREET,
> SUBSTR(RC_L_CITYST,1,LENGTH(STRIP(RC_L_CITYST)) - 3),
> SUBSTR(RC_L_CITYST,LENGTH(STRIP(RC_L_CITYST)) - 2,3)
> FROM VALEVSRC
> WHERE RC_L_TIN > 000000000000
> AND
> RC_L_NAME1 = 'BANK OF AMERICA'
> AND
> RC_L_LEVYTYPE = 'A'
> AND
> ORDER BYRC_L_NAME2;
>
> I am running the following query trying to parsing using recursion(&
> delimiter):
>
>
> WITH TEMP1(R, C1) AS
> ( SELECT ROW_NUMBER() OVER() R,STRIP(SQL_TEXT) FROM SQL_DATA),
> TEMP2(R, C1) AS
> (SELECT R , C1
> From TEMP1
> WHERE R = 1
> UNION ALL
> SELECT TEMP2.R + 1
> ,TEMP2.C1 || '&' || TEMP1.C1
> FROM TEMP1, TEMP2
> WHERE TEMP1.R = TEMP2.R + 1 )
> SELECT C1
> FROM TEMP2
> WHERE R = (SELECT MAX(R) FROM TEMP2);
>
> And i got an error:
>
> sqlcode: -433
>
> SQL0433N Value "SELECT RC_L_NAME1,&RC_L_NAME2,&RC_L_STREET,&SUBSTR
> (RC_L_CITY " is too long.
> Explanation:
>
> The value "<value>" required truncation by a system (built-in) cast or
> adjustment function, which was called to transform the value in some
> way. The truncation is not allowed where this value is used.
>
> How to fix this query. It is working in other cases?
> Thank's in advance
>

The recursion seed determines the length. So you need to add some padding.

SELECT R , CAST(C1 AS VARCHAR(<somebigger number>)) FROM


--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-17-2008, 07:12 AM
lenygold via DBMonster.com
 
Posts: n/a
Default Re: Need Help with SQL ERROR - 433

Thank You Serge it is working.

Serge Rielau wrote:
>> Here is SQL_TEXT column in SQL_DATA TABLE:
>> SQL_TEXT

>[quoted text clipped - 46 lines]
>> How to fix this query. It is working in other cases?
>> Thank's in advance

>
>The recursion seed determines the length. So you need to add some padding.
>
>SELECT R , CAST(C1 AS VARCHAR(<somebigger number>)) FROM
>


--
Message posted via http://www.dbmonster.com

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:55 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com