View previous topic :: View next topic |
Author |
Message |
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Tue Apr 14, 2009 0:47 Post subject: ODBC Limitations? |
|
|
Hi, Does anyone know if there are data limitations for mySQL database query fields?
Eg
I am trying to have a dynamic Journal Entry, that changes depending on database data, it updates the journal entry via SetCustomToken, but thats not the broken part.
My database field which has the journal text is quite dense, it has several paragraphs of data in it, but when the query tries to return the data, it appears as this.
o Got request: SELECT * from journal_entrys where id = 1
o Sent response (29 bytes): 1<>Welcome to Worlds of Rhun.<>
(<> - is the in the place of the separator symbol)
There are 3 fields being requested.
The id, the title, and the journal_text.
The Journal_text however, is not returned.
Is there a limit on the size of the data returned?
Any idea how to circumvent it, or a work around? |
|
Back to top |
|
|
Fireboar
Joined: 17 Feb 2008 Posts: 323
|
Posted: Tue Apr 14, 2009 12:29 Post subject: |
|
|
There is, and it all depends on the size of your spacer set in your aps_include (or similar) script. See this topic for more details. |
|
Back to top |
|
|
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Fri Apr 17, 2009 15:51 Post subject: Resolved |
|
|
Hi All,
I did get the issue resolved by changing the spacer to be
128 x 16 instead of 128 x 8.
I was just wondering, does increasing the size, result in any detriment to functionality, or stability?
Can I increase it to as large a number as I want, or will that result in errors, or performance issues.
Am I right in assuming that the spacer limit, is the amount of free space/data that is allocated to the receiving of data? (in lamens terms)
Can I for instance increase it to
128 x 32 |
|
Back to top |
|
|
Fireboar
Joined: 17 Feb 2008 Posts: 323
|
Posted: Fri Apr 17, 2009 16:35 Post subject: |
|
|
You can increase it as much as you like as far as I know, but a bigger spacer is likely to degrade performance, so make sure it's only as large as you are going to use. |
|
Back to top |
|
|
SartriX
Joined: 13 Jul 2008 Posts: 16
|
Posted: Sat Apr 18, 2009 10:57 Post subject: |
|
|
It wouldn't be too hard to adjust the nwnx_aps functions with an additional parameter to enable large results on the fly for those rare few queries which actually need it.
Something like this:
Code: | int SQLFetch(int bLargeResult = FALSE)
{
string sRow;
object oModule = GetModule();
string sSpacer = GetLocalString(oModule, "NWNX!ODBC!SPACER");
if (bLargeResult)
sSpacer += sSpacer;
SetLocalString(oModule, "NWNX!ODBC!FETCH", sSpacer);
sRow = GetLocalString(oModule, "NWNX!ODBC!FETCH");
int i = GetStringLength(sRow);
if (i > 0 && i < GetStringLength(sSpacer))
{
SetLocalString(oModule, "NWNX_ODBC_CurrentRow", sRow);
return SQL_SUCCESS;
}
else
{
SetLocalString(oModule, "NWNX_ODBC_CurrentRow", "");
return SQL_ERROR;
}
} |
GetPersistentString could gain the same new parameter and simply forward it to SQLFetch.
Note: If doubling the spacer still isn't enough, you can change the 'if (bLargeResult)' into 'while (bLargeResult--)', which will make it scale in powers of 2. So that's 1024 with False, 2048 with 1, 4096 with 2, etc. |
|
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
|