MySQL Forums
Forum List  »  Stored Procedures

Stored Procedure returns BLOB
Posted by: C.A. Pelle
Date: September 06, 2012 04:16AM

Hi all,

I've been working with the following setup for a while without problems. Recently I damaged the configuration of my mySQL server seriously, such that I installed the 5.5.27.2 instead of the previously installed 5.5.23.0
Also I didn't recover the configuration files of the previously installed version, but use a new one instead.

What I do:

I have stored procedures like this one:

CREATE DEFINER=`myDB`@`localhost` PROCEDURE `xx_p_myTableName`(out id integer)
BEGIN
set id = gen_id(\'xx_p_myTableName\',1);
END

And from C++, I do:

TDataSet * pDS = Connection.NewQuery("call " + "xx_p_myTableName" + "(@id)");
Connection.Execute(*pDS);
Connection.SetCommandText(*pDS, "select @id");
pDS->Open();
if( ! pDS->IsEmpty() )
{
long lReturn;
lReturn = (*pDS->Fields)[0]->AsInteger;
}

etc etc

(This was only recreated from my head, so please forgive me if I left out a colon or any other spellings)

However, since I reinstalled mySQL, I get an error, that the field cannot be accessed as integer.

I added the following:

TField * pMyField = (*pDS->Fields)[0];

and found out that pMyField is of type BLOB.
I also found out that the BLOB has a size of 1.

I can't think of a way to access the result of my procedure with this result-type.
Can anyone help, please?

Thanks in advance!
Regards,
CaP.

Edit: Additional Info: If I execute the above statements from mySQL workbench instead of a C++ program, the results show just fine.



Edited 1 time(s). Last edit at 09/06/2012 04:27AM by C.A. Pelle.

Options: ReplyQuote


Subject
Views
Written By
Posted
Stored Procedure returns BLOB
3472
September 06, 2012 04:16AM
1043
September 07, 2012 08:45AM
1872
September 10, 2012 01:48AM
1099
September 24, 2012 02:46AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.