Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Constants in Mysql Stored Procedures

 
Sangel Kapoor
Ranch Hand
Posts: 157
1
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Everyone

How can we declare and use the Constants in MySql Stored Procedures like parallel in JAVA is public static final !!!

Thanks !!!
 
Dave Tolls
Ranch Hand
Posts: 2095
15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure I understand what you're after.
Are you asking how to use a constant defined in a MySQL procedure in Java code?
 
Sangel Kapoor
Ranch Hand
Posts: 157
1
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dave

I want to define constants inside stored procedures .
Say i want to use the value of PI in queries at various places inside stored procedure , so i want to define it once at the top as a Constant and use it.
I have take PI just as an example.
 
Dave Tolls
Ranch Hand
Posts: 2095
15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think there is, other than the SET GLOBAL, but that doesn't immediately sound like what you want.
The values don't survive a restart for example, unless set in a file that's loaded on start up.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic