DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: Which line of code gives the error

  1. #1
    Join Date
    Nov 2002
    Posts
    25

    Which line of code gives the error

    I've got a problem thats driving me nuts. I've got a procedure thats failing with the following error:

    declare
    *
    ERROR at line 1:
    ORA-01861: literal does not match format string
    ORA-06512: at line 83


    Line no 83 of my code is the end of the following cursor:

    for r_mpan in c_mpan loop
    concat_mpan := r_mpan.mpan_rec||r_mpan.mpan_ref1||r_mpan.mpan_ref2||r_mpan.mpan_ref3;
    Insert into esales.mpan (mpan_id)
    values (concat_mpan); <<<<----------- LINE 83

    My question is - is it this loop thats causing the problem or is the error caused by the next loop? I'm 99.99% sure this loop is OK - the concat_mpan variable is a VARCHAR2(13) and all the rows returned by the cursor are 13 characters long.

    Any help would be appreciated as I'm about to tear my hair out!!!

  2. #2
    Join Date
    Jan 2002
    Location
    Up s**t creek
    Posts
    1,525
    Are all the columns you are concatinating VARCHAR or CHAR fields? Also what are the sizes attributed to the columns?

    Regards
    Jim
    Oracle Certified Professional
    "Build your reputation by helping other people build theirs."

    "Sarcasm may be the lowest form of wit but its still funny"

    Click HERE to vist my website!

  3. #3
    Join Date
    Nov 2002
    Posts
    25
    the four columns are varchar2(10)'s but when concatenated they are only 13 characters long. Also the column in the insert statement is a VARCHAR2(13). I've tried changing all the VARCHAR2(13)'s to VARCHAR2(40)'s but am getting the same error.

  4. #4
    Join Date
    Apr 2001
    Location
    Czechia
    Posts
    712
    This error is related to conversion functions.
    In case you use to_date or to_number functions with format string somewhere around line 83, focus on it.
    Ales
    The whole difference between a little boy and an adult man is the price of toys

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