That is a strange error. Did you just copy-paste the code? And are you running Windows, Linux or Mac?
This is how it should look like in Windows.
And fwiw, I never install language packs, everything is English on my system.
Moderators: WhiteRider, kraada, Flag_Hippo, morny, Moderators
CREATE FUNCTION current_position() RETURNS bigint AS
$BODY1$CREATE OR REPLACE FUNCTION current_position(tourney_hand_player_statistics)
RETURNS bigint AS
$BODY$
select all_players.cur_pos
from (select thps.id_player, row_number() over (order by thps.amt_before - thps.amt_blind - thps.amt_ante + thps.amt_won desc) as cur_pos
from tourney_hand_player_statistics thps
where thps.id_hand = (select max(ths.id_hand)
from tourney_hand_summary ths
where ths.id_tourney = $1.id_tourney)) as all_players
where all_players.id_player = $1.id_player;
$BODY$
LANGUAGE sql STABLE
COST 100;
ALTER FUNCTION current_position(tourney_hand_player_statistics)
OWNER TO postgres;$BODY1$
LANGUAGE sql VOLATILE;
ALTER FUNCTION current_position() OWNER TO postgres;
ALTER FUNCTION current_position() SET current_position='DEFAULT';
CREATE FUNCTION current_position() RETURNS bigint AS
$BODY$ CREATE OR REPLACE FUNCTION current_position(tourney_hand_player_statistics)
RETURNS bigint AS
$BODY$
select all_players.cur_pos
from (select thps.id_player, row_number() over (order by thps.amt_before - thps.amt_blind - thps.amt_ante + thps.amt_won desc) as cur_pos
from tourney_hand_player_statistics thps
where thps.id_hand = (select max(ths.id_hand)
from tourney_hand_summary ths
where ths.id_tourney = $1.id_tourney)) as all_players
where all_players.id_player = $1.id_player;
$BODY$
LANGUAGE sql STABLE
COST 100;
ALTER FUNCTION current_position(tourney_hand_player_statistics)
OWNER TO postgres;$BODY1$
LANGUAGE sql VOLATILE;
ALTER FUNCTION current_position() SET current_position='DEFAULT';
BillGatesIII wrote:To make things clear for both of us: Did you use the SQL that was in your last post? Because that's still wrong (for example, two times $BODY$ in the beginning, $BODY1$ at the end) and will not work. Or did you use the original SQL?
BillGatesIII wrote:It only knows the chipcounts of the players at your table so you should use it only with single table tournaments. Although I guess it will work for 18 or 27 man once you're at the last table.
You can replace row_number() with rank() if you want players with equal stacks have the same ranking. It will replace the original function so it's an option which one you want to use.
Return to Custom Stats, Reports and HUD Profiles
Users browsing this forum: No registered users and 18 guests