View previous topic :: View next topic |
Author |
Message |
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Tue May 19, 2009 14:50 Post subject: ODBC Limit |
|
|
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 |
|
|
Fireboar
Joined: 17 Feb 2008 Posts: 323
|
Posted: Tue May 19, 2009 20:36 Post subject: |
|
|
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 |
|
|
addicted2rpg
Joined: 01 Aug 2008 Posts: 106
|
Posted: Wed May 20, 2009 5:16 Post subject: |
|
|
I was never aware of this. Wow, that sucks.
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 |
|
|
Zebranky
Joined: 04 Jun 2006 Posts: 415
|
Posted: Wed May 20, 2009 7:38 Post subject: |
|
|
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? ). _________________ 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 |
|
|
|
|
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
|