× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



No. All wrong.

Let's say your original table (MYTAB) looks like this
R MYTABR
COLA 2A
COLB 2A
COLC 2A
COLD 2A
...
So you copy this to NEWTABLE.
Change the record format to NEWTABLER
Add your new column
COL23 2A
Now you create a logical file called MYTAB over NEWTABLE. You use the record format MYTABR and specify all the fields listed in NEWTABLE except the new one. You give it the record format name of MYTABR.
This new logical file will have the same record format id that the old table MYTAB did. No programs which aren’t using COL23 need to be recompiled.
Instead of accessing NEWTABLE a better practice would have you create an additional logical file, sample MYTAB01. This would contain the new column, COL23. You would use this in the programs which need COL23.
A better practice is creating a logical file which only contains the columns needed by the programs which need COL23.
A better practice is foregoing all these concerns about record format level id's and trash using F specs in your programs and convert to SQL. If you increase the size of a column then your only concern is to match work fields in your programs to the new attributes. Well, that and output columns.

Never use SELECT * in SQL. Always select the columns individually.

InforLX never uses the same record format in their logicals as their physicals. Their logicals pick the columns individually. Their RPG never accesses the physical tables directly. I have added columns to the base physical and never had to recompile their programs, or their logicals. Makes it real nice to add temporal support to their base physical files. As much as I think they could improve their database with primary key constraints, check constraints, referential constraints, etc this part works out nice. I guess the only thing nice I can say about no key on the physical is that it discourages people from coding to that directly.

Rob Berendt

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.