Find a string and replace it the whole database [duplicate] - mysql

This question already has answers here:
Find and replace entire MySQL database
(12 answers)
Closed 9 years ago.
I have a wordpress website and I'm going to change it's URL. The problem is that when I search for its actual URL in the database, I have like 200 results.
I would like to search in the whole database for the actual url and replace it with the new one.
I know that if I have the exact table and exact column, I can do :
UPDATE
Table
SET
Column = Replace(Column, 'find value', 'replacement value')
But how can I generalize this code to my whole database ?
Thank You !

Perhaps not the best, one solution is to export the whole database, open the sql file in a text editor, perform the search-replace and importing again.

Related

Split large text field into multiple rows [duplicate]

This question already has answers here:
SQL split values to multiple rows
(12 answers)
Closed 4 months ago.
I have data stored as text within a MySQL database that has values separated by newlines which I need to split into rows. A single text field might look like this:
---
'2022-06-19': no_capacity
'2022-06-20': no_capacity
'2022-06-21': available
'2022-06-22': available
...
Yes this is an example of a single text field. There can be anywhere between 100-500 \n's. The dates themselves are also unpredictable.
I need each one of these 'rows' within the entry to be returned as an actual row in a table (and then columns split on the colon, but that is less important).Can this be done using a MySQL query?
You should be able to use something similar to this answer but for a newline character. This can't be done using a regular Mysql query, but rather a stored procedure similar to the answers in that post, which I'm not familiar with. Not sure if this helps, other answers might be necessary.

Is there anyway to put regular expression on mysql column

I am beginner to MySQL, so my question is: when create a new column in a specific table, is there any way to write regular expression to detect accepted value before inserting?
the main Idea from question is to add domain name column and I need to check if user entry matching my requirements before accept the value to store in database.
I hope my question cleared.
note: I cant use PHP or any front end language, it's necessary to do that in mysql database
thanks a lot in advance.

Microsoft Access - Include Last Modified By [duplicate]

This question already has answers here:
How to use system username directly in MS Access query?
(4 answers)
Closed 4 years ago.
I'm setting up a Data Update Form for my Access table for records to be updated. I just included a Last modified Date and Time fields, however, I was wondering was there anyway I could capture the user who was doing the update? Thanks
When I do this, i typically keep a variable in the event in the 'save changes' button. This variable is set to 'Environ(Username)' upon clicking, or 'CurrentUser' (if you are using mdb and are using Access Security methods). You can also keep a method in the 'BeforeChanges' event of the form your editing, and send this information to an Audit Log table as well.

How to lock out a field within a row after it has been updated SQL

I am using SQl, ASP.net. I have a system which has multiple users. I have a search that searched for a client which will then display their specific information. I want to be able to update a field Eg: Final Mark for that client. I then do not want the user who updated it to be able to change it again. What would be the best way of doing this? Detailed answers would be great as I am new to this!

Best way to store ranges and single values in mysql

just facing a little problem right now.
I have a layout-table that contains one field pages. This should specify for which pages the layout should be applied.
The possible contents are "closed" ranges like '3-5' or open ranges like '3-*'. But it should also be possible to add single pages.
So is there a good way to accomplish a content like that
'3-5;11;15;17-*'
in a single field?
Or do you know better ways?
Is there a possibility to query this field like
SELECT * WHERE IN_RANGE(pages, '5') (Pseudo-Code)
I want to prevent creating a table page because it would contain nothing else and also don't want to do the validation in php.
I am happy to provide more information if necessary.
This is a tricky question i dont see "native" sql option for this.
My first idea was to store information about pages as varchar and implement method to tokenize that string so youll have values which you can then process by sql query.