sql - "x FOR y" in column definition of DB2 create table statement -


this db2 create table statement:

create table schema_f.table_a (     leafdescription f7uy2 char(10) ccsid 1141  not null default     ... 

what leafdescription f7uy2 mean exactly?

tl;dr

it allows specify short name usable (older) rpg programs on , system utilities. in case, leafdescription long name usable sql, , f7uy2 usable inside rpg, etc (and sql, long names preferred obvious reasons).


it's part of system-specific behavior available on i.

see, (iseries, systemi, as/400) started out very different machine. several decades ago, before sql thing. , @ time, field , table names limited around 6 characters, , programs written in mind.

now, flash forward when sql comes around. on i, db2 sql got retrofitted (of sort) on top of existing file system. meant that, among other things, query on existing files sql without recreating or repopulating them.
unfortunately, meant stuck original, semi-cryptic names, in part because still had original programs too. if created (or re-created, case may be) table via sql, rpg programs couldn't reference it. allowed specify name could reference - meant switch sql-based tables (which had additional, new, advantages) without needing change programs. name-length restriction being lifted in recent versions of rpg, ability avoid renaming @ once boon.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -