Re: Recompile after table changes?
Posted in 1998
David wrote: > > Hi, > > After altering a table to add/delete/modify columns, is it necessary > to recompile all the 4GL's that access the table? Yes, unless the new columns are appended to the end of the row and you do not care about them AND you NEVER do stuff like 'SELECT *' or 'INSERT INTO mytable VALUES' without a column list. Since you have fallen into the 'RECORD LIKE mytable.*' trap I would venture to say you are also doing these very dangerous things so yes you will have to recompile. > Many of the source programs have variables defined such as: > > p_plmst RECORD LIKE plmst.* > > I would have thought the the currently compiled program would, at > runtime, pick up the changes and that a recompile was not necessary. No. Just the opposite. The record definition is extracted from the database at compile time and hard coded in to the generated .ec program or the pcode (for R4GL). If you have C4GL add the -keep option to be able to view the generated .ec program so you can understand better exactly what is going on under the hood. > Of course, I am aware that I need to check all source code for > instances where a complete record is read into, for example, an array > that matchs a complete table and in this case the array layout has to > match the table layout. Then you already know the answer to your question except for misunderstanding the functioning of the RECORD LIKE syntax. > BTW, we are running on RDS 4.20, SE 5.10. I'm sorry to hear that. It is past time for you to upgrade. Think about doing that. The RDS/C4GL versions 6.xx and 7.xx each added new features and improved bugs and performance. SE 7.xx includes the new 7.xx optimizer. Art S. Kagel