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 
 
ODBC Limit

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows technical support
View previous topic :: View next topic  
Author Message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Tue May 19, 2009 14:50    Post subject: ODBC Limit Reply with quote

Can someone tell me if the ODBC limit applies to single column retrievals, or applies to all columns retrieved.


Eg - If my limit is 256 characters long, will it fail if I have 4 columns being retrieved, each 100 characters long. Meaning I will be kinda over the 256 limit. Or...

Does the 256 apply to individual columns, meaning it can retrieve 256 per column.
Reason I ask is because I am working on something which is likely to be trying to return 30+ columns in one go.
Back to top
View user's profile Send private message
Fireboar



Joined: 17 Feb 2008
Posts: 323

PostPosted: Tue May 19, 2009 20:36    Post subject: Reply with quote

All columns. If you had 4 columns each with 100 bytes of data (completely full), columns 1 and 2 would return correctly, but columns 3 and 4 would both overflow.

The amount of data you actually get back is used, NOT the defined size of the field. A 3 digit number uses 3 bytes, a 50 character string field with only 30 characters filled in for a given row would use 30 bytes, and so on.

What if you had this:
Column 1: 100 bytes
Column 2: 100 bytes
Column 3: 100 bytes
Column 4: 40 bytes

Columns 1, 2 and 4 would return correctly, column 3 would return empty. Why? Because column 3 overflows, but it keeps on going regardless. Column 4 is only 40 bytes and after columns 1 and 2 we have 56 bytes left to fill, so column 4 fits just fine.
Back to top
View user's profile Send private message
addicted2rpg



Joined: 01 Aug 2008
Posts: 106

PostPosted: Wed May 20, 2009 5:16    Post subject: Reply with quote

I was never aware of this. Wow, that sucks. Razz

I decided to investigate. In, SQLGetData() we got:

GetLocalString(GetModule(), "NWNX_ODBC_CurrentRow");

Each column is separated by a delimeter and sorted in the same function-
iPos = FindSubString(sResultSet, "¬");

Thus, it seems the total combined columns all have to fit in a "LocalString" NWScript variable, which is probably limited to 256.

Hmmm, it might be nice to extend that, but I fear the solution would be very.....non-trivial. And that is putting it optimistically. At the end of the day, blame Bioware.
Back to top
View user's profile Send private message
Zebranky



Joined: 04 Jun 2006
Posts: 415

PostPosted: Wed May 20, 2009 7:38    Post subject: Reply with quote

If I recall correctly, making the buffer length irrelevant is one of the things virusman has been working on for some time. I'm not sure where he stands on that, as I've never had a problem with it myself (come on, guys, why can't you just use shorter fields? Wink).
_________________
Win32 SVN builds: http://www.mercuric.net/nwn/nwnx/

<Fluffy-Kooshy> NWNx plugin is to this as nuclear warheads are to getting rid of fire ants.

<ThriWork> whenever I hear nwn extender, I think what does NWN need a penis extender for?
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows technical support 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