|
A helpful hint, for those who are using 'create table' for the first time.
Since SQL doesn't know what a record format is, when using the create
table DDL to build physicals it names it the same as the table.
You have two choices when using them natively in RPG, since the record
format can't be the same as the file name.
You can rename the record format on all the F' specs in the RPG
programs that use them, or you can do this little trick, creating the
table as the record format name and then renaming it - the record
format stays the same.
My SQL create table source look like this:
-- create table (name is the record format name, not table)
create table
mylib/myfiler
(
fld_one for column MFFLD1 character(7) not null default ' ',
fld_two for column MFFLD2 character(20) not null default ' ',
primary key(
MFFLD1
)
) ;
--- rename table so that record name is different than table name
rename table mylib/myfiler
to system name myfile;
--- text on table
label on table
mylib/myfile is 'my table description ' ;
--- set column headings
label on column
(
MFFLD1 is 'Field One ' ,
MFFLD2 is 'Field Two '
) ;
--- set text (optional, it will use colhdg if not included)
label on column
mylib/myfile
(
MFFLD1 text is 'Field One ' ,
MFFLD2 text is 'Field Two '
) ;
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.