The tag has no usage guidance.

learn more… | top users | synonyms

2
votes
1answer
22 views

Search and Replace in multiple MySQL databases

I have multiple MySQL databases(50+) and I want to replace a string in all of them, is there anyway to search and replace in all the databases? Server is CentOS and I have SSH root access.
4
votes
2answers
90 views

Replace special characters in a column with space

I'm trying to write a query which replaces the special characters with space. Below code helps to identify the rows. (alpha-numeric characters, comma and space is valid): SELECT columnA FROM tableA ...
0
votes
1answer
24 views

Remove all instances of a character from a column within tag

I don't know much about writing SQL and a client of mine has an erroneous semicolon appearing in his database that he'd like removed. It's in 1 specific column, but it should only be removed if it is ...
0
votes
0answers
16 views

Procedure to replace a BDR server

I have set up a 2-node PG 9.4 system with BDR. Replication works great. Now, let's suppose that one of the two nodes needs to be replaced. In fact, let's be more specific. Let's say that the node on ...
3
votes
3answers
208 views

How to split numbers and text in MySQL

I have searched over the internet looking for a function like REGEXP_REPLACE in Oracle, regexp_replace in PostgresSQL but I haven't find one similar in MySQL just REGEXP and RLIKE, but these operators ...
0
votes
0answers
23 views

Updating values with randomly generated values?

I've got an .sqlite3 database here. I want to replace all the values of a set distinct number of columns in the database with randomly generated values (the values should be unique). At the moment ...
1
vote
1answer
35 views

mysql how to replace a column content

I using Mysql. Table: Content_T1 id : int title : varchar255 content: text my all page content will be save in content columns. mysql content column... there is some <img ...
0
votes
1answer
2k views

Mysql REPLACE INTO query for Multiple rows insertion

I'm trying to add multiple rows using 'replace into' , but its updating one row. REPLACE INTO user_balance (user_id,acc_type,currency,balance,enable_deposit, ...
1
vote
3answers
270 views

REPLACE INTO SELECT from table

Is there a way in DB2 to replace the entire table with just selected rows from the same table ? Something like REPLACE into tableName select * from tableName where col1='a'; (I can export the ...
0
votes
0answers
71 views

MySQL - Update vs. Replace Into — why is Update non-parallel, and Replace Into allows multi-threads?

In trying to optimize a query that does (Insert ... on duplicate key update) .... someone suggested I do "Replace Into" to optimize performance. I'm not 100% certain the difference other than ... ...
0
votes
1answer
72 views

replace in String from subquery

I'm currently (trying) to optimize veery weird code. So please don't teach me about bad DB design ;-). Assuming there are two tables messages and options In the messages table theres a string like ...
0
votes
1answer
70 views

(MySQL) Need an “in-place” REPLACE for adjusting historical data

I have a table with around 6,000,000 records. It is backed up every few hours. Recently a script ran that cascade updated about 2,000,000 of the older records to bad values. I have extracted those ...
0
votes
1answer
509 views

postgresql replace table without losing dependancies

i want to replace an existing table with a new one, without losing foreign keys or inheritance relations. But I feel lazy to alter it to make it look like the new one. Is there a way to replace the ...
1
vote
1answer
117 views

Removing apostrophe in result set

create view ENTRP_SERVS.V_IRS_BULK as Select Atr.Ssn_Tx ,Names.First_Na ,Names.Middle_Na ,Names.Last_Na ,Reff.Ref_Cd_Desc_Tx Suffix_Na ,MBR.PRSN_MBRSH_ID, T_PRSN_MBRSH_TAX.FILTER_TYPE_CD From ...
1
vote
1answer
1k views

Remove single quotes from db2 column name

I have following query which i am trying to execute against db2 database server SELECT REPLACE('\'abc\'','\'','') FROM TN_DAY_PROCESS I am expecting the output like abc without single quotes from ...
0
votes
1answer
58 views

Replace minus symbol across whole document [closed]

A program I use has SQL & RTF files to generate reports and I'm wanting to remove all instances of the - (minus) symbol from the resulting document. I'd tried a SELECT REPLACE but I'm not very ...
1
vote
1answer
2k views

UPDATE SET REPLACE() matches but does not change

I've seen another post about this exact thing but it's 1-1/2 years old so I thought I'd make my own...besides, the other post did not help me. What I am trying to do is pretty straight-forward. To ...
1
vote
1answer
2k views

Need to replace only first occurrence of string

I hope I worded the question right. Here are the specifics: This is regarding a MySQL database. I've inherited several hundred posts with custom fields and a unique excerpt. At this point I think I ...
2
votes
2answers
5k views

Remove the last character from Variable String

I have a few variable data in the column "email". For example: roy2087@gmail.com123 sg123@yahoo.compori How do I get rid of the characters after .com? I used Replace(email,'.com%',gmail.com), ...
2
votes
1answer
134 views

Query to change all field in a given mysql table?

I have a table with a timestamp field called "time". I have many records in this table and "time" has value like: 1343296642, 1343308689... I need to run a query to subtract 2 years of time to those ...
2
votes
1answer
4k views

Query to find and replace text in all tables and fields of a mysql db

I need to run a query to find and replace some text in all tables of a mysql database. I found this query, but it only looks for the text in the tbl_name table and just in the column field. update ...
1
vote
1answer
190 views

How to prepare a date and double for a mysql replace statement?

I have a MySql table with three columns: CU VARCHAR(3) DA DATETIME VA DOUBLE I need to execute several REPLACE into mytable (CU, DA, VA) values("ABC", mydate, myval) statements from Java. mydate is ...
8
votes
2answers
16k views

Update many rows in a table with a single statement?

What is the easiest way to update many rows in a table? I have a csv file that looks like this: |primary_key |value| | 1 | xyz| | 2 | abc| | 3 | def| ... Rows with ...