Home » SQL & PL/SQL » SQL & PL/SQL » how to null value replace' !'
how to null value replace' !' [message #251004] Thu, 12 July 2007 03:05 Go to next message
pavuluri
Messages: 247
Registered: January 2007
Senior Member

i have table like

empno
1
2

3
4

i want to 

empno
1
2
!
3
4


Re: how to null value replace' !' [message #251006 is a reply to message #251004] Thu, 12 July 2007 03:08 Go to previous messageGo to next message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
look at the nvl and to_char functions in the documentation

[Updated on: Thu, 12 July 2007 03:09]

Report message to a moderator

Re: how to null value replace' !' [message #251027 is a reply to message #251006] Thu, 12 July 2007 03:56 Go to previous messageGo to next message
pavuluri
Messages: 247
Registered: January 2007
Senior Member
hello

empno datatype is number

how to replace '!'

thanks
srinivas
Re: how to null value replace' !' [message #251031 is a reply to message #251006] Thu, 12 July 2007 04:13 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
pablolee wrote on Thu, 12 July 2007 10:08
look at the nvl and to_char functions in the documentation


Exclamation

MHE
Re: how to null value replace' !' [message #251044 is a reply to message #251027] Thu, 12 July 2007 04:51 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
pavuluri wrote on Thu, 12 July 2007 04:56

empno datatype is number

how to replace '!'


Do you want to replace the NULL values in the column with '!' or is this for a report? If you want to update the column values, you'll need to change the datatype of the column.
Re: how to null value replace' !' [message #251069 is a reply to message #251044] Thu, 12 July 2007 06:24 Go to previous messageGo to next message
misragopal
Messages: 125
Registered: June 2005
Location: New Delhi, india
Senior Member

SELECT NVL(to_char(col1),'!') FROM table1
Re: how to null value replace' !' [message #251071 is a reply to message #251069] Thu, 12 July 2007 06:27 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
At least, you, you can read what other posted. Wink

Regards
Michel
Re: how to null value replace' !' [message #251169 is a reply to message #251004] Thu, 12 July 2007 10:21 Go to previous message
Bill B
Messages: 1482
Registered: December 2004
Senior Member
Another nice trick if you are using sql*plus is to use the

set null !

command. It will replace any null columns with the space (or quote) delimited string that follows

whb@xe>create table t (junk varchar2(1));

Table created.

whb@xe>insert into t values(null);

1 row created.

whb@xe>insert into t values('X');

1 row created.

whb@xe>select * from t;

J
-

X

whb@xe>set null !
whb@xe>select * from t;

J
-
!
X
Previous Topic: delete without logging
Next Topic: need help in using cursors
Goto Forum:
  


Current Time: Sat Dec 03 11:44:47 CST 2016

Total time taken to generate the page: 0.06641 seconds