Mobile menu

SQL help needed
Thread poster: Wolfgang Jörissen

Wolfgang Jörissen  Identity Verified
Belize
Member
Dutch to German
+ ...
Apr 29, 2008

Hi all!

I messed up a TM by importing memory exports from other people that I actually wanted to keep in a separate TM. I am not too good at SQL (yet), so could one of you give me an SQL command that erases all entries of other users and only keeps the entries that I made myself?

TIA
Wolfgang


Direct link Reply with quote
 

Selcuk Akyuz  Identity Verified
Turkey
Local time: 09:47
Member (2006)
English to Turkish
+ ...
You can try this one Apr 29, 2008

Hi Wolfgang,

I do not know too much about SQL commands but this one may help.

Do not forget to backup your TM before executing this command!

DELETE FROM Sentences WHERE ID IN (SELECT ID FROM Translations WHERE UserNick<>'Wolfgang')


HTH

Selcuk



[Edited at 2008-08-28 21:01]


Direct link Reply with quote
 

Wolfgang Jörissen  Identity Verified
Belize
Member
Dutch to German
+ ...
TOPIC STARTER
Just to make sure... Apr 29, 2008

Thanks Selcuk, backup is already done.

I am a bit hesitant though. Isn't this exactly the opposite and wouldn't this pull out all of my entries, leaving the unwanted ones behind?

Sorry for my incompetence, please do correct me if I'm wrong.

Thanks a lot!
Wolfgang


Direct link Reply with quote
 

Selcuk Akyuz  Identity Verified
Turkey
Local time: 09:47
Member (2006)
English to Turkish
+ ...
Re: Apr 29, 2008

Wolfgang Jörissen wrote:

I am a bit hesitant though. Isn't this exactly the opposite and wouldn't this pull out all of my entries, leaving the unwanted ones behind?



Please see my updated message above.


Direct link Reply with quote
 

Wolfgang Jörissen  Identity Verified
Belize
Member
Dutch to German
+ ...
TOPIC STARTER
Got the message :-) Apr 29, 2008

Thanks again!

Direct link Reply with quote
 

Nerijus Šatkauskas  Identity Verified
Lithuania
Local time: 09:47
Member (2008)
English to Lithuanian
+ ...
MySQL Apr 29, 2008

$publisher = "your name";


while ($row = mysql_fetch_array($result))
{


$first= $row["id"];
$second = $row["publisher"];
$third = $row["text"];


if ( $second != $publisher)
{
$other_publishers[] = $second ;
}


}


foreach ($other_publishers as $others_to_delete)
{

$query = "DELETE FROM tablename WHERE publisher='$others_to_delete' ";

$result = mysql_query($query, $db_connection) or die('Error, query failed. ' . mysql_error());

}



"publisher" is a name of the column. It indicates who inserted the data. In you case it can be the other name of the column that indicates the names of publishers

Nerijus


[Edited at 2008-04-29 11:36]


Direct link Reply with quote
 

KSL Berlin  Identity Verified
Portugal
Local time: 07:47
Member (2003)
German to English
+ ...
You have to use entities to display those characters May 18, 2008

Selcuk Akyuz wrote:
Unfortunately the command is not displayed correctly, I think it is because of the html codes used in ProZ.com forums. You can see it if you quote my message.


To display the greater than and lesser than symbols here, you'll have to use an ampersand character followed by lt or gt and then terminated by a semicolon. The results look like this:

< >


[Edited at 2008-05-18 18:27]


Direct link Reply with quote
 
yanadeni  Identity Verified
Canada
Local time: 02:47
French to Russian
+ ...
Procedure Jan 27, 2009

0. Open the TM

1. Show the desired language on the left

2. Click SQL...

3. Enter the command

For example
UserNick="barak.obama"
or
datestamp >= #14/10/2007#

the first command shows all the entries of Barak Obama
the second - all the entries after October 14 2007

4. Click Apply

4.1. After all the desired entries are shown, select them all and click Remove.

5. To show all the entries click All rows.


Direct link Reply with quote
 


To report site rules violations or get help, contact a site moderator:

Moderator(s) of this forum
Pavel Tsvetkov[Call to this topic]

You can also contact site staff by submitting a support request »

SQL help needed

Advanced search






memoQ translator pro
Kilgray's memoQ is the world's fastest developing integrated localization & translation environment rendering you more productive and efficient.

With our advanced file filters, unlimited language and advanced file support, memoQ translator pro has been designed for translators and reviewers who work on their own, with other translators or in team-based translation projects.

More info »
Déjà Vu X3
Try it, Love it

Find out why Déjà Vu is today the most flexible, customizable and user-friendly tool on the market. See the brand new features in action: *Completely redesigned user interface *Live Preview *Inline spell checking *Inline

More info »



All of ProZ.com
  • All of ProZ.com
  • Term search
  • Jobs