Re: extracting substring of a character string in oracle V7

From: Michael P. Vergara <vergara_at_nosc.mil>
Date: Tue, 6 Sep 1994 15:21:48 GMT
Message-ID: <1994Sep6.152148.1253_at_nosc.mil>


In article <1994Sep3.090616.27239_at_frodo.cc.flinders.edu.au>, Matthew J Carr <carr_at_ist.flinders.edu.au> wrote:

[edited]

>I have the subject line currently at 200 characters
>
>Now when I concatenate the string all blank spaces are concatenated into the returned string. Is there as easy way in which only the filled portion of each column is
>fetched and copied into the string.
>
>I have tried substr(subject,1,length(subject)) but this does not seem to work
>
>Thanks,
> matt
>
>

What you did not say was how you defined the column. If it is defined as VARCHAR2(200), then this is wierd. If you have defined the column as CHAR(200), this definition will pad the field out to 200 characters with spaces, and would result in the operation you are seeing.

If your requirement is to use a CHAR(n) field, then try the LTRIM() or RTRIM() functions to remove spaces.

HTH

--
============================================================================
Mike Vergara           |   "Be good, and you will be lonesome
vergara_at_nosc.mil       |    Be lonesome, and you will be free..."
		       |                                       Jimmy Buffett
Received on Tue Sep 06 1994 - 17:21:48 CEST

Original text of this message