473,378 Members | 1,405 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

How can I replace all contents of a field based on a partial string?

I have a field called Photos in a database of information scraped from public records. This field contains the Photo information if one is available, however, if no photo is available, it inserts a Map link instead.

The map link always starts the same, but ends differently. I can search and replace for an exact match, but neither UPDATE or REPLACE seem to be able to handle LIKE strings.

How can I query a MySQL database field and if it starts with a certain string (the beginning of a map link), replace the entire field with a new string.

i.e. if the field 'photos' starts with the string "http://maps." replace the entire field with "No Photo Available"
Feb 13 '11 #1
1 1692
Rabbit
12,516 Expert Mod 8TB
Expand|Select|Wrap|Line Numbers
  1. UPDATE TableName
  2. SET FieldName = 'Hello World'
  3. WHERE FieldName Like 'something%'
Feb 13 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Dave | last post by:
Hello all, The scheme shown below to move a text file's contents into a std::string works with one exception: it drops the carriage return and line feed characters. How may I, in a...
2
by: John Dalberg | last post by:
Hi What's the regex to remove the carriage return/line field from a string? These can occur multiple times in the string as in xxx\r\n\r\n. -- John Dalberg
0
by: ABC | last post by:
Which function can determine the URI is web-based or File-based filename string? I want a function can determome the file with path is web or file-system-based filename, for example: ...
14
by: SpyderSL | last post by:
Hey, I have created an access form, in which I have a drop down with employee names. These are the steps I would like to happen: 1. A user will enter a number in FIELD A 2. The user will...
1
by: wlupton | last post by:
Hi All; My problem is getting information from an Access database using a partial string in VB6. The database consists of tables of information on motor vehicles including a 17 character VIN...
3
by: Edwin Smith | last post by:
Hello: I have the following code which works on a DataGridView binding source: private void textBox1_TextChanged(object sender, EventArgs e) { this.pATIENTSBindingSource.Position =...
1
by: compl | last post by:
I have a database that I need to restrict the ability to edit one field based on another. The two fields are DOS (date) and Amount (currency). I only want the users to be able to edit the Amount...
4
by: whamo | last post by:
I have the need to populate a field based on the selection in a combo box. Starting out simple. (2) tables tbl_OSE_Info and tbl_Input; tbl_OSE_Info has three fields: Key, OSE_Name and OSE_Wt...
4
mikewagan
by: mikewagan | last post by:
Hello guys, need help here on C! I need a function to replace a substring inside a string with another new string. Example, we have "you are famous than me", we need to replace "famous" with "more...
5
by: Shortstuff12345 | last post by:
I'm trying to use VBA code to disable a field based on the value of another field in a form. The code I have properly updates the enabled property of the field when it changes; however, it changes...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
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$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.