Hello,
I am having two tables, 1st has just one column with 80 bytes and the 2nd table has many columns. I use substr function to get the specific value from the first table and insert it into the second table using PL/SQL. My problem here is, in the first table I might have blanks for some values which I have to insert into the second table fields defined as Number data type. Oracle treats blanks as a string and when i try to insert i get the following error:
ORA-06502: PL/SQL: numeric or value error: character to number conversion error
I tried to use DECODE but I cannot in the PL/SQL assignment statement. gives me the following error:
PLS-00204: function or pseudo-column 'DECODE' may be used inside a SQL statement only
I cannot write select statements as I have many fields defined as number type. Is there any other alternative which i can use to check if the incoming value is blanks then replace it with 0?
Any advise is welcome.
Thanks,
Nabh4u.
I am having two tables, 1st has just one column with 80 bytes and the 2nd table has many columns. I use substr function to get the specific value from the first table and insert it into the second table using PL/SQL. My problem here is, in the first table I might have blanks for some values which I have to insert into the second table fields defined as Number data type. Oracle treats blanks as a string and when i try to insert i get the following error:
ORA-06502: PL/SQL: numeric or value error: character to number conversion error
I tried to use DECODE but I cannot in the PL/SQL assignment statement. gives me the following error:
PLS-00204: function or pseudo-column 'DECODE' may be used inside a SQL statement only
I cannot write select statements as I have many fields defined as number type. Is there any other alternative which i can use to check if the incoming value is blanks then replace it with 0?
Any advise is welcome.
Thanks,
Nabh4u.
Comment