Home » RDBMS Server » Server Administration » overflow when concatenating strings
overflow when concatenating strings [message #371995] Tue, 02 January 2001 05:27 Go to next message
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
Re: overflow when concatenating strings [message #371999 is a reply to message #371995] Tue, 02 January 2001 18:28 Go to previous message
Vince
Messages: 11
Registered: December 2000
Junior Member
Hi,

I think at Line 24, you are appending to vognliste and i guess the size of vognliste may increase more than 2000 when you append with j.fabrikat.

Hope it helps!!!

Vince.
Previous Topic: duplicate records
Next Topic: I am looking for a sql application to download
Goto Forum:
  


Current Time: Thu May 16 20:42:33 CDT 2024