Home » Developer & Programmer » Forms » update a column having no value
update a column having no value [message #169473] Thu, 27 April 2006 01:21 Go to next message
surbhigarg
Messages: 11
Registered: January 2006
Junior Member
hi all

can any one help me.
i have a small problem.

i want to update a row in a table whose two columns are empty.
can i update the table by using those fields.

eg:

empno empname addr1 addr2
1 ff hh hhh
2 hh
3 hd lj kjlj

i know i can update my table by empno or empname but can we update table by using addr1 and addr2.

its very urgent.

Thanks,
Surbhi
Re: update a column having no value [message #169475 is a reply to message #169473] Thu, 27 April 2006 01:35 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Yes, but remember that if will update ALL rows that have both columns empty.
update tbl
  set addr1 = 'empty addr1',
      addr2 = 'empty addr2'
where addr1 is null
  and addr2 is null;

I don't like doing it this way, but it is possible. You could also update each field in a separate 'update' statement where you 'set' only one field and only test that one field in the 'where' clause.

David
Re: update a column having no value [message #169478 is a reply to message #169475] Thu, 27 April 2006 02:05 Go to previous message
surbhigarg
Messages: 11
Registered: January 2006
Junior Member
Thanks for the help.
It worked well.

Surbhi
Previous Topic: when-validate-record fires when post-query fires
Next Topic: validate from list in LOV
Goto Forum:
  


Current Time: Fri Sep 20 09:53:36 CDT 2024