Mailing List
Home
Forum Home
MySQL General - General MySQL discussion
MaxDB - Everything about MaxDB, formerly known as SAP DB
MySQL on Win32 - Runing MySQL on Windows 9x/Me/NT/2000/XP
MySQL++ - Programming with the C++ API to MySQL
ODBC - ODBC with the MySQL Connector/ODBC driver
Java Help - Mostly related to the MySQL Connector/J driver
Perl - Perl support for MySQL with DBI and DBD::mysql
GUI - MySQL GUI Tools
Announcement
Subjects
mysql openssl Question
mysql:it 's a db not a dbms how it 's possible?!
Does the binary log enabling affect the MySQL performances?
Strange behavior, Table Level Permission
FULLTEXT query format question
Preventing Duplicate Entries
Comparing and writing out BLOBS
Executing MySQL Commands From Within C Program
Can 't access mysql after kernel upgrade
Mysql 4 0 Oracle Stored Procedure Trigger Conversion
Downgrade Mysql from 4 to 3 23
MySQL Cluster Software
mysql test 4 1 fails with the gis test
ERROR 2002: Can 't connect to local MySQL server through socket
Getting Identity after INSERT
Update one field with more fields from another table
ERROR 1045: Access denied for user: 'root@localhost ' (Using
password: NO)
mysql have same function mthod as Oracle decode()
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
Retrieving and Processing resultset of stored procedures

Retrieving and Processing resultset of stored procedures

2005-02-04       - By hmetu@(protected)

 Back
Reply:     1     2     3  

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=mysql@(protected)


Earn $52 per hosting referral at Lunarpages.