Click to See Complete Forum and Search --> : Which line of code gives the error


cleggfr
01-23-2003, 09:06 AM
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!!!

jovery
01-23-2003, 09:18 AM
Are all the columns you are concatinating VARCHAR or CHAR fields? Also what are the sizes attributed to the columns?

Regards

cleggfr
01-23-2003, 09:25 AM
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.

ales
01-23-2003, 09:42 AM
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.