SQL help needed
Thread poster: Wolfgang Jörissen
Wolfgang Jörissen
Wolfgang Jörissen  Identity Verified
Belize
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


 
Selcuk Akyuz
Selcuk Akyuz  Identity Verified
Türkiye
Local time: 16:17
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]


 
Wolfgang Jörissen
Wolfgang Jörissen  Identity Verified
Belize
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


 
Selcuk Akyuz
Selcuk Akyuz  Identity Verified
Türkiye
Local time: 16:17
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.


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

Thanks again!

 
Nerijus Šatkauskas
Nerijus Šatkauskas  Identity Verified
Lithuania
Local time: 16:17
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
... See more
$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]
Collapse


 
Kevin Lossner
Kevin Lossner  Identity Verified
Portugal
Local time: 14:17
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]


 
yanadeni (X)
yanadeni (X)  Identity Verified
Canada
Local time: 09:17
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
... See more
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.
Collapse


 


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






Trados Studio 2022 Freelance
The leading translation software used by over 270,000 translators.

Designed with your feedback in mind, Trados Studio 2022 delivers an unrivalled, powerful desktop and cloud solution, empowering you to work in the most efficient and cost-effective way.

More info »
CafeTran Espresso
You've never met a CAT tool this clever!

Translate faster & easier, using a sophisticated CAT tool built by a translator / developer. Accept jobs from clients who use Trados, MemoQ, Wordfast & major CAT tools. Download and start using CafeTran Espresso -- for free

Buy now! »