tags:

views:

23

answers:

1

Is it possible to mimic ISQL Perform screen functionality (i.e. QBF, master/detail, etc.) with a 4GL program?

+2  A: 

Like all the best answers, Yes, and No.

  • Yes: you can write a program that mimics the parts of the ISQL Perform interface that you want in I4GL. I've got at least two such programs of my own, and I know of two or three others produced by other people.

  • No: a single I4GL program cannot readily be made to handle all possible tables the way ISQL Perform does. The language is not powerful enough to permit that. So, the programs generated under the 'Yes' part of the answer are limited to the specific table that they were designed/written/generated to work against.

I4GL includes the CONSTRUCT statement which does almost everything that the ISQL Perform query option does. The only exceptions are the Perform '>>' and '<<' (maximum and minimum) operators; those require a major rewrite of the query rather than simply a different version of the WHERE clause.

You can code I4GL to handle Master/Detail. It is not incredibly hard, but neither is it trivial. My code generators never formalized that process, though.

Check out the Software Archive at the IIUG (International Informix Users Group) for the immediately available code generators. Contact me if you can't see either 'fglbld' or 'fglgen' there (see my profile).


Frank also asks:

So with I4GL I can have columns from different defined tables on the same screen and master/detail to each table?

Yes. Note that I4GL forms should only have one screen layout per form file (unlike ISQL Perform (sperform) which can have multiple screens in a single file). However, a single I4GL program can use as many forms as it needs to, so this isn't a serious handicap.

Or I can ad-hoc query to any column within the same table and enter my search criteria with the same relops used in Perform, except >> or <<?

Yes.

For a long time, I assumed that sformbld generated an I4GL object module which was executed by sperform (a forms engine). It sure would be nice to have a forms generator like perform built into I4GL for rapid prototyping, then be able to modify the 4GL code to further customize it.

ISQL pre-dates I4GL by a year or so - and is based on the pre-SQL Informix Perform program which is (was) still older. So, that is not how it is done.

One other question: Can Perform screens co-exist within I4GL?

It depends on exactly what you mean. There is a common subset of the Perform language that can be used by both ISQL and I4GL. However, there are many features (such as multiple screens, verify joins, and the instructions such as AFTER EDITADD) that can be used by ISQL but not I4GL, and others (notably screen records and screen arrays) that can be used by I4GL but not ISQL.

Jonathan Leffler
@J.Leffler - ok, so with I4GL I can have columns from different defined tables on the same screen and master/detail to each table?.. or I can ad-hoc query to any column within the same table and enter my search criteria with the same relops used in Perform, except >> or <<?.. For a long time, I assumed that sformbld generated an I4GL object module which was executed by sperform (a forms engine).. It sure would be nice to have a forms generator like perform built into I4GL for rapid prototyping, then be able to modify the 4GL code to further customize it.
Frank Computer
@J.Leffler - One other question: Can Perform screens co-exist within I4GL?
Frank Computer
@Jonathan - What I mean is: Can I have a Perform and an I4GL screen interact with the same database app?
Frank Computer
Well, yes - though I'm not quite sure about the terminology you've used. I regard the Perform screen as one application; I regard the I4GL program as another application. Both can work against the same database, even the same table, as long as the code in the I4GL handles locking issues (Perform does that automatically). The DBMS won't allow uncontrolled updates, but the program may run into locks from another user, especially if you use IDS with page level locking (the default) instead of row level locking. But of course ISQL and I4GL can access the same DB (and tables) at the same time.
Jonathan Leffler