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:PL/SQL-if-statement

Re:PL/SQL-if-statement

From: <dgoulet_at_vicr.com>
Date: Thu, 19 Apr 2001 09:51:11 -0700
Message-ID: <F001.002ECDD2.20010419090523@fatcity.com>

Roland,

    Staying with the KISS principle, try:

vOWNER_NO := nvl(to_char(recCursor.OWNER_NO),'000000');

Dick Goulet

____________________Reply Separator____________________
Author: Roland.Skoldblom_at_ica.se
Date:       4/19/2001 6:56 AM

How can I change this pl/sql code, in the while-statement maybe so that if the field OWNER_NO is NULL, then it should be written six characters? The code looks like
this:

"IF recCursor.OWNER_NO is null then
vOWNER_NO := '000000';
else
v_OWNER_NO:= to_char(recCursor.OWNER_NO); WHILE length(vOWNER_NO) < 6 LOOP
vOWNER_NO '0'0' || vOWNER_NO;
END LOOP;
END IF; How shoud I write to fix this script so therw will be written out 6 characters if the field OWNER_NO is empty. I want to use the WHILE LOOP. Any one whom can help me with this?

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: INET: dgoulet_at_vicr.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 Thu Apr 19 2001 - 11:51:11 CDT

Original text of this message

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