× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




The first part in the subprocedure may be a
Select;
When not %error;
  // skip the rest
  // should be low overhead, eh?
When %status= ....;  // duplicate key
  // duplicate key
  ...
When %status = ....; // code for constraint violation
  // check the message stack for constraint term
  ..
...
Other;
  // egads
Endsl;
So I wouldn't think there'd be that much overhead if there wasn't an
error.  To truly make this generic you might want it to pass back something
like the standard error data structure used by most API's.  Depends on how
you want to handle that with your user interface.

I once had to code a system, in original PC Basic, that had to 'chain' out
to every file in the sequence.  For example on a transaction it was not
enough to chain out to the item master.  If the item master had a class,
then you had to chain out to the item class and make sure that it was still
there, and so on and so forth.  This was for a barcoding application and
needed second or less response.  (And the barcode was on garments washed
with very harsh chemicals so getting a good scan was a trick in
itself.  Ask the guy who had SERIOUS damage done to his foot by spilling
the solution on it.)  A good database system, (like DB2/400), that was
actually turned on (with referential constraints, etc), would have gone a
long way to helping alleviate the project requests.


Rob Berendt
--
Group Dekko Services, LLC
Dept 01.073
PO Box 2000
Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com


|-----------------------------+-------------------------------------------|
|   "Joe Pluta"               |                                           |
|   <joepluta@xxxxxxxxxxxxxxxx|                                           |
|   m>                        |                                         To|
|   Sent by:                  |                                    "'Midra|
|   midrange-l-bounces@midrang|                                    nge    |
|   e.com                     |                                    Systems|
|                             |                                    Technic|
|   07/26/2004 11:54 AM       |                                    al     |
|                             |                                    Discuss|
|         Please respond to   |                                    ion'"  |
|         Midrange Systems    |                                    <midran|
|       Technical Discussion  |                                    ge-l@mi|
|      <midrange-l@xxxxxxxxxxx|                                    drange.|
|                m>           |                                    com>   |
|                             |                                         cc|
|                             |                                           |
|                             |                                    Subject|
|                             |                                    RE:    |
|                             |                                    Single |
|                             |                                    record |
|                             |                                    access |
|                             |                                    really |
|                             |                                    require|
|                             |                                    d (was |
|                             |                                    RE:    |
|                             |                                    Views  |
|                             |                                    and    |
|                             |                                    Indexes|
|                             |                                    )      |
|                             |                                           |
|                             |                                           |
|                             |                                           |
|                             |                                           |
|                             |                                           |
|                             |                                           |
|-----------------------------+-------------------------------------------|






> From: rob@xxxxxxxxx
>
> The problem with that logic is then it is required in every Query, etc
> that
> uses it.  Therefore if you had a view with
> SELECT iim.IPROD, iim.IDESC, iim.ICLAS, MyUDF(IGLOVR, iim.ICLAS,
:cust) as
> GL#
> FROM iim
> All this complication would be hidden from every use of the GL#.  Not
only
> from query, but also not buried in your application programs.  Sort of
> like
> externalizing I/O.

Actually, I would externalize the I/O, Rob.  This particular code would
definitely be located in a server somewhere; I wouldn't repeat it. And
you're still hung up on queries - a large amount of business programming
involves intermediate results that are never really seen by end users.

In any case, I've shown you my code, which I wrote in about 30 seconds.
However, you still haven't shown me how the SQL version is written.  You
have a magic "MyUDF" which I'd like to see the code to.

I'm also confused about something else: weren't you complaining about
how having DDS means you need another source member?  Doesn't creating
UDFs like this mean you have different source members for each field?
(I could be wrong, I'm not that clear on the whole UDF thing.)


> The second part is not all that clunky if you consider that it could
be a
> subrocedure called after every write.  I would think that one
subprocedure
> should work for all your files.

"I would think".  I'd be interested to see the code for this.  Then I'd
want to see just how much overhead is added to every write if I had a
common subroutine.  Then I'd weigh that against the need to do the
check. I'd think very carefully about whether or not my programming
practices are such as to make checking every WRITE a necessity.  Then
I'd weigh the extra coding and overhead against the added database
integrity.

As always, it's a business decision.

Joe


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.