Reputation: 63
I have an SQL statement without a where clause because I want it to affect all rows. I have a column with the name url. Now I want to change the current column url to something else. I want to concatenate something to the current url.
My statement is:
UPDATE tablename SET url = 'http' || url;
This is in a sql file, which executes and throws no errors but the database is not changing.
Can anyone help?
RDBMS is MySQL
Upvotes: 3
Views: 130
Reputation: 38179
You may need to commit the transaction if commit is not implicit. Try
COMMIT;
Upvotes: 2
Reputation: 432200
Depending on your engine (in case it isn't Oracle and you have some bizarre MySQL bitwise operator)
UPDATE tablename SET url = CONCAT('http', url);
or
UPDATE tablename SET url = 'http' + url;
Upvotes: 3
Reputation: 82893
(Assuming its an Oracle DB)
I guess you are not commiting the changes and checking for the changes in other session.
Change your script file to:
UPDATE tablename SET url = 'http' || url;
COMMIT;
Upvotes: 3