[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mysql-odbc
Subject:    RE: Communication buffer to small question
From:       Tom Dorgan <tdorgan () yahoo ! com>
Date:       2001-10-06 18:44:46
[Download RAW message or body]

venu:

ahh-Haa!

Thanks to your suggestion, I decided to check the parameters for SQLBind.
The best ODBC reference I have found so far is at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbcodbc_api_reference.asp.
Anybody know a better one?

I found that I should be using SQLBindParameter. I believe the problem was
the last argument str_len_or_ind_ptr. I needed to set this to the length of
the parameter I was passing. This for INPUT parameters. for selected char *
columns, the actual length comes back. In my case, it contained
uninitialized garbage and, luckily, I guess, did not work. 

BTW, the ODBC API takes a while to get used to, for sure.

tom.
--- Venu <venu@mysql.com> wrote:
> Hi !!!
> 
> > -----Original Message-----
> > From: Tom Dorgan [mailto:tdorgan@yahoo.com]
> > Sent: Friday, October 05, 2001 2:35 PM
> > To: myodbc@lists.mysql.com
> > Subject: Communication buffer to small question
> > 
> > 
> > Hello,
> > 
> > Im using mysql-3.23.42, MyODBC-2.50,38 and libiodbc-3.0.5 
> > on redhat linux
> > kernel 2.4.2-2.
> > 
> > Ive run into an issue with a select I was converting from 
> > SQLExecDirect to
> > SQLExec using SQLPrepare.
> > 
> > Here is the select:
> > select status, ttreq, switchid, funccode, priority, eid, dial_num,
> > cmdstring, slsnotify, slsphone, slsswitchid, testpage, 
> > reqtimestamp from
> > switchque where ( (switchid = 61) or (switchid = 998) or 
> > (switchid = 50) or
> > (switchid = 44) or (switchid = 991) ) and ( reqtimestamp <= ? ) 
> > 
> > The error message I get occurs when I do the SQLBind for 
> > the the first
> > column of the select. This is after doing a successful 
> > SQLPrepare as well as
> > SQLSetParam for the parameter. This SQLBind works fine w/o 
> > the parameter in
> > the statement, ie, when I dont use SQLPrepare.
> > 
> > Message:
> > [TCX][MyODBC]Communication buffer is too small for query, 
> > SQLSTATE=S1001
> > 
> > This query works ok in mysql. I searched the web for 
> > references to the above
> > message and did not find anything since about 1998. 
> > 
> > Any suggestions/workarounds appreciated,
> > 
> What is the max length of data that you are supplying as the 
> parameter data through SQLSetParam/SQLBindPara/SQLBindParameter ?
> 
> I guess, the main reason is that, the driver is unable to allocate
> the memory while replacing the parameter markers in the statement 
> with the data suplied.
> 
> Regards, venu
> -- 
> For technical support contracts, go to https://order.mysql.com
>    __  ___     ___ ____  __
>   /  |/  /_ __/ __/ __ \/ /  Mr. Venu <venu@mysql.com>
>  / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Developer
> /_/  /_/\_, /___/\___\_\___/ California, USA
>        <___/ www.mysql.com
> 


__________________________________________________
Do You Yahoo!?
NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1

---------------------------------------------------------------------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail myodbc-thread3956@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail myodbc-unsubscribe@lists.mysql.com instead.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic