Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
8022421
Starting Member
45 Posts |
Posted - 2009-02-24 : 13:40:19
|
| Hi,I have a table with a column named cancel_reason. The column is valued as empty for a particular policy. I have another column called transltor_data in the same table. The update script for the same is shown below.UPDATE MYTABLESET translator_data = CANCEL_REASON + '01'WHERE POLICY_NUMBER = '324'When do the above update the value I expect is 01. But the output I am getting is empty. Is there any reason for this..Or is there any thing wrong that I am doing here..Please advise. |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2009-02-24 : 13:45:16
|
| what are datatype for columns? |
 |
|
|
8022421
Starting Member
45 Posts |
Posted - 2009-02-24 : 13:46:49
|
| CANCEL_REASON - CHAR(02)TRANSALATOR_DATA - CHAR(04) |
 |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2009-02-24 : 13:59:52
|
| what about Policy_Number? |
 |
|
|
8022421
Starting Member
45 Posts |
Posted - 2009-02-24 : 14:09:47
|
| CHAR(03) |
 |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2009-02-24 : 14:13:56
|
| [code]UPDATE MYTABLESET translator_data = Coalesce(NULLIF(CANCEL_REASON,''),'01')WHERE POLICY_NUMBER = '324'[/code] |
 |
|
|
|
|
|