Exporting / extracting only played hands out of a mining db

Experiencing technical difficulties? Think you've found a problem with PokerTracker 3? Report it here.

Moderator: Moderators

Exporting / extracting only played hands out of a mining db

Postby TroyMcLure » Tue Jan 13, 2009 12:29 pm

Hi,

i accidentally imported some played hands into one of my mining dbs while playing (because i didn't switch to my played hands db as "active db" before playing). Is there a way to export or extract these hands so that i can import them into my played hands db (and delete them from my mining db)?

As a workaround i could purge all mined hands out of the db, export the db, import the exported files into my played hands db and then reimport the mined hands (i still have all hands files). But this seems to take a lot of time and a little "overdosed" as i have more than 1,5 billion mined hands in this db and only need to extract 5k played hands.

If this is not possible in an easy way in PT3, maybe someone knows a way via SQL (PG Admin)?

Thanks in advance for your help!
TroyMcLure
 
Posts: 10
Joined: Tue Sep 02, 2008 7:45 am

Re: Exporting / extracting only played hands out of a mining db

Postby kraada » Tue Jan 13, 2009 1:17 pm

Run the following query, and paste the text output into a text file, then import it into your played hands db (note this assumes cash play, for tournament play, append tourney_ in front of all required tables):

select history from holdem_hand_histories, holdem_hand_player_detail, player where holdem_hand_histories.id_hand = holdem_hand_player_detail.id_hand and holdem_hand_player_detail.id_player = player.id_player and player.player_name = 'Your Username Here';

Replace "Your Usernmae Here" with your actual player username.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Exporting / extracting only played hands out of a mining db

Postby TroyMcLure » Tue Jan 13, 2009 1:57 pm

Hey, this looks great (yes, it's cashgame)! Thx for the quick answer :)
TroyMcLure
 
Posts: 10
Joined: Tue Sep 02, 2008 7:45 am

Re: Exporting / extracting only played hands out of a mining db

Postby kraada » Tue Jan 13, 2009 2:50 pm

No problem; if there's anything else I can help with, you know how to find me :)
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Exporting / extracting only played hands out of a mining db

Postby TroyMcLure » Tue Jan 13, 2009 8:14 pm

One additional note for users who want to do this: The query works perfectly, but after you have pasted the data into a .txt file you have to remove (-> use the "replace all" function) all " (<- double quotes) out of the file otherwise PT3 can't identify the hands.
But this was no big issue, thanks again :)
TroyMcLure
 
Posts: 10
Joined: Tue Sep 02, 2008 7:45 am

Re: Exporting / extracting only played hands out of a mining db

Postby kraada » Thu Jan 15, 2009 10:15 am

You're welcome, and thanks for the caveat :)
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Exporting / extracting only played hands out of a mining db

Postby Fivetimes18 » Sun Jan 18, 2009 10:23 am

Is there any way to modify this so that I can export all hands from say January 2008 from my database?
Fivetimes18
 
Posts: 12
Joined: Sat Nov 29, 2008 7:38 pm

Re: Exporting / extracting only played hands out of a mining db

Postby kraada » Sun Jan 18, 2009 11:29 am

Change the query to read as follows:

select history from holdem_hand_histories, holdem_hand_player_detail, player, holdem_hand_summary where holdem_hand_histories.id_hand = holdem_hand_player_detail.id_hand and holdem_hand_summary.id_hand = holdem_hand_histories.id_hand and holdem_hand_player_detail.id_player = player.id_player and player.player_name = 'Your Username Here' and holdem_hand_summary.date_played >= '2009-Jan-01';

You can change the date as you see fit and you can also use < or <= in another one to get all hands between two dates if you'd like.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY


Return to Technical Support / Bug Reports [Read Only]

Who is online

Users browsing this forum: No registered users and 10 guests

cron