home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / database / informix / 2496 < prev    next >
Encoding:
Text File  |  1992-11-21  |  3.5 KB  |  74 lines

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