Skip navigation links

MySQL Forums :: C/C++ :: Stored Procedures in c


Advanced Search

Re: Stored Procedures in c
Posted by: Gelu Gogancea ()
Date: August 02, 2010 03:08PM

Hi,
If it's working to call a SP using some values for sure will working also if you use
variables.But you must to handle properly this variables.
From your previous code i didn't understand where you set or expect that this variable to have also , values .
You write :

//You insert 3 values of 100
"insert into Sensor_Update values(100,100,100)"

//Here you already have a problem, because nowhere you initialized this
//user variables @a,@b,@c.So here is NULL inserted.So, if you wish
//to work your piece of code must to set some values for your variables.For //example
//SET @a=100;SET @b=50;SET @c=10;
//or
//SELECT @a:=first_field,@b:=second_field,@c:=third_field from Sensor_Update

"insert into Sensor_Update values(@a,@b,@c)"

//also here the @a,@b,@c are NULL
"CALL myprocInsert(@a,@b,@c)"

Regards,

Options: ReplyQuote


Subject Written By Posted
Stored Procedures in c cadd78 cadd 07/26/2010 01:43PM
Re: Stored Procedures in c Gelu Gogancea 07/27/2010 03:40AM
Re: Stored Procedures in c cadd78 cadd 07/27/2010 12:34PM
Re: Stored Procedures in c Gelu Gogancea 08/02/2010 05:23AM
Re: Stored Procedures in c cadd cadd 08/02/2010 09:27AM
Re: Stored Procedures in c Gelu Gogancea 08/02/2010 01:25PM
Re: Stored Procedures in c cadd cadd 08/02/2010 02:37PM
Re: Stored Procedures in c Gelu Gogancea 08/02/2010 03:08PM
Re: Stored Procedures in c cadd cadd 08/03/2010 05:41AM
Re: Stored Procedures in c Gelu Gogancea 08/03/2010 08:57AM
Re: Stored Procedures in c cadd cadd 08/04/2010 06:46AM
Re: Stored Procedures in c Gelu Gogancea 08/04/2010 09:22AM
Re: Stored Procedures in c cadd cadd 08/04/2010 12:31PM
Re: Stored Procedures in c Gelu Gogancea 08/04/2010 03:28PM
Re: Stored Procedures in c cadd78 cadd 08/04/2010 05:34PM


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.