Author Archives: phe1129

Split String in MySQL

The easiest way to split string based on the delimiter is using loop. But it is also the most inefficient way. The following is to demonstrate how to use a utility table number and a scalar function to split a … Continue reading

Posted in MySQL | Leave a comment

String concatenation gotcha

In SQL Server, there are a few ways to concatenate string values from a column in a table, e.g. using FOR XML TYPE method. The following example is another method we all use: USE tempdb; GO CREATE TABLE MyTestTable (id … Continue reading

Posted in SQL server | Leave a comment

T-SQL Suggestion: Support GROUP_CONCAT

MySQL has a handy aggregation function GROUP_CONCAT to concatenate string when grouping data. AFAIK, SQL Server lacks the similar functionality. So I created a MS connect item for this feature support. Please vote at:

Posted in SQL server | Leave a comment

Change MySQL data folder on SELinux

When installing MySQL on SELinux (Security Enhanced Linux), you may get the following errors in mysqld.log if you changed the default data directory for mysql database even you granted all necessary privileges to the user mysql: 111206  1:46:00 [Warning] Can’t … Continue reading

Posted in Linux, MySQL | 10 Comments

Backup related files with Databases by ZRM for MySQL

Zmanda Recovery Manager for MySQL (ZRM for MySQL) is a robust backup and recovery solution for MySQL server. It can also be used to backup files related to databases. In the backup command mysql-zrm-backup, it has an option to specify … Continue reading

Posted in MySQL | Leave a comment

Inconsistency in view column data type

When we crate views in MySQL, the data types of the view columns should be derived from the base tables. However MySQL sometimes goes “extra miles”. USE test; DROP TABLE IF EXISTS property; CREATE TABLE property (user_id int not null, … Continue reading

Posted in MySQL | Leave a comment

EDI Address

When you get an EDI document, how can you compose the EDI address? EDI address has the following format: EDI://aaa:bb:cccwhere aaa = ISA06 field, bb = ISA05 field and ccc = GS02 field in EDI document. For example, in the … Continue reading

Posted in BizTalk--EDI | Leave a comment