Larry Adkins wish: $entinfo($entname,"fieldlist")

Author: ulrichmerkel@web.de (ulrich-merkel)

Larrys Use Case I have a global proc that fills in auditing information into fields that exist in every database table upon write. I want to add another audit field into database tables but it will take some time to implement. If I had this new topic, I could check for the existence of this new field before trying to write to it. ****************************** Hi Larry, based on the JAVA reflection, there is a dITo concept to include repository infos like the db-fields of an entity into included procs. This goes for entities as well as components and have includes for the defines trigger like painted entities as well as routines like the dito_entinfo which will be best placed in the collection operations or the dito_componentinfo which may return even the component comment etc.

7 Comments

  1. From the wishlist: Theo Neeskens July 23, 2013 at 3:37 pm Status = Closed Although there may be other uses for the proposed syntax enhancement, the use case can easily be met using the $fieldname function. if ($fieldname("AUDITDATE") "") AUDITDATE = $date endif


    Author: ulrich-merkel (ulrichmerkel@web.de)
  2. Something went wrong with the formatting here if ($fieldname("AUDITDATE") <> "") AUDITDATE = $date endif


    Author: Theo Neeskens (tneeskens@itblockz.nl)
  3. Thanks Theo, I just copied&paste your comment. But the mysterious layout-eating ghost striked again (hope some admin can do something against this loss)


    Author: ulrich-merkel (ulrichmerkel@web.de)
  4. ulrich-merkel said Theo Neeskens July 23, 2013 at 3:37 pm Status = Closed Although there may be other uses for the proposed syntax enhancement, the use case can easily be met using the $fieldname function. if ($fieldname("AUDITDATE") "") AUDITDATE = $date endif

    I dont think the wish can be closed only because there is an other way to implement the example in the use case, because "there may be other uses for the proposed syntax enhancement".


    Author: ulrich-merkel (ulrichmerkel@web.de)
  5. Hello, what's the point of that wish? To be honest, I just can't get it. Smile We use $entinfo for global proc purposes. There are serveral functions to use... $selectlist(ENT), $entinfo(ENT, "PAINTEDFIELDS"), $fieldname(FIELD), $fieldinfo(FIELD, "PAINTED") - and we use all of them (and others of course, e.g. $entinfo INNER and OUTER). I am still thinking of your wish... what should it return? What whould it be for? What would be the differenece between that and $selectlist? Zdeněk


    Author: sochaz (zdenek.socha@fullsys.cz)
  6. ulrich-merkel said Hi Larry, based on the JAVA reflection, there is a dITo concept to include repository infos like the db-fields of an entity into included procs.

    Hi Larry et. al, if you are interested in the dITo concept, just send me an email (mailform on my homepage). It's fast, it's easy and we, the customers, can control it.


    Author: ulrich-merkel (ulrichmerkel@web.de)
  7. The following code snippte is used to generate an include proc. with dITo, it's easy to extend and you have it now: entry OCC_UCTABLE #define OCC_UCTABLE variables string v_templist endvariables call DUR_UTIL_CLEARBUFFER() call DUR_UTIL_ADDDEF("DURT_DESCR",UDESCR.UCTABLE,"") call RETR_UCKEY("U_VLAB=%%U_VLAB.UCTABLE%%%·;U_TLAB=%%U_TLAB.UCTABLE%%%·;U_KTYP=P") call DUR_UTIL_ADDDEF("DURT_PKFIELDS",U_FLABS.UCKEY,"") call CLEAR_UCKEY() call RETR_UCFIELD("U_VLAB=%%U_VLAB.UCTABLE%%%·;U_TLAB=%%U_TLAB.UCTABLE%%%") v_templist = "" putlistitems v_templist, U_FLAB call DUR_UTIL_ADDDEF_CSV("DURT_FIELDS",v_templist,"") call CLEAR_UCFIELD() call DUR_UTIL_WRITE("DUR_%%U_VLAB.UCTABLE%%%" %\ ,U_TLAB.UCTABLE,"by DUR %%$DATIM%%%","") end ; OCC_UCTABLE and it generates: #comment by DUR 22-aug-13 08:46:50 #define DURT_DESCR=support write INCL.PROCs ; DURT_DESCR defined as '<DURT_DESCR>' #define DURT_PKFIELDS= ; DURT_PKFIELDS defined as '<DURT_PKFIELDS>' #define DURT_FIELDS=CODE_BUFFER,BLOCK_BUFFER,BLOCK_SEQ ; DURT_FIELDS defined as '<DURT_FIELDS>'


    Author: ulrich-merkel (ulrichmerkel@web.de)