This is my scenario

I have a table t with following columns

id  int
link  varchar(500)
name  varchar(20)
sal   text

In the link column we will store the location for the pdf files(mount point)

Ex: link /ABC/ABC_DATA/Mydata/Test/a1.pdf

there will be one link for every id

Application Users have changed their pdf file location from "/ABC/ABC_DATA/Test/a1.pdf" to "/CBF/CBF_DATA/Documents/Test_DATA/a1.pdf"

Now how can i update the table with new location for all the rows. Table contains nearly 10,000 rows

Note:id and link are related every id contains unique link.

1 Answer 1


Maybe I'm missing something, but it sounds as if that is a simple case of replacing the value:

update the_table
   set link = replace(link, '/ABC/ABC_DATA/Test/', '/CBF/CBF_DATA/Documents/Test_DATA/');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.