• 0

[MySQL] Procedures and session variables help


Question

Any MySQL experts here who've worked with 5.0's Procedures and session variables?

My issue is about the relationship between procs and session variables (@variablename). When are session variables used, as opposed to declared proc variables?

In particular I'm trying to write a stored proc to do URL decoding which involves finding all instances of the percent sign (%) in a string, and replacing the percent + following 2 bytes with the UNHEX'd value of those two bytes. I found an example of this being done at this URL:

http://dev.mysql.com/doc/refman/5.0/en/string-functions.html

The code is to be found in a comment dated June 28 2005 8:46pm.

The code looks good to me, but I don't understand how the string is being iterated through, and I feel that may be due to my lack of understanding of how session variables are used. I'm trying to adapt that code in the comment to a stored proc, and MySQL won't seem to allow usage of session variable syntax in my stored proc definition.

Any help would be greatly appreciated!

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.