Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

string concatenation

808570Oct 28 2010 — edited Oct 29 2010
how to concatenate two strings in plsql
i have varchar2 column in my table
in my plsql code i want all values in that column into one variable when loop runs..
i use cursors
declare
i varchar2(4000):='0';
cursor c1
is
(select * from gl_je_lines
where period_name='Mar-10'
and reference_10='WRITEOFF');
begin
for cur_record in c1
loop
i:=cur_record.reference_2 + ',' + i;
dbms_output.put_line(i);
end loop;
end;
/

i got error like
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: character to number conversion error
ORA-06512: at line 11
please tell me what is the problem in this code
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 26 2010
Added on Oct 28 2010
5 comments
4,567 views