SQL where clause is correct or not in oracle?
Is the following where clause correct or not in Oracle? because it is not updating the table value:
update tableOne set Id_num=1 where name=开发者_StackOverflow中文版'shweta';
It is correct. Are you getting any errors? Can you do a select for the same where clause?
SELECT * FROM tableOne WHERE NAME='shweta';
Syntax is correct. But Oracle is case sensitive perhaps you have to use
update tableOne set Id_num=1 where upper(name)='SHWETA';
And if you are verifing your update by a second application, don't forget to use the
COMMIT;
Are the other rows possibly blank padded? If they are, you wouldn't necessarily notice just by looking at the data.
You could try:
update tableOne set Id_num=1 where rtrim(name) ='shweta';
OR
update tableOne set Id_num=1 where trim(trailing from name) ='shweta';
This assumes that is padded by spaces, there may be other whitespace characters that are causing the problem.... or it could be something else entirely.
精彩评论