logo       

Sponsor
FREE Network Mapping Tool for Microsoft® Office Visio® Professional 2007
Don't map your network by hand - let LANsurveyor Exx press for Microsoft Visio Professional 2007 automatically create network diagrams for you!

RE: stored procedures with out parameters: msg#00054

db.mysql.odbc

Subject: RE: stored procedures with out parameters

Hey,
I was searching in the net for a solution for this problem and found
this link :
http://archives.neohapsis.com/archives/mysql/2004-q3/1719.html
It says, my-ODBC 3.51 does not support stored procedures yet. Is this
the reason, my code is failing??
If so, is there a solution for this? or should I wait for 3.53 to be
released?

When is myODBC 3.53 getting released? It seems, this discussion happened
in 2004 July. and yet I couldn't find MyODBC 3.53.
regards

________________________________

From: Nagesh Sharvari-A21337
Sent: Saturday, May 27, 2006 12:04 PM
To: 'myodbc@xxxxxxxxxxxxxxx'
Subject: stored procedures with out parameters


Hello,
I am using myodbc with unixODBC. I have downloaded myodbc for
solaris.
now, I am facing problems executing stored procedures with out
parameters.
I am using the example shown in stored procedure section of MySQL
reference manual :

CREATE PROCEDURE simpleproc (OUT param1 INT)

BEGIN

SELECT COUNT(*) INTO param1 FROM t;

END;

my C code to access stored procedure:

strcpy(stmt, "call simpleproc(?)") ;
rc = SQLPrepare(hstmt,stmt,SQL_NTS);


and binding an integer parameter, id to the statment :


SQLINTEGER id;
rc= SQLBindParameter(hstmt, 1, SQL_PARAM_OUTPUT, SQL_C_LONG,
SQL_INTEGER, 0, 0, &id, 0, NULL);

rc=SQLExecute(hstmt);
if ((rc != SQL_SUCCESS) && (rc != SQL_SUCCESS_WITH_INFO))
{
printf("Error in call to stored procedure %d\n",rc);
SQLGetDiagRec(SQL_HANDLE_STMT, hstmt,1, stat,&err,msg,100,&mlen);
printf("%s (%d)\n State : %s \n",msg,err, stat);
}



When I compile and run this program, I get the following error.

Connected !
Error in call to stored procedure -1
[MySQL][ODBC 3.51 Driver][mysqld-5.0.19-standard]OUT or INOUT argument 1
for routine test.simplepro (1414)
State : HYT00


Initially I thought State: HYT00, is something related to timeout. so
changed the statement attribute and changed the timeout period. but that
also doesn't help
I even tried the "?=call simpleproc()" but this gives syntax error.

I spoke to unixODBC people also, they are saying, the problem is in
myodbc.
so please help me.

thanks and regards
sharari



<Prev in Thread] Current Thread [Next in Thread>
Sponsor
FREE Network Mapping Tool for Microsoft® OfficeVisio Professional 2007
Don't map your network by hand - let LANsurveyor Express for Microsoft Visio Professional 2007
automatically create network diagrams for you!
Google Custom Search

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation

Home | sitemap | advertise | OSDir is an inevitable website. super tiny logo