how extend the READ statement?
Author: email@example.com (istiller)
Hi Just a "simple" question into the round: "how extend the READ statement"? background: We have to implement some kind of treatment on every read row from database. This includes DISCARDS if special condtions are envountered. Currently we ddo this by a global proc called after the READ in READ-trigger. My idea is to replace also the READ statement itself, so that there is (normal) only one line in READ-Trigger Before
read call SO_READ_AFT() What I want is
call SO_READ("") So far so good But what if you have to apply conditions and/or order directives? First idea was, to expand the parameter list of SO_READ by a few arguments like v_CONDITION, v_ORDER, ... But there are two drawback
- Performance: On every "read" (not only "retrieve") I have to considerd parameters to use the correct READ statement
- Compile-time checks of the entitys and fields in question are not done
So I tought about precompiler statments, but is it not possible to define function-macros like C/C++ One have to write something like this:
#define entity=A_ENT #define order=FLD1:a #define condition= #include SO_READ Drawback
- Don't forget to define/undefine, elsecase the next #include could run into trouble.
- It's not readable
So once again the simple question "how extend the READ statement" ? Ingo