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>


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:

  1. in ORATERM (or CRT) assign a key to "function key 0" (any of 0-9 will do).
  2. write a user exit in Pro*Whatever which:
  3. opens a file
  4. copies the value of SYSTEM.LAST_QUERY to a local variable
  5. performs a "type 4" dynamic query using that variable
  6. fetches each row and writes it to the file in any format you like
  7. 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:
  8. opens a file
  9. copies the value of SYSTEM.LAST-QUERY to a local variable
  10. writes the variable to the file
  11. closes the file
  12. calls the o/s to peform a SQLPLUS / _at_filename
  13. link the user exit into your very own version of IAP
  14. in SQLFORMS write a KEY-F0 trigger which:
  15. 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
Received on Thu Jul 09 1992 - 01:12:33 CEST

Original text of this message