Retrieving and Processing resultset of stored procedures

DBMS - MySql5.0.1-alpha:
Driver - myodbc 3.51:

I created a table in my database over command line.
mysql> create table
customers(firstname,familyname,address,telno,accountno,firm)

Filled it with records and tested it - it worked.
Then I created a stored procedure:
delimiter $
mysql> create procedure spFirm(IN company char(15), IN year INT)
BEGIN
IF year = 2005 then
select * from customers
where firm = company;
else
select * from customers;
end if;
END$
It was okay and I tested it as follows

mysql> call spFirm('firmname',2005)$
It delivered the right results.

Now I wanted to test and process the results over MyODBC. The connections
were ok.
//...
stmt = "call spFirm('Seqis',2005)$";
ret = SQLExecDirect(hstmt, stmt.c_str(), stmt.Length());
while ((ret = SQLFetch(hstmt)) != SQL_NO_DATA){
SQLRowCount(hstmt, &nRows);
SQLNumResultCols(hstmt, &nCols);
//...
}
Both SQLRowCount (with nRows) and SQLNumResultCols (with nCols) do deliver
0. But when I use normal "select * from customers" - I do get the right
results.

What is the best way to go about stored procedures here? I know (as newbie)
that I'm missing something, but I cannot figure it out.
Who can give me some tipps on how to go about it? Examples are also very
much welcomed.
Thanks in anticipation,
Harp


--
DSL Komplett von GMX +++ Supergünstig und stressfrei einsteigen!
AKTION "Kein Einrichtungspreis" nutzen: http://www.gmx.net/de/go/dsl

--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe: http://lists.mysql.com/myodbc?unsub=gcdmo-myodbc [at] m.gmane.org
harp [ Fr, 04 Februar 2005 12:24 ] [ ID #626072 ]

Re: Retrieving and Processing resultset of stored procedures

hmetu [at] gmx.net wrote:

>DBMS - MySql5.0.1-alpha:
>Driver - myodbc 3.51:
>
>I created a table in my database over command line.
>mysql> create table
>customers(firstname,familyname,address,telno,accountno,firm )
>
>Filled it with records and tested it - it worked.
>Then I created a stored procedure:
>delimiter $
>mysql> create procedure spFirm(IN company char(15), IN year INT)
> BEGIN
> IF year = 2005 then
> select * from customers
> where firm = company;
> else
> select * from customers;
> end if;
> END$
>It was okay and I tested it as follows
>
>mysql> call spFirm('firmname',2005)$
>It delivered the right results.
>
>Now I wanted to test and process the results over MyODBC.
>
>
You can't do that.
Apparently the next major version of MyODBC ( 3.53 I believe ) will
support this.
There is no release date yet.

--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: dkasak [at] nusconsulting.com.au
website: http://www.nusconsulting.com.au

--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe: http://lists.mysql.com/myodbc?unsub=gcdmo-myodbc [at] m.gmane.org
Daniel Kasak [ So, 06 Februar 2005 22:17 ] [ ID #628874 ]

Re: Retrieving and Processing resultset of stored procedures

Russell Sharp wrote:

>I had heard about an alpha of 3.53 being released in January but didn't
>really expect it to happen. Any possibility of it happening soon?
>
>
If you're keen you can download the source via bitkeeper and try to
compile it yourself and see what condition it's in.
I would think twice if you're considering putting this in a production
environment though.

--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: dkasak [at] nusconsulting.com.au
website: http://www.nusconsulting.com.au

--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe: http://lists.mysql.com/myodbc?unsub=gcdmo-myodbc [at] m.gmane.org
Daniel Kasak [ So, 06 Februar 2005 23:59 ] [ ID #628875 ]
Datenbanken » gmane.comp.db.mysql.odbc » Retrieving and Processing resultset of stored procedures

Vorheriges Thema: ODCB Connection, Windows Server 2003
Nächstes Thema: Stored procedures unaccessible via myodbc