Hey.
The query to update a table in such a way is simple enough: -
UPDATE `tbl`
-
SET `links` = REPLACE(`links`, 'http://localhost/', 'http://www.google.com.ph/');
I'm not sure how that will work with you temporary truncation scenario, but if your table gets truncated/re-created often, and you need this to happen for every row that get's inserted, you could try creating a Trigger that does this automatically each time a INSERT statement is issued. - CREATE TRIGGER `tbl_links_insert` BEFORE INSERT ON `tbl`
-
FOR EACH ROW
-
BEGIN
-
NEW.links = REPLACE(NEW.links, 'http://localhost/', 'http://www.google.com.ph/');
-
END;
This could create a performance bottle-neck though, so you should look out for that.
2 2152 Atli 5,058
Expert 4TB
Hey.
The query to update a table in such a way is simple enough: -
UPDATE `tbl`
-
SET `links` = REPLACE(`links`, 'http://localhost/', 'http://www.google.com.ph/');
I'm not sure how that will work with you temporary truncation scenario, but if your table gets truncated/re-created often, and you need this to happen for every row that get's inserted, you could try creating a Trigger that does this automatically each time a INSERT statement is issued. - CREATE TRIGGER `tbl_links_insert` BEFORE INSERT ON `tbl`
-
FOR EACH ROW
-
BEGIN
-
NEW.links = REPLACE(NEW.links, 'http://localhost/', 'http://www.google.com.ph/');
-
END;
This could create a performance bottle-neck though, so you should look out for that.
Thank you for your reply Atli :)
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Oliver Fromme |
last post by:
Hi,
I'm trying to write a Python function that parses
an expression and builds a function tree from it
(recursively).
During parsing, lambda functions for the the terms
and sub-expressions...
|
by: Yasaswi Pulavarti |
last post by:
Is it possible to order by specific values in a column. For example a
column may contain values like N, N1, N2, S, S1, S2, R, T. I want to
order by in such a way that all the records with N, N1, or...
|
by: Richard Hollenbeck |
last post by:
Hello Newsgroup. You have all been very helpful in the past and I thank
you. I try to ask relevant questions so that they don't just benefit me,
but also benefit the group. I'm currently...
|
by: Tc |
last post by:
Hi,
I was curious, I am thinking of writing an application that loads a dataset
from a database that resides on a server. The question I have is this, if
multiple copies of the app will be...
|
by: BStorm |
last post by:
Does anyone know the best way to update a DataTable row column using
specific values for a multipart primary key?
For example, updating an OrderAmt column in an OrderDetail table where the...
|
by: Darrel |
last post by:
I'm creating a table that contains multiple records pulled out of the
database. I'm building the table myself and passing it to the page since the
table needs to be fairly customized (ie, a...
|
by: sekisho |
last post by:
I'm dynamically adding a column of labels and a column of text boxes to
a panel on a webform, based on data returned from an SQL query, which
the user builds by selecting options from a few...
|
by: astro |
last post by:
I have a non-updatable column in a SQL:-Server view that represents a 1-to
{0,1} relation with a child table.
I want the end-user to be able to change this value. This view is generated
with...
|
by: bill |
last post by:
In an application I am writing the user can define a series of
steps to be followed. I save them in a sql database using the
field "order" (a smallint) as the primary key.
(there are in the range...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |