overflow when concatenating strings [message #371995] |
Tue, 02 January 2001 05:27 |
lhj
Messages: 5 Registered: November 2000
|
Junior Member |
|
|
Happy newyear
I resieve the failure: " numeric or value error
ORA-06512: at line 32" when concatenating strings
Here is the description of the tables involved
SQLWKS> desc p1test
Kolonnenavn Null? Type
------------------------------ -------- ----
ITEMNUMBER VARCHAR2(20)
VOGN VARCHAR2(2000)
desc personbiltable_start
Kolonnenavn Null? Type
------------------------------ -------- ----
ITEMNUMBER VARCHAR2(20)
KATEGORI VARCHAR2(20)
TYPENUMMER NUMBER(32,16)
LFDNR NUMBER
VOGNLISTETYPE VARCHAR2(10)
FABRIKAT VARCHAR2(20)
MODEL VARCHAR2(50)
MOTORTYPE VARCHAR2(50)
TYPEBETEGN VARCHAR2(30)
FRADATO DATE
TILDATO DATE
SQLWKS> DECLARE
2>
3> CURSOR C1 IS select distinct itemnumber
4> from personbiltable_START ;
5>
6> CURSOR TAB2(NUM varchar2) IS
7> SELECT itemnumber, fabrikat
8> from personbiltable_START
9> where itemnumber in ( select altvarenr from p1_boschstarter)
10> order by itemnumber;
11>
12> vognliste varchar2(2000);
13> antal integer;
14>
15> BEGIN
16>
17> FOR i IN C1 LOOP
18>
19> vognliste := '';
20>
21> FOR j IN tab2(i.itemnumber) LOOP
22>
23>
24> vognliste:= vognliste || j.fabrikat || ', ';
25>
26>
28> END LOOP;
29>
30> vognliste := SUBSTR(vognliste,1,length(vognliste) - 1);
31>
32> insert into p1test values(i.itemnumber, vognliste);*********fails*******
33>
34>
35>
36> END LOOP;
37> commit;
38>
39> END;
40> /
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at line 32
|
|
|
|