Ora-1406 Very Very Urgent!!
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 8 of 8

Thread: Ora-1406 Very Very Urgent!!

  1. #1
    Join Date
    Oct 2005
    Posts
    7

    Ora-1406 Very Very Urgent!!

    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
    Last edited by rohikesh; 04-07-2006 at 01:35 PM.

  2. #2
    Join Date
    Nov 2002
    Location
    Geneva Switzerland
    Posts
    3,142
    Why don't to post the code - or at least the cursor and the begining of the loop?
    "The power of instruction is seldom of much efficacy except in those happy dispositions where it is almost superfluous" - Gibbon, quoted by R.P.Feynman

  3. #3
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    Quote Originally Posted by rohikesh
    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
    Jeff Hunter
    marist89@yahoo.com
    http://marist89.blogspot.com/
    Get Firefox!
    "I pledge to stop eating sharks fin soup and will not do so under any circumstances."

  4. #4
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    4,021
    Quote Originally Posted by marist89
    Hmmmm
    Now Jeff, I hope you aren't suggesting that just because a column width was changed that it caused that procedure to break. 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???
    this space intentionally left blank

  5. #5
    Join Date
    Nov 2002
    Location
    Geneva Switzerland
    Posts
    3,142
    Well, he says he's using a "cursor for loop" - which types everything implicitly.
    "The power of instruction is seldom of much efficacy except in those happy dispositions where it is almost superfluous" - Gibbon, quoted by R.P.Feynman

  6. #6
    Join Date
    Oct 2005
    Posts
    7
    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..
    Last edited by rohikesh; 04-08-2006 at 06:51 AM.

  7. #7
    Join Date
    Nov 2002
    Location
    Geneva Switzerland
    Posts
    3,142
    Quote Originally Posted by DaPi
    Why don't to post the code - or at least the cursor and the begining of the loop?
    Can we see the rest?
    "The power of instruction is seldom of much efficacy except in those happy dispositions where it is almost superfluous" - Gibbon, quoted by R.P.Feynman

  8. #8
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    I was merely implying that if
    1. it worked before
    2. you changed something
    3. now it doesn't work

    your change broke it.
    Jeff Hunter
    marist89@yahoo.com
    http://marist89.blogspot.com/
    Get Firefox!
    "I pledge to stop eating sharks fin soup and will not do so under any circumstances."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width