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 
 
SQLFetch and TEXT fields on MySQL

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



Joined: 11 Mar 2008
Posts: 14

PostPosted: Sun May 18, 2008 18:00    Post subject: SQLFetch and TEXT fields on MySQL Reply with quote

Hi, I got the following problem. When i try to select a Text field on a MyISAM table of my DB, I can only fetch the first 1024 bytes of the resultset. If the TEXT field exceeds 1024 bytes, I fetch nothing. Here is the the dump on nwnx_odbc log:

...
o Got request: SELECT dialog FROM quest_main WHERE quest_id='q_goblin'
o Sent response (0 bytes):
o Got request: SELECT dialog FROM quest_main WHERE quest_id='q_goblin'
o Sent response (1023 bytes): <init>
...

Between the two queries I obviously changed the text field (truncated to 1023 bytes). Am i doing something weird? My current specs are:

Ubuntu Edgy with vanilla mysql 5 from the distro packages.
nwnx 2.7-beta4 (which is supposed to dinamically allocate resultsets, so i see no reason why it stops on 1024 bytes)
latest ODBC2 driver

I receive no error from nwnx nor odbc, please help Very Happy
Back to top
View user's profile Send private message
MaxRock



Joined: 24 Jan 2008
Posts: 196

PostPosted: Thu Feb 12, 2009 5:27    Post subject: Reply with quote

I just ran into the same problem *bump*
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Asparius



Joined: 18 Sep 2007
Posts: 52

PostPosted: Thu Feb 12, 2009 18:48    Post subject: Reply with quote

Did you try to increase size of NWNX!ODBC!SPACER variable?...
Back to top
View user's profile Send private message
Fireboar



Joined: 17 Feb 2008
Posts: 323

PostPosted: Thu Feb 12, 2009 22:54    Post subject: Reply with quote

Asparius wrote:
Did you try to increase size of NWNX!ODBC!SPACER variable?...


That would do it. As a general rule, don't store massive amounts of text data on the database. Store it in a file instead, and use nwnx_files to access it. Or else split it up into several rows on the database.
Back to top
View user's profile Send private message
Quixsilver



Joined: 20 Jan 2009
Posts: 30

PostPosted: Fri Feb 13, 2009 2:40    Post subject: Reply with quote

Interesting idea. nwnx_files is Windows only though, right?
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Fri Feb 13, 2009 3:15    Post subject: Reply with quote

Quixsilver wrote:
Interesting idea. nwnx_files is Windows only though, right?
Yes it is only windows now and I have no plans to port it as I don't understand linux at all. Maybe someone else...
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
Fireboar



Joined: 17 Feb 2008
Posts: 323

PostPosted: Fri Feb 13, 2009 16:18    Post subject: Reply with quote

In that case, I would split it up into multiple rows on the database. Example table structure (very general PseudoSQL):

ITEM:
ItemID PRIMARY KEY
ItemName
ItemRecords

ITEM_RECORD:
RecordNo
ItemID
Text
PRIMARY KEY (RecordNo, ItemID)
Back to top
View user's profile Send private message
MaxRock



Joined: 24 Jan 2008
Posts: 196

PostPosted: Fri Feb 13, 2009 18:54    Post subject: Reply with quote

if it's just plain text, you could set is as description of an item and store that.
Back to top
View user's profile Send private message Send e-mail 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