Page 1 of 2

Unable to delete/update some player notes

PostPosted: Fri Jul 23, 2010 8:22 am
by StackTrace
Hi there,

I have noticed that for some players it is not possible to update or delete a note. However, it is possible to add a note to this player, and also possible to delete the new entry.
When I try to delete the note I want to get rid of, nothing happens.

When I add a note to this specific player, and I look it up in the database, I can only find 1 note (the one I just added); PokerTracker however show TWO notes.

Can anyone help me with this one?

My PokerTracker version is 3.06.2

Re: Unable to delete/update some player notes

PostPosted: Fri Jul 23, 2010 10:39 am
by WhiteRider
I'm not sure why that would have happened - it sounds like something may be broken in that database. I don't think you'll be able to correct that without creating a new database and re-importing your hands. If you do that you can transfer your notes using the Backup mechanism - that should either get rid of the missing notes completely or recover them if possible.

Re: Unable to delete/update some player notes

PostPosted: Sat Jul 24, 2010 1:45 am
by StackTrace
A possible cause I can think of is the fact that this specific player has been merged with other players in the past. I demerged them some time ago.

I will also try your suggestion to reimport the hands in a new database.

Thanks for your reponse.

Re: Unable to delete/update some player notes

PostPosted: Wed Jul 28, 2010 11:01 am
by StackTrace
I manually insert notes for players based upon there rating (after deleting these first):

insert into notes(id_note,id_x,enum_type,date_note,notes)
select
nextval('notes_sequence') --(equivalent to max(id_note)+1)
,p.id_player
,'P'
,now()
,case p.val_icon
when 1 then 'Fish LP/P'
when 2 then 'Moneybag TA/A'
when 3 then 'Happy SLA/A'
when 4 then 'Sad SLA/P'
when 5 then 'Warning TA/P'
when 6 then 'Bomb SLP/A'
when 7 then 'Dice LA/P'
when 8 then 'Rock TP/A'
when 9 then 'Tornado LA/A'
when 10 then 'Question'
when 11 then 'Phone SLP/P'
when 12 then 'Mouse TP/P'
when 13 then 'Elephant LP/A'
when 14 then 'Eagle TA'
end as x
from
player p
where p.val_icon > 0

and now I am unsure if I do this correct: what to put in id_note and id_x.

In the data-schema documentation (3.00 Build 4) I can find the following:

id_note, integer, Note identifier. This id matches the ID number of whatever this note is of. For instance, if this is a note about a specific player, then the id_note value is equal to the id_player value. If this note is about a certain session, then the id
is equal to the value of id_session.
id_x, integer, Identifier dependent on enum_type.

This could explain the problem deleting/updating these notes from within Pokertracker.

Re: Unable to delete/update some player notes

PostPosted: Wed Jul 28, 2010 12:16 pm
by WhiteRider
Yes - things like this need to be inserted correctly as there are dependencies between tables.

Re: Unable to delete/update some player notes

PostPosted: Wed Jul 28, 2010 12:17 pm
by kraada
Your query looks like it should do the right thing from my understanding.

Re: Unable to delete/update some player notes

PostPosted: Fri Jul 30, 2010 3:32 am
by StackTrace
I tested the insert statement and i does exactly what it should in my opinion; the generated notes pop up in the HUD and also from PokerTracker itself.

I can insert, update and delete them using sql. However, from within Pokertracker nothing happens when I try to update or delete these notes.

There must be some other condition in the update/delete statement that Pokertracker uses, that prohibits that dml statement.

I am aware that in the table 'Player' there is a flag that indicates whether or not that player has notes; this flag has also the correct value and I can't imagine that this could be the problem anyway.

I am very interested in the sql-statement that is fired by Pokertracker when a note is updated or deleted.

Re: Unable to delete/update some player notes

PostPosted: Fri Jul 30, 2010 3:36 am
by StackTrace
To WhireRider:

I have tried backing up and restoring the backup into a new database; the note problem is restored with it.

Thanks for the tip anyway! It was a good idea.

Re: Unable to delete/update some player notes

PostPosted: Fri Jul 30, 2010 9:18 am
by kraada
If you start PT3 with Logging Enabled and look in the PokerTracker.log file you can see the full queries for everything PT3 does. Just start PT3, insert a new note, edit an existing note, and check the log file.

Re: Unable to delete/update some player notes

PostPosted: Fri Jul 30, 2010 2:33 pm
by StackTrace
The Logfile contains only queries that are select statements. I don't see any insert, update or delete statements.

I do see queries (select statements) on the table notes, 8 in total.

The first and last:
SELECT date_note, notes FROM notes
WHERE id_x = 3
AND enum_type = 'P'
GROUP BY date_note, notes ORDER BY date_note asc

The 6 in the middle:
SELECT date_note, notes FROM notes
WHERE id_x = (SELECT id_player FROM player WHERE player_name_search='stacktrace' AND id_site=100)
AND enum_type = 'P'
GROUP BY date_note, notes ORDER BY date_note asc

This is what I did that session:
- start
- update existing note (failed)
- delete existing note (failed)
- insert new note (ok)
- update new note (ok)
- delete new note (ok)
- exit

Is it possible to also log the update/insert/delete statements?

highfalutin