SQL oracle 9i question

kidrobot

Registered User.
Local time
Yesterday, 20:27
Joined
Apr 16, 2007
Messages
409
im using oracle 9i. when i first made my table I put in "NULL" for my null values, but my friend told me I need to use '' if they are null. so how can update all the records in a table to '' where = 'Null" ?? please tell me if I'm not clear.
 
You can use both entries : '' and or Null.
However when retrieving data, you'll have to use Null. The '' won't give you any data.

e.g.
select * from suppliers
where supplier_name = '';

will give no records , but :

select * from suppliers
where supplier_name is null;
will give all records with empty strings or null values.

Hth
 
i used this query (with my table and column names)

select * from suppliers
where supplier_name is null;

but it won't run on the tables that I inserted "NULL" into. So, is there a way to update all the rows in my table where they say NULL and change them to '' ?
 
nvmd im just going to do it one at a time

UPDATE employee
SET phone = ''
Where empID = 400002
 
kidrobot,

When you did your Update, did you say

supplier_name = "NULL"
OR
supplier_name = NULL

These will be interpreted differently by Oracle. The first is a string with the value "NULL" and the second is a null string ("").
 

Users who are viewing this thread

Back
Top Bottom