DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Stop Writing Dialect-Specific SQL: A Unified Query Builder for Node.js
  • Custom Model Context Protocol (MCP) for NL2SQL: A Rigorous Evaluation Framework on Oracle Database
  • Implementing Idempotency in Distributed Spring Boot Applications Using MySQL
  • Using Arrow Flight SQL to Improve Data Transfer Performance in Apache Doris

Trending

  • S3 Vectors: How to Build a RAG Without a Vector Database
  • LLM Integration in Enterprise Applications: A Practical Guide
  • Java in a Container: Efficient Development and Deployment With Docker
  • Clean Code: Concurrency Patterns, Context Management, and Goroutine Safety, Part 5
  1. DZone
  2. Data Engineering
  3. Databases
  4. Urlencode/urldecode As MySQL Stored Functions

Urlencode/urldecode As MySQL Stored Functions

By 
Snippets Manager user avatar
Snippets Manager
·
Aug. 18, 09 · Code Snippet
Likes (5)
Comment
Save
Tweet
Share
13.6K Views

Join the DZone community and get the full member experience.

Join For Free


DELIMITER ;

DROP FUNCTION IF EXISTS multiurldecode;

DELIMITER |

CREATE FUNCTION multiurldecode (s VARCHAR(4096)) RETURNS VARCHAR(4096)
DETERMINISTIC 
CONTAINS SQL 
BEGIN
       DECLARE pr VARCHAR(4096) DEFAULT '';
       IF ISNULL(s) THEN
          RETURN NULL;
       END IF;       
       REPEAT
          SET pr = s;
          SELECT urldecode(s) INTO s;
       UNTIL pr = s END REPEAT;
       RETURN s;
END;

|

DELIMITER ;


MySQL

Opinions expressed by DZone contributors are their own.

Related

  • Stop Writing Dialect-Specific SQL: A Unified Query Builder for Node.js
  • Custom Model Context Protocol (MCP) for NL2SQL: A Rigorous Evaluation Framework on Oracle Database
  • Implementing Idempotency in Distributed Spring Boot Applications Using MySQL
  • Using Arrow Flight SQL to Improve Data Transfer Performance in Apache Doris

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook