home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / database / informix / 2451 < prev    next >
Encoding:
Internet Message Format  |  1992-11-17  |  3.5 KB

  1. Path: sparky!uunet!destroyer!sol.ctr.columbia.edu!emory!emory!not-for-mail
  2. From: jgordon@ssf-sys.DHL.COM (Jim Gordon)
  3. Newsgroups: comp.databases.informix
  4. Subject: Re: Report Writers, Stored Procedures, etc
  5. Date: 17 Nov 1992 20:08:04 -0500
  6. Organization: Mailing List Gateway
  7. Lines: 59
  8. Sender: walt@mathcs.emory.edu
  9. Distribution: world
  10. Message-ID: <1ec51kINNche@emory.mathcs.emory.edu>
  11. Reply-To: jgordon@ssf-sys.DHL.COM (Jim Gordon)
  12. NNTP-Posting-Host: emory.mathcs.emory.edu
  13. X-Informix-List-ID: <list.1616>
  14.  
  15. > My idea was that if Stored Procedures could be used as part of the
  16. > Create view statement in place of the select statement and the Stored
  17. > Procedures had some way of knowing whether an Insert, Delete, Update
  18. > or Select function had been used.  Using this method much of our Data
  19. > Access Module could be replaced by these views which could be used as
  20. > if the underlying database looked like the view but in reality the
  21. > Stored Procedure was handling the work on as many tables as is
  22. > necessary for the business transaction.
  23. >
  24. > etc
  25. >
  26. > Cheers - Jim
  27.  
  28. After considering this idea further I have realised that I am probably
  29. trying to ask for more than is reasonable.  I still think the basic
  30. idea is sound but I had forgotten the necessity for dealing with
  31. select/update/delete "where" clauses that an application might use
  32. against the view.  Also I was, to an extent, confusing the use of a
  33. Stored Procedure in a View and also within a cursor.
  34.  
  35. I still think that being able to but Stored Procedures under views
  36. could be helpful but this is bound to have a performance hit as the
  37. Stored Procedure would have to provide all possible rows to the
  38. external Select/Update/Delete and have the external process select
  39. the correct rows based on the appropriate "where" clause.  This would
  40. mean that no filter or index could be used to speed the process
  41. unless very complex code was written to parse the "where" clause in
  42. the Stored Procedure (Yuck).
  43.  
  44. So having considered this further and before anybody replies I would
  45. like to change my suggestion to extend the use of Stored Procedures
  46. in Cursors.  Currently it is possible to declare a SP as a cursor,
  47. Open it and fetch results from the SP.  I would like to see this
  48. extended so that you can declare the SP as a cursor for update.  Then
  49. you could open it and fetch from it but also be able to pass data
  50. back into it.  Now this could be done using the PUT command familiar
  51. from Insert cursors or UPDATE WHERE CURRENT OF or something new.  It
  52. does not matter as long as it is possible to change the values
  53. originally passed to the SP in the OPEN statement.  One of these
  54. values can be an action identifier used by the SP to know what action
  55. to take with the new data.
  56.  
  57. This facility would be very useful where you have an array of data to
  58. process and do not want the cost of re-opening or re-executing the SP
  59. each time.  This can be a major factor especially if the SP does some
  60. setup work each time.  Also it would allow the SP to handle arrays
  61. and totalling for the transaction instead of needing to write that
  62. into the cursor processing code.
  63.  
  64. I hope that this clarifies my ideas and steps neatly around any
  65. rude comments darting in my direction.
  66.  
  67. Cheers - Jim
  68. --------------------------------------------------------------------
  69. Name:     Jim Gordon               Internet: jgordon@ssf-sys.DHL.COM
  70. Company:  DHL Systems Inc          Phone:    (415) 358-5911 (Work)
  71. Address:  1700 S. Amphlett Blvd.             (415) 882-9728 (Home)
  72.           San Mateo, CA 94402      Fax:      (415) 571-6429
  73. --------------------------------------------------------------------
  74.