[unixODBC-support] Re: unixODBC-support Digest, Vol 21, Issue 14

Nagesh Sharvari-A21337 sharvari.nagesh at motorola.com
Mon May 29 12:21:36 BST 2006


Hi Amit,
This is the error returned :

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
 
My guess is, it's not treating stored procedure call as stored
procedure. It's treating that as any other SQL Statement. That's why it
runs fine with IN Parameters, but will have problem executing stored
procedures with OUT parameters.


Regards
sharvari

-----Original Message-----
From: unixodbc-support-bounces at easysoft.com
[mailto:unixodbc-support-bounces at easysoft.com] On Behalf Of Amit Kapila
Sent: Monday, May 29, 2006 4:43 PM
To: unixodbc-support at easysoft.com
Subject: [unixODBC-support] Re: unixODBC-support Digest, Vol 21, Issue
14

Hi Nagesh,

According to me, if the driver doesnot support the stored procedure
calls, it should return with error " Doesnot support this feature".
What is exact error you are facing while running the code?

With Regards,
Amit Kapila.

unixodbc-support-request at easysoft.com wrote:

>Send unixODBC-support mailing list submissions to
>	unixodbc-support at easysoft.com
>
>To subscribe or unsubscribe via the World Wide Web, visit
>	http://mail.easysoft.com/mailman/listinfo/unixodbc-support
>or, via email, send a message with subject or body 'help' to
>	unixodbc-support-request at easysoft.com
>
>You can reach the person managing the list at
>	unixodbc-support-owner at easysoft.com
>
>When replying, please edit your Subject line so it is more specific 
>than "Re: Contents of unixODBC-support digest..."
>
>
>Today's Topics:
>
>   1. RE: stored procedure with output parameter
>      (Nagesh Sharvari-A21337)
>   2. RE: stored procedure with output parameter
>      (Nagesh Sharvari-A21337)
>
>
>----------------------------------------------------------------------
>
>Message: 1
>Date: Mon, 29 May 2006 14:22:51 +0800
>From: "Nagesh Sharvari-A21337" <sharvari.nagesh at motorola.com>
>Subject: RE: [unixODBC-support] stored procedure with output parameter
>To: "Support for the unixODBC project" <unixodbc-support at easysoft.com>
>Message-ID:
>	<AF187172173696458E171B8DA10D1485A89634 at ZMY16EXM66.ds.mot.com>
>Content-Type: text/plain;	charset="us-ascii"
>
>Nick,
>	any update on this? Could you speak to MySQL people?
> 
>
>-----Original Message-----
>From: unixodbc-support-bounces at easysoft.com
>[mailto:unixodbc-support-bounces at easysoft.com] On Behalf Of Nick Gorham
>Sent: Thursday, May 25, 2006 4:45 PM
>To: Support for the unixODBC project
>Subject: Re: [unixODBC-support] stored procedure with output parameter
>
>Nagesh Sharvari-A21337 wrote:
>
>  
>
>>Hey 
>>   I am facing problem executing stored procedures which has an out 
>>parameters. Please tell me what's wrong in my code This is how I am 
>>using call statement to execute a procedure,
>>simpleproc:
>>
>>strcpy(stmt, "call simpleproc(?)") ;
>>rc = SQLPrepare(hstmt,stmt,SQL_NTS);   
>>
>>and binding an integer parameter, id to the statment :
>>
>>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); }
>>
>> 
>>
>>    
>>
>The code looks fine, I think it will be a issue with the MySQL driver, 
>I would ask the MySQL folk.
>
>--
>Nick Gorham
>Easysoft Limited
>http://www.easysoft.com, http://www.unixODBC.org
>
>_______________________________________________
>unixODBC-support mailing list
>unixODBC-support at easysoft.com
>http://mail.easysoft.com/mailman/listinfo/unixodbc-support
>
>
>
>------------------------------
>
>Message: 2
>Date: Mon, 29 May 2006 17:47:17 +0800
>From: "Nagesh Sharvari-A21337" <sharvari.nagesh at motorola.com>
>Subject: RE: [unixODBC-support] stored procedure with output parameter
>To: "Support for the unixODBC project" <unixodbc-support at easysoft.com>
>Message-ID:
>	<AF187172173696458E171B8DA10D1485A896FC at ZMY16EXM66.ds.mot.com>
>Content-Type: text/plain;	charset="us-ascii"
>
>Nick,
>	I found in the net that MyODBC-3.51 does not support stored 
>procedures. Next version of MyODBC-3.53 will support this. Please see 
>the below URL :
>http://archives.neohapsis.com/archives/mysql/2004-q3/1719.html
>
>	Is this the reason why my code is failing? And also, is this the

>reason why stored procedure calls with syntax {call <stored proc>(?)} 
>also fails?
>
>What is the right syntax to call stored procedures?
>
>Regards
>sharvari
>
>-----Original Message-----
>From: Nagesh Sharvari-A21337
>Sent: Monday, May 29, 2006 11:53 AM
>To: 'Support for the unixODBC project'
>Subject: RE: [unixODBC-support] stored procedure with output parameter
>
>Nick,
>	any update on this? Could you speak to MySQL people?
> 
>
>-----Original Message-----
>From: unixodbc-support-bounces at easysoft.com
>[mailto:unixodbc-support-bounces at easysoft.com] On Behalf Of Nick Gorham
>Sent: Thursday, May 25, 2006 4:45 PM
>To: Support for the unixODBC project
>Subject: Re: [unixODBC-support] stored procedure with output parameter
>
>Nagesh Sharvari-A21337 wrote:
>
>  
>
>>Hey 
>>   I am facing problem executing stored procedures which has an out 
>>parameters. Please tell me what's wrong in my code This is how I am 
>>using call statement to execute a procedure,
>>simpleproc:
>>
>>strcpy(stmt, "call simpleproc(?)") ;
>>rc = SQLPrepare(hstmt,stmt,SQL_NTS);   
>>
>>and binding an integer parameter, id to the statment :
>>
>>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); }
>>
>> 
>>
>>    
>>
>The code looks fine, I think it will be a issue with the MySQL driver, 
>I would ask the MySQL folk.
>
>--
>Nick Gorham
>Easysoft Limited
>http://www.easysoft.com, http://www.unixODBC.org
>
>_______________________________________________
>unixODBC-support mailing list
>unixODBC-support at easysoft.com
>http://mail.easysoft.com/mailman/listinfo/unixodbc-support
>
>
>
>------------------------------
>
>_______________________________________________
>unixODBC-support mailing list
>unixODBC-support at easysoft.com
>http://mail.easysoft.com/mailman/listinfo/unixodbc-support
>
>
>End of unixODBC-support Digest, Vol 21, Issue 14
>************************************************
>  
>

_______________________________________________
unixODBC-support mailing list
unixODBC-support at easysoft.com
http://mail.easysoft.com/mailman/listinfo/unixodbc-support




More information about the unixODBC-support mailing list