Page 1 of 1

formatting of sql query for "cnt_p_fold"

PostPosted: Sat Jan 19, 2013 1:22 pm
by samweiss
I'm trying to perform the following query fro PT3's database via postgreSQL:

query='SELECT ALL cnt_p_fold FROM holdem_hand_player_statistics';
prefold = fetch(conn,query);

Which is currently returning the error:
"ERROR: column "cnt_p_fold" does not exist"


Can somebody please point out what I'm missing? I've tried copying the expression for this parameter from the "configure statistics" dialogue in PT3, but it fails every time

Re: formatting of sql query for "cnt_p_fold"

PostPosted: Sat Jan 19, 2013 1:29 pm
by PeteX
There isn't such column in the database. It's a "virtual" column computed by PT from actual database values. Take a look at the expression that defines cnt_p_fold in PT and you should get an "eureka" moment, IMO.

Re: formatting of sql query for "cnt_p_fold"

PostPosted: Sat Jan 19, 2013 3:46 pm
by samweiss
Thanks for the speedy reply.

I did try pasting the whole expression into the query string, which was throwing an error back.

I've just tried grabbing the "flg_p_fold" variable which worked flawlessly, so thank you.



I am still experiencing problems with the "cnt_p_check variable" - I understand that the expression in the configure stats window is

"sum(if[substring(lookup_actions_p.action from 1 for 1)='X', 1, 0])".

I've been trying the query:
query='SELECT ALL action FROM lookup_actions_p'

but it throws the error:
ERROR: relation "lookup_actions_p" does not exist

Thanks for your support

Re: formatting of sql query for "cnt_p_fold"

PostPosted: Sat Jan 19, 2013 5:38 pm
by WhiteRider
lookup_actions_p isn't a database field - actions are stored in the lookup_actions table and are referenced by an ID number. I'm not sure how you'd do that as a database query but if you look in the PokerTracker.log file (in the main PokerTracker 3 folder) you should be able to see the exact queries used.