• Sign in to Neowin Faster!

    Create an account on Neowin to contribute and support the site.

  • 0
Sign in to follow this  

[MySQL] Procedures and session variables help

Question

RufioPan    0

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!

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0
RufioPan    0

No SQL people here, eh? :) Alright then...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.