RE: Help! 4GL Program Question.
Posted in 2000
It depends how real time this has to be Might you have a trigger to insert the primary key of table 1 into a table 2. Have the second program query the second table as often as you like, and bring new records up from table 1, and delete the entry in table 2. You might throw a datetime into table 2 as well Requires no programming changes for the inserting program, and only makes me flinch a little. Will >===== Original Message From "Dennis Pimple" <dennisp@informix.com> ===== >Chetan Anand <canand@systems.dhl.com> wrote in message >news:38B46FD4.E4EC75E@systems.dhl.com... >> Daniel: >> >> Use trigger on the insert table in conjuction with an SPL. >> >... which would do a SYSTEM call to launch the 2nd 4GL program, is where I >think Chetan was headed. If the 2nd 4GL program is already running, however, >you will have to be in a polling loop of some sort; there's no good way to >raise an event that branches program logic in 4GL (outside of the normal >MENU, INPUT, etc statements). Which means if your end user is supposed to be >doing something else while waiting for the 1st program to insert the row, >you're in trouble. > >If it's ok for the 2nd program to be "idle" waiting for the insert, the >problem is surmountable: > >prepare a cursor with the select statement that gets the row from the first >4gl program >let int_flag = false >while true > open the cursor > fetch the cursor > if sqlca.sqlerrd = notfound then > sleep for a bit > else > call the function that displays the row > exit while # ? if you want to leave after a successful fetch; >otherwise continue looping > # make sure the inserted row is deleted or modified so the same row >won't be fetched again. > end if > if int_flag = true then > # if the user hits the interrupt key, they can break out of the loop >before a row is fetched > let int_flag = false > exit while > end if >end while > >Or some variation of the above. > >The only other approach I can think of is 'c'-level calls that can post >interrupts to the program and force branching. I think it could be done, but >not by moi. > >> > Hi: >> > I have two INFORMIX 4GL programs.I want if the first one insert a >row >> > into the database,the second one can trap this and do some display on >it's >> > screen.Can I do it with 4GL only,Or I must use C instead. >> > Please Help Me! >> > I'll killed if I can't finished the project this weekend! >> > >> > My email is pangq@zhej.piccnet.com.cn >> > >> > Any and all information is welcome. >> > >> > Thanks, >> > >> > Danny > > >-- >======================================================= >Dennis J. Pimple Informix Software, Inc. >Principal Consultant 6300 S Syracuse Way Ste 205 >dennisp@informix.com Englewood CO 80111 >office: 303-850-0210 >direct: 303-740-5611 Opinions expressed are mine, > fax: 303-779-4025 and do not necessarily > reflect those of my employer. > >http://www.informix.com ------------------------------------------------------------ This e-mail has been sent to you courtesy of OperaMail, as a free service from Opera Software, makers of the award-winning Web Browser, Opera. Visit us at http://www.opera.com/ or our portal at: http://www.myopera.com/ Your free e-mail account is waiting at: http://www.operamail.com/ ------------------------------------------------------------