home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / database / oracle / 2911 < prev    next >
Encoding:
Internet Message Format  |  1993-01-22  |  2.3 KB

  1. Path: sparky!uunet!hayes!fgreene
  2. From: fgreene@hayes.com
  3. Newsgroups: comp.databases.oracle
  4. Subject: Re: How Do you Do this in Forms 3.0?    
  5. Message-ID: <6675.2b5f944b@hayes.com>
  6. Date: 22 Jan 93 06:29:31 EDT
  7. References: <1993Jan18.171828.14440@kodak.kodak.com> <1993Jan21.152213.14740@stortek.com>
  8. Distribution: na
  9. Organization: Hayes Microcomputer Products, Norcross, GA
  10. Lines: 45
  11.  
  12. In article <1993Jan21.152213.14740@stortek.com>, v045100@otis1.stortek.com (Jennifer Farnham) writes:
  13. > Setup: One block, multiple records.
  14. >        User may query on all fields or one,
  15. >          or combination of.
  16. > Problem: How do I let the user know before or
  17. >          after, how many records there query will produce?  I know the user could
  18. > have pressed "count query hits", but I want to
  19. > do this for the user. I can not user COUNT_QUERY
  20. > procedure as it is a packaged procedure (restricted),
  21. > and it won't work in a pre-query or post-query.
  22. > I can't hard code the query, cause the user makes
  23. > it different each time.
  24. > ANY IDEAS?
  25. > Jenny
  26. > v045100@otis1.stortek.com
  27. > Boulder, Colorado
  28.  
  29. The easiest way is to utilize two calls to the data base.  On the first,
  30. retrieve just a count of the records and then, on the second, execute the
  31. actual query.  Assume a local variable XCOUNT.  The first read would be
  32.  
  33.     SELECT COUNT(*)
  34.     INTO   xcount
  35.         FROM   the_table
  36.         WHERE  the_condition(s);
  37.  
  38. You then need to add a user prompt message and reply.  If the user indicates
  39. the desire to actually retrieve the data then execute the query.
  40.  
  41.  ----------------------------------------------------------------------------
  42.  |      Frank Greene                  |          //////  //////             |
  43.  |      DELPHI SYSTEMS, Inc.          |           ////    ////              |
  44.  |      Telephone [615] 458-6032      |          ////    ////  //////       |
  45.  |      Compuserve 74200,427          |         ////    ////    ////        |
  46.  |      324 Ootsima Way               |        ////    ////    ////         |
  47.  |      Loudon, TN 37774              |       //////  //////  //////        |
  48.  ----------------------------------------------------------------------------
  49.  |         Of course, any opinions or suggestions are strictly my own       |
  50.  ----------------------------------------------------------------------------
  51.  
  52.