If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Sybase > update where I find null values

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-28-11, 11:59
eldeleon eldeleon is offline
Registered User
 
Join Date: Jun 2011
Posts: 17
[solved]update where I find null values

Hello

I am trying to mask data on a table, this table has 15 columns but no in all the columns has information, what I am trying to do its update the information if its no null but I haven have success, what I am trying its the follow (obiusly doesnt work).

DECLARE @i VARCHAR(15)
DECLARE @j VARCHAR(15)

SET @j = 'test'
SET @i = ''

UPDATE nodir
SET rfc = @i
WHERE isnull(name,SET @i = @j)

can you help me with this?

Regards

Last edited by eldeleon; 06-29-11 at 14:06. Reason: solved
Reply With Quote
  #2 (permalink)  
Old 06-28-11, 17:44
mike_bike_kite mike_bike_kite is offline
vaguely human
 
Join Date: Jun 2007
Location: London
Posts: 2,519
I don't understand your question - perhaps you should give some examples of what you want updated.
__________________
Mike
Reply With Quote
  #3 (permalink)  
Old 06-29-11, 04:48
Martijnvs Martijnvs is offline
Registered User
 
Join Date: Jan 2004
Location: The Hague/Utrecht, NL
Posts: 415
It's not by any chance as simple as this?
update <tablename>
set <columnname> = <value<
where <columnname> is null
__________________
I'm not crazy, I'm an aeroplane!
Reply With Quote
  #4 (permalink)  
Old 06-29-11, 14:05
eldeleon eldeleon is offline
Registered User
 
Join Date: Jun 2011
Posts: 17
Actually I finally resolved like this.

UPDATE nodir SET
CASE WHEN rfc = NULL THEN 0 ELSE 1 END 'test',


thank you
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On