Click to See Complete Forum and Search --> : Ora-1406 Very Very Urgent!!


rohikesh
04-07-2006, 01:31 PM
Hi All,
I need ur help again and the need is very very urgent. Iam using Oracle 9i and my issue with Oracle is as below..

I had written a procedure sometime back wherin I first declare a cursor then use "cursor for loop" to insert the fetched rows to a table. The procedure was working well all this time in production but suddenly from past two days I have been facing the error ORA-1406 FETCHED COLUMN VALUE WAS TRUNCATED. Could anyone please help me on this issue.
Further, I checked the problem by writing some log statements in the procedure. I could see that, the control passed into the loop and executed the first loop, made an insert in the tble and then failed with the error at the beginning of the second loop before the loop could actually start.
The only most recent change I have done is that I have changed the feild width and variable type( from number(5,0) to varchar2(20)) in the source table(From clause of CURSOR SELECT query) in my instance. Could this be a reason for this error?

Please let me know. Thanks in advance

DaPi
04-07-2006, 01:55 PM
Why don't to post the code - or at least the cursor and the begining of the loop?

marist89
04-07-2006, 03:55 PM
The only most recent change I have done is that I have changed the feild width and variable type( from number(5,0) to varchar2(20)) in the source table(From clause of CURSOR SELECT query) in my instance. Could this be a reason for this error?

Hmmmm

gandolf989
04-07-2006, 04:48 PM
Hmmmm

Now Jeff, I hope you aren't suggesting that just because a column width was changed that it caused that procedure to break. :rolleyes: Its not like he hard coded his cursor variables to be specific types and then used an explicit cursor to select into them, or did he??? :D

DaPi
04-08-2006, 03:57 AM
Well, he says he's using a "cursor for loop" - which types everything implicitly.

rohikesh
04-08-2006, 06:11 AM
Hi All,
I tried running the code with settings as below...

Old Cursor used ..
cursor c1 is
select x from tab1;

old source table field width..
x varchar2(8);

new source table field width after the change..
x varchar2(20);

To run the code I did the following..
New Cursor Change
cursor c1 is
select substr(x,1,20) from tab1;

If I run the code with the above change in cursor it works successfully without 1406 error.

Could anyone tell me what might be the cause??

Thanks in advance..

DaPi
04-08-2006, 07:22 PM
Why don't to post the code - or at least the cursor and the begining of the loop? Can we see the rest?

marist89
04-10-2006, 12:26 PM
I was merely implying that if
1. it worked before
2. you changed something
3. now it doesn't work

your change broke it.