Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: how do I concatenate a string in PL/SQL?

RE: how do I concatenate a string in PL/SQL?

From: Roger Xu <roger_xu_at_dp7uptx.com>
Date: Wed, 8 Feb 2006 16:55:09 -0600
Message-ID: <A6801E8A03316A4DA597866F77A013F7095E685F@irv2kexch01.tx.bg.corp>


SQL> !cat /tmp/abc.sql
set serveroutput on
set verify off

declare

 a_strng CHAR(50);
 a_ATWRT CHAR(30);

begin

  a_ATWRT := 'World';
  a_strng := 'Hello';
  a_strng := a_ATWRT || a_strng;

  dbms_output.put_line ( a_strng);

end;

/

set verify on

SQL> @/tmp/abc
declare
*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error ORA-06512: at line 10

SQL> -----Original Message-----
From: Pat Hildebrand [mailto:pat_at_sas.upenn.edu] Sent: Wednesday, February 08, 2006 4:28 PM To: Roger Xu
Cc: Jared Still; Oracle-L_at_Freelists. Org (E-mail) Subject: Re: how do I concatenate a string in PL/SQL?

I common cause of the error that you are getting for strings is that you are trying to put in a value that is too long for the variable. Look at your variable definition and what you are trying to put into it.

                     Pat


On Wed, Feb 08, 2006 at 05:01:16PM EST, Roger Xu <roger_xu_at_dp7uptx.com> wrote:
> Nothing wrong with the cursor, the only problem is: "a_strng := a_ATWRT || a_strng;"
>
> ORA-06502: PL/SQL: numeric or value error
> ORA-06512: at line 97
>

For technical support please email tech_support_at_dp7uptx.com or you can call (972)721-8257.
This email has been scanned for all viruses by the MessageLabs Email Security System.

This e-mail is intended solely for the person or entity to which it is addressed and may contain confidential and/or privileged information. Any review, dissemination, copying, printing or other use of this e-mail by persons or entities other than the addressee is prohibited. If you have received this e-mail in error, please contact the sender immediately and delete the material.



This email has been scanned for all viruses by the MessageLabs Email Security System. Any questions please call 972-721-8257 or email your request to tech_support_at_dp7uptx.com.
--
http://www.freelists.org/webpage/oracle-l
Received on Wed Feb 08 2006 - 16:55:09 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US