Printing SQL*Forms Queries
From: <dlm_at_hermes.dlogics.com>
Date: 8 Jul 92 17:12:33 CST
Message-ID: <1992Jul8.171233.1283_at_hermes.dlogics.com>
Date: 8 Jul 92 17:12:33 CST
Message-ID: <1992Jul8.171233.1283_at_hermes.dlogics.com>
gavin_at_ewd.dsto.gov.au (Gavin Clark) writes:
> I have found the system.last_query variable which should be what I need.
> I would like to assign a trigger(?) to a single function key that would
> execute the
> last query made and spool it to a disk file.
> Am I on the right track?
Yes, you are on the right track. I used this technique:
- in ORATERM (or CRT) assign a key to "function key 0" (any of 0-9 will do).
- write a user exit in Pro*Whatever which:
- opens a file
- copies the value of SYSTEM.LAST_QUERY to a local variable
- performs a "type 4" dynamic query using that variable
- fetches each row and writes it to the file in any format you like
- closes the file NOTE: this can become complicated if you don't know how many select columns to bind. there's an alternative, if you don't mind the overhead, and have enough memory to do it:
- opens a file
- copies the value of SYSTEM.LAST-QUERY to a local variable
- writes the variable to the file
- closes the file
- calls the o/s to peform a SQLPLUS / _at_filename
- link the user exit into your very own version of IAP
- in SQLFORMS write a KEY-F0 trigger which:
- calls the user exit -- Dave Mausner, Senior Consultant / Datalogics Inc / Chicago IL / 312-266-4450 dlm_at_dlogics.com Motto: Just show me the code