开发者

Trying to find an iSeries SQL command equivalent for MySQL. Specifically the "LABEL ON" command

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.

LABEL ON TEST.TABLE
{
   CSTMFLD1 TEXT IS "Custom Field 1"
}


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 ...


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜