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

Home -> Community -> Mailing Lists -> Oracle-L -> Work around for PL/SQL code

Work around for PL/SQL code

From: Rangachari Sundar <sundar_at_focusite.com>
Date: Fri, 29 Jun 2001 05:54:29 -0700
Message-ID: <F001.0033D5FB.20010629060626@fatcity.com>

Hi,

Let me introduce myself. I am Rangachari Sundar from Chennai India. I have the workaround for the
requirement you have posted and here it is

vPOSTAL_NO := lpad(replace(trim(recCursor.POSTAL_NO), ' ', ''), 7, '0') ;

Trim is not available prior to oracle 8 so if your version is prior to 8 you can change that to
LTRIM(RTRIM(recCursor.POSTAL_NO))

Bye
Sundar

Roland.Skoldblom_at_ica.se wrote:

> How can I change this pl/sql code. I want this to happen:
>
> I have for instance this
>
> blank 5 5 blank 55 which means 55 55 (the spaces
>ar ethe blanks.)
>
> and I want it to be like this:
>
> 005555
>
> How can I change this code to let this happen:
>
> vPOSTAL_NO:= lpad(nvl(recCursor.POSTAL_NO,'0'),7,'0');
>
> Thanks to all who canhelp me.
>
> Roland Sköldblom
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author:
> INET: Roland.Skoldblom_at_ica.se
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Rangachari Sundar
  INET: sundar_at_focusite.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Fri Jun 29 2001 - 07:54:29 CDT

Original text of this message

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