Raised This Month: $32 Target: $400
 8% 

[REQ] SQLx - SQL_GetQueryString


  
 
 
Thread Tools Display Modes
Author Message
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 08-05-2006 , 16:17   [REQ] SQLx - SQL_GetQueryString
#1

I request being able to get the query string that was executed.

This is usefull for finding out what was wrong in the query that it failed to execute.

Just something like SQL_GetQueryString(Handle:QueryHandle , Query[] , len)

[EDIT] Also once this is done, may I please have a linux build of this? Thanks.

Last edited by Xanimos; 08-06-2006 at 02:02.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 08-05-2006 , 16:18   Re: [REQ] SQLx - SQL_GetQueryString
#2

Hows is this different from the query that you build?
Freecode is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 08-05-2006 , 16:21   Re: [REQ] SQLx - SQL_GetQueryString
#3

Well two different ways.
1) ThreadQuery() - Yes you do have to format your own query, but the error will be found in another function when you don't have the var, unless it's global.

2) PrepareQuery() - has format built right in it so you don't have a var for it.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 08-05-2006 , 16:24   Re: [REQ] SQLx - SQL_GetQueryString
#4

What im saying is. If you want to know the query you build you can do like
Code:
format(query, 255, "SELECT *.......field = %s",name);
SQL_PrepareQuery ( Handle, query);
and you will have your query.
And yes you would have to store them globaly. So i guess then this would be a good request
Freecode is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 08-05-2006 , 16:56   Re: [REQ] SQLx - SQL_GetQueryString
#5

Quote:
Originally Posted by Freecode
What im saying is. If you want to know the query you build you can do like
Code:
format(query, 255, "SELECT *.......field = %s",name);
SQL_PrepareQuery ( Handle, query);
and you will have your query.
And yes you would have to store them globaly. So i guess then this would be a good request
Well it would have to be
Code:
format(query, 255, "SELECT *.......field = %s",name);
SQL_PrepareQuery ( Handle, "%s" , query);
So you don't get bad formatting errors.

But my request still stands.

This will be very helpful when dealing with multiple plugin using one function for the errors.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
BAILOPAN
Join Date: Jan 2004
Old 08-05-2006 , 17:32   Re: [REQ] SQLx - SQL_GetQueryString
#6

Marked as a valid request, this'll go into the next release. I'll update this post when it's in SVN.
__________________
egg
BAILOPAN is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 08-15-2006 , 01:18   Re: [REQ] SQLx - SQL_GetQueryString
#7

Just an update.

I attached the updated files that can be committed to the SVN.
Files included in the .zip:
  • basic_sql.cpp
  • sqlx.inc

But for reference here is the function that was added to basic_sql.cpp.
PHP Code:
static cell AMX_NATIVE_CALL SQL_GetQueryString(AMX *amxcell *params)
{
    
AmxQueryInfo *qInfo = (AmxQueryInfo *)GetHandle(params[1], Handle_Query);
    if (!
qInfo)
    {
        
MF_LogError(amxAMX_ERR_NATIVE"Invalid handle: %d"params[1]);
        return 
0;
    }

    
MF_SetAmxString(amx params[2], qInfo->pQuery params[3]);

    return 
1;

So this can be locked after it's committed.
Attached Files
File Type: zip mysqlx.zip (5.1 KB, 126 views)
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
BAILOPAN
Join Date: Jan 2004
Old 08-17-2006 , 22:22   Re: [REQ] SQLx - SQL_GetQueryString
#8

FYI, your patch passes the query pointer in, that'll probably crash at best ;)
You need to actually change the ISQLDriver/IQuery API around. View the changes if you're interested.

This is committed as Revision 2916. Thanks for the suggestion!
Attached Files
File Type: dll mysql_amxx.dll (1.44 MB, 121 views)
__________________
egg

Last edited by BAILOPAN; 08-18-2006 at 00:19.
BAILOPAN is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:01.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode