• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 259
  • Last Modified:

Update Data

Hi,
I need to update almost 200 records
  CountryID  CountryName     CountryURL                  CountryStatus  
      1             USA                 index.cfm?CntID=1           A
      2             France             index.cfm?CntID=2           A
      3             Italy                  index.cfm?CntID=3           A
      4             Spain               index.cfm?CntID=4           A

I have almost 200 records I need to update the
CountryURL to this
home.cfm?CntID=1

I have remove index.cfm and replace it with home.cfm then each
home.cfm will a differenct CntlD.
like this:

  CountryID  CountryName     CountryURL                  CountryStatus  
      1             USA                 home.cfm?CntID=1           A
      2             France             home.cfm?CntID=2           A
      3             Italy                  home.cfm?CntID=3           A
      4             Spain               home.cfm?CntID=4           A

How can I do that?
0
lulu50
Asked:
lulu50
  • 4
  • 2
1 Solution
 
cfEngineersCommented:

<cfquery >
   update countries (or whatever the table name is)
        set CountryURL = 'home.cfm?CntID='+CountryID
</cfquery>
0
 
lulu50Author Commented:
It has to be in MySQL database
0
 
lulu50Author Commented:
something like this but for 200 record

UPDATE CountryTbl
SET CountryURL='home.cfm?CntID=1'
WHERE CountryURL = 'index.cfm?CntID=1'

0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
SharathData EngineerCommented:
try this/
UPDATE CountryTbl 
SET CountryURL=replace(CountryURL,'index.cfm?','home.cfm?')
WHERE CountryURL like 'index.cfm%'

Open in new window

0
 
lulu50Author Commented:
Sharath_123: you saved me time and you saved my life

THANK YOU Sharath_123:    THANK YOU Sharath_123:
0
 
lulu50Author Commented:
WELL DONE THANK YOU
0
 
SharathData EngineerCommented:
Glad I could help you :)
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now