Author |
Topic |
ceema
Yak Posting Veteran
80 Posts |
Posted - 2006-11-27 : 07:17:42
|
Hello all, By mistake one of my sql table field got filled with Question mark. Like Student is my table name and it's having two fields regno & nameStudent-------RegNo Name101 abc102 efg104 ??105 ?106 ???107 hijNow I want to replace the name field with ? with a null value likeStudent-------RegNo Name101 abc102 efg104 105 106 107 hijI have tried the following statement, but of no use. Please helpupdate student set sarabicname='' where sarabicname=' %+? + % 'ThanksCeema |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2006-11-27 : 07:20:57
|
[code]update student set sarabicname='' where sarabicname='?%'[/code]Harsh AthalyeIndia."Nothing is Impossible" |
|
|
ceema
Yak Posting Veteran
80 Posts |
Posted - 2006-11-27 : 07:28:13
|
No Harsh, No, that I tried already, but of no use. Anyother way?Ceemaquote: Originally posted by harsh_athalye
update student set sarabicname='' where sarabicname='?%' Harsh AthalyeIndia."Nothing is Impossible"
|
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-11-27 : 07:31:18
|
What is the datatype of name?Try this update student set sarabicname=Replace(sarabicname,'?','')MadhivananFailing to plan is Planning to fail |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-11-27 : 07:35:52
|
I think Harsh meant LIKE, not equal toupdate student set sarabicname = '' where sarabicname like '?%' Peter LarssonHelsingborg, Sweden |
|
|
ceema
Yak Posting Veteran
80 Posts |
Posted - 2006-11-27 : 07:38:48
|
Hello, Yesss, now it's working with like, thank you both of you.Thanks againCeemaquote: Originally posted by Peso I think Harsh meant LIKE, not equal toupdate student set sarabicname = '' where sarabicname like '?%' Peter LarssonHelsingborg, Sweden
|
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2006-11-27 : 07:39:01
|
quote: I think Harsh meant LIKE, not equal to
Damn, Copy-Paste again!!Yeah, that's what I meant..Thanks peter.Harsh AthalyeIndia."Nothing is Impossible" |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-11-27 : 07:40:55
|
What do you want to do if name has 'test????' ?MadhivananFailing to plan is Planning to fail |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-11-27 : 07:46:25
|
Question mark anywhereupdate student set sarabicname = '' where sarabicname like '%?%'Only question markupdate student set sarabicname = '' where sarabicname not like '%[^?]%'Peter LarssonHelsingborg, Sweden |
|
|
|