Auto open 4GL form when record inserted...
Posted in 1999
Topics: Stored Procedures & SPL, Connectivity: ESQL/C, 4GL & Embedded SQL, Triggers, Constraints & Referential Integrity
I will be developing several data entry screens with 4GL-RDS. The application is a call center system which needs to open up a screen (with the newly written record display in the form) when a remote monitoring unit dials up the Informix system and writes a record to an alarm table. I would like to know if it's possible to launch a 4GL form this way, via a trigger or otherwise. The database runs on UNIX, and the clients will be Windows based PCs. If anyone has done this before and would like to share the code, or, if that's too personal, then a "pseudo-coded" outline on how to achieve this, I would greatly appreciate it. Thanks. MoJo Risin Sent via Deja.com http://www.deja.com/ Before you buy.
A good way would be to have a process which is continuously polling the database for an alert record, and when it does it runs an alert-display program with the alert-number as a parameter. This would work in anybody's 4gl. Visit http://www.querix.com/ before you decide. mojo_risin@my-deja.com wrote: > I will be developing several data entry screens with 4GL-RDS. The > application is a call center system which needs to open up a screen > (with the newly written record display in the form) when a remote > monitoring unit dials up the Informix system and writes a record > to an alarm table. > > I would like to know if it's possible to launch a 4GL form this way, > via > a trigger or otherwise. > > The database runs on UNIX, and the clients will be Windows based PCs. > > If anyone has done this before and would like to share the code, or, if > that's too personal, then a "pseudo-coded" outline on how to achieve > this, I would greatly appreciate it. > > Thanks. > > MoJo Risin > > Sent via Deja.com http://www.deja.com/ > Before you buy.
Is the term "alert" (as used below) a 4GL function or feature? Or, is it just your generic description for a type of record to search for? -- In article <381DBB09.DBD47DE1@querix.com>, Mehdi <mehdi@querix.com> wrote: > A good way would be to have a process which is continuously polling the > database for an alert record, Would a trigger be a good way to implement this? And, what if many records come in at one time. . . . 10, 100, 1000. . . how would your idea keep track of the last displayed record? > and when it does it runs an alert-display > program with the alert-number as a parameter. Can you be a little more descriptive on the "alert-display" program running. . . . . in what kind of window (GUI, CUI). > This would work in anybody's > > 4gl. > > Visit http://www.querix.com/ before you decide. > > mojo_risin@my-deja.com wrote: > > > I will be developing several data entry screens with 4GL-RDS. The > > application is a call center system which needs to open up a screen > > (with the newly written record display in the form) when a remote > > monitoring unit dials up the Informix system and writes a record > > to an alarm table. > > > > I would like to know if it's possible to launch a 4GL form this way, > > via > > a trigger or otherwise. > > > > The database runs on UNIX, and the clients will be Windows based PCs. > > > > If anyone has done this before and would like to share the code, or, if > > that's too personal, then a "pseudo-coded" outline on how to achieve > > this, I would greatly appreciate it. > > > > Thanks. > > > > MoJo Risin > > > > Sent via Deja.com http://www.deja.com/ > > Before you buy. > > Sent via Deja.com http://www.deja.com/ Before you buy.
mojo_risin@my-deja.com wrote:
> Is the term "alert" (as used below) a 4GL function or feature? Or, is
> it just your generic description for a type of record to search for?
> --
> In article <381DBB09.DBD47DE1@querix.com>,
> Mehdi <mehdi@querix.com> wrote:
> > A good way would be to have a process which is continuously polling
> the
> > database for an alert record,
>
> Would a trigger be a good way to implement this?
Not really, you might be able to get the trigger to fire off an
application, but it would run on the Unix server which isn't what you
want. Consider the following table (this is just bear bones):
CREATE TABLE my_alerts(alert_no serial,
alert_text char(80));
MAIN
DEFINE cur_nr,new_nr LIKE my_alerts.alert_no
DEFINE runstr CHAR(256)
SELECT MAX(alert_no) INTO cur_nr FROM my_alerts
DECLARE alert_crs AS SELECT alert_no FROM my_alerts WHERE
alert_no > cur_nr
WHILE TRUE
FOREACH alert_crs INTO new_nr
LET runstr = 'alertprog ',new_nr
RUN runstr WITHOUT WAITING
LET cur_nr = new_nr
END FOREACH
SLEEP 5
END WHILE
END MAIN
This will run one instance of "alertprog" for each record in my_alerts, if
you only every want one instance of program alertprog, the problem becomes
a little more difficult. You can either make the system only spawn a
single alert viewer each time round the loop, which would cut down on
spamming a bit, or, if you are expecting a lot of alerts:
1) Create a database table with a single row which indacates whether
the viewer is running.
This has disadvantages if the viewer program is terminated
abnormally.
or 2) You will require some 'c' code to try to determine if the
viewer program is running
>
>
> And, what if many records come in at one time. . . . 10, 100, 1000. . .
> how would your idea keep track of the last displayed record?
>
> > and when it does it runs an alert-display
> > program with the alert-number as a parameter.
>
> Can you be a little more descriptive on the "alert-display" program
> running. . . . . in what kind of window (GUI, CUI).
In this instance the alert display program can be anything you want
(GUI/CUI).
Visit http://www.querix.com/ before you decide.
>
>
> > This would work in anybody's
> >
> > 4gl.
> >
> > Visit http://www.querix.com/ before you decide.
> >
> > mojo_risin@my-deja.com wrote:
> >
> > > I will be developing several data entry screens with 4GL-RDS. The
> > > application is a call center system which needs to open up a screen
> > > (with the newly written record display in the form) when a remote
> > > monitoring unit dials up the Informix system and writes a record
> > > to an alarm table.
> > >
> > > I would like to know if it's possible to launch a 4GL form this way,
> > > via
> > > a trigger or otherwise.
> > >
> > > The database runs on UNIX, and the clients will be Windows based
> PCs.
> > >
> > > If anyone has done this before and would like to share the code, or,
> if
> > > that's too personal, then a "pseudo-coded" outline on how to achieve
> > > this, I would greatly appreciate it.
> > >
> > > Thanks.
> > >
> > > MoJo Risin
> > >
> > > Sent via Deja.com http://www.deja.com/
> > > Before you buy.
> >
> >
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
In article <381EDA52.DBCC3CDC@querix.com>,
Mehdi <mehdi@querix.com> wrote:
>
>
> mojo_risin@my-deja.com wrote:
>
> > Is the term "alert" (as used below) a 4GL function or feature?
Or,
is
> > it just your generic description for a type of record to search
for?
> > --
> > In article <381DBB09.DBD47DE1@querix.com>,
> > Mehdi <mehdi@querix.com> wrote:
> > > A good way would be to have a process which is continuously
polling
> > the
> > > database for an alert record,
> >
> > Would a trigger be a good way to implement this?
>
> Not really, you might be able to get the trigger to fire off an
> application, but it would run on the Unix server which isn't what you
> want.
Actually, I was thinking about having the X-Windows Motif 4GL version
run (I am UNIX application literate, not Microsoft) and "pop" open a
window on an X-server running on a PC/XTerm/NC.
> Consider the following table (this is just bear bones):
>
> CREATE TABLE my_alerts(alert_no serial,
> alert_text char(80));
Where would you run the code below? I'm very rusty with Informix's 4GL
and have not worked with triggers or stored procedures.
The way I understand what triggers do is that per some action, a
trigger
will perform some action or function. I would like this action to
open
up a new window (in an X-window environment) with the newly inserted
record in the 4GL form.
> MAIN
> DEFINE cur_nr,new_nr LIKE my_alerts.alert_no
> DEFINE runstr CHAR(256)
>
> SELECT MAX(alert_no) INTO cur_nr FROM my_alerts
>
> DECLARE alert_crs AS SELECT alert_no FROM my_alerts WHERE
> alert_no > cur_nr
>
> WHILE TRUE
> FOREACH alert_crs INTO new_nr
> LET runstr = 'alertprog ',new_nr
> RUN runstr WITHOUT WAITING
> LET cur_nr = new_nr
> END FOREACH
> SLEEP 5
> END WHILE
> END MAIN
>
> This will run one instance of "alertprog" for each record in
my_alerts, if
> you only every want one instance of program alertprog, the problem
becomes
> a little more difficult. You can either make the system only spawn a
> single alert viewer each time round the loop, which would cut down on
> spamming a bit, or, if you are expecting a lot of alerts:
>
> 1) Create a database table with a single row which indacates whether
> the viewer is running.
> This has disadvantages if the viewer program is terminated
> abnormally.
>
> or 2) You will require some 'c' code to try to determine if the
> viewer program is running
My ideal method would be as follows, please comment:
1. New record is inserted into alert table which opens a 4GL form
to display in a window WITH the new record in it.
Questions
a. Is the method described by Mehdi a better way, or is a trigger
the better way since I will be running this from the UNIX
server
b. Is it possible to start up a 4GL form with a specified record
in it when the form is displayed? And, what's the function
or syntax to do this?
2. 4GL form is run and displayed as a native X application, or, as a
character based application in an xterm window (ie xterm -fn 9x15 -fb
9x15b -e <4GL_form_app>
3. User closes 4GL form when finished
Thanks.
MoJo Risin
--
<snip>
Sent via Deja.com http://www.deja.com/
Before you buy.
mojo_risin@my-deja.com wrote:
> In article <381EDA52.DBCC3CDC@querix.com>,
> Mehdi <mehdi@querix.com> wrote:
> >
> >
> > mojo_risin@my-deja.com wrote:
> >
> > > Is the term "alert" (as used below) a 4GL function or feature?
> Or,
> is
> > > it just your generic description for a type of record to search
> for?
> > > --
> > > In article <381DBB09.DBD47DE1@querix.com>,
> > > Mehdi <mehdi@querix.com> wrote:
> > > > A good way would be to have a process which is continuously
> polling
> > > the
> > > > database for an alert record,
> > >
> > > Would a trigger be a good way to implement this?
> >
> > Not really, you might be able to get the trigger to fire off an
> > application, but it would run on the Unix server which isn't what you
> > want.
>
> Actually, I was thinking about having the X-Windows Motif 4GL version
> run (I am UNIX application literate, not Microsoft) and "pop" open a
> window on an X-server running on a PC/XTerm/NC.
With QueriX compiler you would not need any X-server or terminal emulator
if the clients are Microsoft, avoiding any over head of XTerm. However
you should run the application on the server as the clients are Thin
clients.
>
>
> > Consider the following table (this is just bear bones):
> >
> > CREATE TABLE my_alerts(alert_no serial,
> > alert_text char(80));>
> Where would you run the code below? I'm very rusty with Informix's 4GL
> and have not worked with triggers or stored procedures.
>
> The way I understand what triggers do is that per some action, a
> trigger
> will perform some action or function. I would like this action to
> open
> up a new window (in an X-window environment) with the newly inserted
> record in the 4GL form.
>
> > MAIN
> > DEFINE cur_nr,new_nr LIKE my_alerts.alert_no
> > DEFINE runstr CHAR(256)
> >
> > SELECT MAX(alert_no) INTO cur_nr FROM my_alerts
> >
> > DECLARE alert_crs AS SELECT alert_no FROM my_alerts WHERE
> > alert_no > cur_nr
> >
> > WHILE TRUE
> > FOREACH alert_crs INTO new_nr
> > LET runstr = 'alertprog ',new_nr
> > RUN runstr WITHOUT WAITING
> > LET cur_nr = new_nr
> > END FOREACH
> > SLEEP 5
> > END WHILE
> > END MAIN
> >
> > This will run one instance of "alertprog" for each record in
> my_alerts, if
> > you only every want one instance of program alertprog, the problem
> becomes
> > a little more difficult. You can either make the system only spawn a
> > single alert viewer each time round the loop, which would cut down on
> > spamming a bit, or, if you are expecting a lot of alerts:
> >
> > 1) Create a database table with a single row which indacates whether
> > the viewer is running.
> > This has disadvantages if the viewer program is terminated
> > abnormally.
> >
> > or 2) You will require some 'c' code to try to determine if the
> > viewer program is running
>
> My ideal method would be as follows, please comment:
>
> 1. New record is inserted into alert table which opens a 4GL form
> to display in a window WITH the new record in it.
> Questions
> a. Is the method described by Mehdi a better way, or is a trigger
> the better way since I will be running this from the UNIX
> server
> b. Is it possible to start up a 4GL form with a specified record
> in it when the form is displayed? And, what's the function
> or syntax to do this?
>
> 2. 4GL form is run and displayed as a native X application, or, as a
> character based application in an xterm window (ie xterm -fn 9x15 -fb
> 9x15b -e <4GL_form_app>
>
> 3. User closes 4GL form when finished
>
> Thanks.
>
> MoJo Risin
> --
> <snip>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
--
Compliments of QueriX
--------------------------------------------------------------------------------------------------
QueriX 4GL Compilers are Informix 4GL Compatible. Some features are:
True Windows GUI Clients.
ActiveX support.
HTML Report Generation.
More rigorous error handling.
Connection to all versions of Informix 4GL with no need to change compiler.
Connection to other RDBMS such as Oracle.
For more details visit: http://www.querix.com/
---------------------------------------------------------------------------------------------------