Domanda

In function I have got ORA-06502 error on this line:

newlist := LTRIM(RTRIM(newlist)) + ',';

CREATE OR REPLACE FUNCTION String_To_Int_Table
(
         list VARCHAR2
       , delimiter NCHAR DEFAULT ',' 
)
RETURN t_nested_table
AS

   value VARCHAR(11);
   position INT;
   newlist varchar2(4096);
   tableList t_nested_table;
...
newlist := list;
newlist := LTRIM(RTRIM(newlist)) + ',';

I don't see any conversion problem here. /totally confused/

È stato utile?

Soluzione

the string concatenation operator in oracle is ||, not +.

The bytecode compiler tries to auto-convert the varchar2 operands of the sum to numbers and predictably fails.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top