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 Limitations?

 
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 Apr 14, 2009 0:47    Post subject: ODBC Limitations? Reply with quote

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
View user's profile Send private message
Fireboar



Joined: 17 Feb 2008
Posts: 323

PostPosted: Tue Apr 14, 2009 12:29    Post subject: Reply with quote

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
View user's profile Send private message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Fri Apr 17, 2009 15:51    Post subject: Resolved Reply with quote

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
View user's profile Send private message
Fireboar



Joined: 17 Feb 2008
Posts: 323

PostPosted: Fri Apr 17, 2009 16:35    Post subject: Reply with quote

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
View user's profile Send private message
SartriX



Joined: 13 Jul 2008
Posts: 16

PostPosted: Sat Apr 18, 2009 10:57    Post subject: Reply with quote

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
View user's profile Send private message
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