Tag Archives: stored procedure

A generic framework of a stored SQL procedure to split a string

When programming MySQL stored procedures, sometime we need something like the string split function in other programming languages. Unfortunately MySQL does not provide a string split function. To fulfill the work, I searched online and piece information from multiple sources … Continue reading

Share
Posted in Database, MySQL | Tagged , , , | Leave a comment

A PHP example to generate WordPress-like category list

In one of my post I described a way to use SQL stored procedure to extract data in a particular order and then generate a list. you can find the post from the following link. A SQL stored procedure to … Continue reading

Share
Posted in PHP, Tips | Tagged , , , | Leave a comment

A SQL stored procedure to combine multiple select sets into one

The data table include id, parent_id, title and position. Parent_id is one of the ids in the table. So it is self referenced table. The goal is to extract all records in a particular order, order the records based on … Continue reading

Share
Posted in MySQL | Tagged , , | 1 Comment

Using MySQL stored procedure to create a sort list

I have a table that includes recursive data columns. All information is used to generate a dropdown list or option list. In this example, a two layers table is used. It will be easy to extend the examples to the … Continue reading

Share
Posted in MySQL | Tagged , , , , , , , | Leave a comment

Handling UTF8 charset correctly in MySQL stored procedure

When using MySQL Workbench version 5.2.32 ref 7496 to insert utf8 encoding data to tables through stored procedures, a problem was encountered. All utf8 encoding characters were converted to “?” in the table. However, when directly using insert statement, everything … Continue reading

Share
Posted in Tips | Tagged , , , , , , | Leave a comment