Title: RE: PL/SQL-if-statement

The whole lot can be replaced by

v_OWNER_NO := ltrim(to_char(nvl(recCursor.OWNER_NO,0),'000000'));

Regards

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 19 April 2001 15:56
To: Multiple recipients of list ORACLE-L
Subject: PL/SQL-if-statement


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: [EMAIL PROTECTED]

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: [EMAIL PROTECTED] (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).
++++++++++++++++++++++++++++++++++++
All internet traffic to this site is
automatically scanned for viruses
and vandals.
++++++++++++++++++++++++++++++++++++

Reply via email to