Take the 2-minute tour ×

My company's main database is an iSeries machine, and I have become quite used to working with the DB2 commands and structure. I am right now trying to work on a small side project of updating a table with over 3 million records. I figured a faster way to compare and "scrub" the data would be to host the new file on my workstation with MySQL, compare, clean, THEN upload back into the iSeries.

My problem is not a game stopper, just something that would make life easier. In IBM's world, there is the LABEL ON sql command, which allows you to put a text description on the column names. So instead of reading cstmfld1 I can actually read on a report pulled from the table "Custom Field 1". Is this an IBM only function, or does MySQL have an equivalent? I have looked around quite a bit, and I cannot find anything. Example below.

   CSTMFLD1 TEXT IS "Custom Field 1"
share|improve this question

2 Answers 2

As far as I know, there's no way of doing this in MySQL.

I know this isn't a solution and you're probably already aware of that, but you can name your columns in the select clause, like in every other database I know of :

select table.mycolumn as 'Custom name for column' 
from ...
share|improve this answer
Guessed as much. Thanks for the help. Yeah, I know about the select column naming. Problem is, this table has 300+ columns. Oh well, I only work with a few of the columns anyway. –  JHStarner Mar 15 '11 at 13:15

I think the column headings are stored in the metadata table QSYS2/SYSCOLUMNS. If you run a select statement over this table, you might be able to generate the code to create a mySQL view that uses the column headings as column names.

share|improve this answer

Your Answer


