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

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL - PL/SQL Question. Please Help!!

Re: SQL - PL/SQL Question. Please Help!!

From: Jonathan Gennick <jonathan_at_gennick.com>
Date: Wed, 16 Jun 1999 16:35:10 GMT
Message-ID: <376acabe.7734561@netnews.worldnet.att.net>


On Tue, 15 Jun 1999 16:28:11 -0700, "George Gifford" <georgegifford@~usa~.net <--- ANIT-SPAM (Remove ~)> wrote:

>Does anyone have any suggestions or pl/sql code that will accept a tablename
>and then update/replace ALL Null Numeric fields with a 0, and all Null
>VarChar2 Fields with a space (' ')??

Here is a SQL statement that should work for you:

	UPDATE TABLEX
	SET NUMFIELD = NVL(NUMFIELD,0),
	        CHARFIELD = NVL(CHARFIELD,' ');

Make sure that you do change your varchar2 field to one space. Oracle will interpret '' as null, but ' ' is one space and is not null.

regards,

Jonathan



jonathan_at_gennick.com
http://gennick.com
Brighten the Corner Where You Are Received on Wed Jun 16 1999 - 11:35:10 CDT

Original text of this message

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