Connecting Tech Pros Worldwide Forums | Help | Site Map

Global Constants for mysql stored procedures!

Member
 
Join Date: Feb 2009
Posts: 57
#1: Jul 3 '09
Hi,

Can i declare some global constants in mysql, so that it can be used by all the stored procedures??

Thanks in advance,
Lauren

Member
 
Join Date: Aug 2007
Posts: 119
#2: Jul 4 '09

re: Global Constants for mysql stored procedures!


Yes. Use SET GLOBAL as described here.
Member
 
Join Date: Feb 2009
Posts: 57
#3: Jul 4 '09

re: Global Constants for mysql stored procedures!


Thanks a lot for the reply. But can you please tell where all these global variables get stored, i mean will this be a separate file from where we can access for all the stored procedures and where we need to set these global variables?


Thanks,
Lauren
Member
 
Join Date: Aug 2007
Posts: 119
#4: Jul 4 '09

re: Global Constants for mysql stored procedures!


The variables are stored in memory. Even global variables are volatile. When the application is started, global variables default to their original value. If you want to store a value that will be used the next time the application runs, you need to save that to a file and then retrieve it in your coding.

You set the global variables in your coding as described in the article referenced above.
Reply


Similar MySQL Database bytes