Re: 4gl version 4 to 7 upgrade
Posted in 1998
On Wed, 17 Jun 1998 18:39:47, Malcolm Weallans <onlinedbc@cix.compulink.co.uk> wrote: > >A customer is trying to upgrade about 1000 4GL programs from v4.1 to v7. >They have started encountering problems with facilities which worked before >but don't now. Does anybody have any experience in this area and would be >prepared to share their advice. > >Perhaps we could all collectively compile a list of the problems and >publish this for others to use. I am quite prepared to collate the list. > >The problems encountered so far seem to have been with prepared statements. > Any ideas? In 4.x cursors where local to a source module. In 6.x and 7.x they are global to the program. To avoide problems with this the compiler mangles the name of every cursor so they are uniqually named over the program. The routine that does this isn't perfect though, so you risk getting two cursors with the same name. That can give you very strange behaviour. The program may return no errors at any level but give you the strangest data you have ever seen. Another larger problem with the mangled cursors is when you use "where curren of cursorname" in an update statement. This cursorname will not be mangled, so there is no cursor any longer with this name. The update statement will fail. The easiest way to solve this (which we used) is to use the -globcurs parameter to c4gl (probably with r4gl as well) when you compile. This will prevent the compiler from mangling any cursor name and your update... where current of... will work. However if you have used the same cursor name in two different modules in the same program you get into trouble again. Of course you shouldn't have done that in the first place, but that's hardly interesting if it is used extensively. There is some other solution to the problem of mangled cursors in the update where current of case to use some funtion to create the mangled cursor name. I don't remember what it was, but I assume it is in the release notes. It may however be as easy to make sure that every cursor in every module have a unique name as to introduce such a function. To do that manualy on 1000 4GL programs may be some work, but it could possibly be done automatically via some kind of script. >regards > >Malcolm >Malcolm Weallans >Online Database Consultancy >(+44)1628 672154 Fax (+44)1628 637463 Nils Myklebust NM Data AS Norway E-mail: Nils.Myklebust@nmdata.com FAQ at: http://www.iiug.org/techinfo/faq/faq_top.html (Now with ODBC info under "Third party products".)