by WhiteRider » Tue Sep 25, 2012 3:15 am
A couple of points here.
Firstly, I think you have a typo in there in that you probably meant to check the length of str_actors_p = 1 at the end.
More importantly, you need to do the check of the string lengths BEFORE you check the specific characters.
If (for example) you try to turn the second character of the aggressors string into an integer, and that string is only 1 character long that will cause problems, so you need to swap the order and do the length checks first.
However, I don't think this will work as you expect. The actors and aggressors strings include all of the preflop actors/aggressors, not just those up to the point of the active player's first action. If anyone else acts after that open raise then this expression will fail.
The check for "open raiser" is correct as long as you put the length check before it:
char_length(tourney_hand_summary.str_aggressors_p) >= 2 AND substring(tourney_hand_summary.str_aggressors_p from 2 for 1)::int = substring(tourney_hand_summary.str_actors_p from 1 for 1)::int
To check that there were no calls or raises of the 2bet before the active player you can check for having an opportunity to 3Bet or higher and not an opportunity to squeeze.
cash_hand_player_statistics.flg_p_3bet_opp AND NOT cash_hand_player_statistics.flg_p_squeeze_opp