home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / database / oracle / 2726 < prev    next >
Encoding:
Internet Message Format  |  1993-01-08  |  2.9 KB

  1. Path: sparky!uunet!hayes!fgreene
  2. From: fgreene@hayes.com
  3. Newsgroups: comp.databases.oracle
  4. Subject: Re: PL/SQL and FORMS30 questions
  5. Message-ID: <6635.2b4d363a@hayes.com>
  6. Date: 8 Jan 93 08:07:22 EDT
  7. References: <1ii7jjINNoi3@terminator.rs.itd.umich.edu>
  8. Distribution: world
  9. Organization: Hayes Microcomputer Products, Norcross, GA
  10. Lines: 48
  11.  
  12. In article <1ii7jjINNoi3@terminator.rs.itd.umich.edu>, pha@citi.umich.edu (Paul H. Anderson) writes:
  13. > Howdy,
  14. > I have several problems with sqlforms30 that are really hanging me up:
  15. > 1) setting the date in a displayed, but non-enterable field.
  16. >    I have a pre-record trigger that is attempting to automatically
  17. >    store the date of entry into a base table field.  If I convert the
  18. >    date, and store it in some other enterable field (e.g. a character
  19. >    comment field), etc, it shows up. (hence the trigger is working like I want).
  20. >    Likewise, if I set the field to be enterable, I can have it's value
  21. >    appear there (override any default value).
  22. >    However, when I do the fairly obvious, which is to set a displayed,
  23. >    but non-enterable date field equal to sysdate, nothing shows up.
  24. >    How can I do this?
  25.  
  26.     Try using a PRE-INSERT / PRE-UPDATE trigger (one or both, depending
  27.     on your circumstances) to set the field to SYSDATE.
  28. > 2) getting a unique sequence number into a pl/sql local variable.
  29. >    I need to use a trigger to call a host program with a unique
  30. >    number.  To do this, I need to get the unique number into a
  31. >    local pl/sql variable.  I can use insert into <record> values (seq.nextval)
  32. >    to put it into the record, but I don't know how to get the record
  33. >    back out (since there are multiple forms users).  Apparently, the
  34. >    implementation context of the sequence makes it difficult for a
  35. >    trigger to get the value.  Any clues?
  36.  
  37.     You are apparently inserting the sequence numberdirectly into the
  38.     data table.  Try creating it to a field in the form and then 
  39.     commiting / updating the record.  In this fashion, you will still
  40.     have a copy of the number after the record is committed.
  41.  
  42.     If you are moving across forms, store the sequence in a global
  43.     variable and then retrieve it a s needed.
  44.  
  45.  ----------------------------------------------------------------------------
  46.  |      Frank Greene                  |          //////  //////             |
  47.  |      DELPHI SYSTEMS, Inc.          |           ////    ////              |
  48.  |      Telephone [615] 458-6032      |          ////    ////  //////       |
  49.  |      Compuserve 74200,427          |         ////    ////    ////        |
  50.  |      324 Ootsima Way               |        ////    ////    ////         |
  51.  |      Loudon, TN 37774              |       //////  //////  //////        |
  52.  ----------------------------------------------------------------------------
  53.  |         Of course, any opinions or suggestions are strictly my own       |
  54.  ----------------------------------------------------------------------------
  55.