logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Self Documenting NWNX log

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Database related
View previous topic :: View next topic  
Author Message
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Tue Aug 16, 2005 0:08    Post subject: Self Documenting NWNX log Reply with quote

Here's a little FYI that may be usefull to many... (MySQL users at least)

Try adding an in-line comment at the beginning of your SQL statements. These in-line comments are included in the NWNX logs. They do not interfere with the SQL when it is executed.

Example
SQL = "/*Comment*/ SELECT ... "

"/*" starts the comment, "*/" ends it. When MySQL parses the statement (reads the string) the comment is ignored, and the rest of the statement runs as desired.

Don't make your comment too long, as it eats into your memory buffer. But even just adding the 'script' name can help track any issues you may be getting.

A word of warning, the comment must be started and stopped (otherwise MySQL won't recognise it as a comment). and don't use any other comment method/characters as they will stop the SQL from working.

The comment could go anywhere in the statement, however putting it at the start of each line will make the log easy to read.

Hope this makes your life easier during those debug sessions 8^)
Gryphyn
Back to top
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Tue Aug 16, 2005 11:10    Post subject: Reply with quote

Nice one !
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Database related All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group