Kbase 15892: How to change _FILE-TRIG._TRIG-CRC using 4GL ?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/05/1998 |
|
How to change _FILE-TRIG._TRIG-CRC using 4GL ?
INTRODUCTION:
=============
This technical Support document describes how to change value of
_file-trig._trig-crc field. This can also serve as a guide how to
change any of the values stored in database schema definition.
WHY YOU NEED TO KNOW THIS:
===========================
This document arose when a customer had built trigger procedures using
include files (.i) and after he changed one of the includes in has
impact on crc in about 500 trigger procedures. The question afterwards
was how to update the schema? The only solution except the one
described below was go through whole database schema and save all the
triggers manualy to get the field storing CRC for triggers updated.
After some consultation we have found a good solution which does all
the manual work for you with a little effort.
PROCEDURAL APPROACH:
====================
- first modify your includes
- recompile all the trigger procedures
- run the following code:
DEFINE BUFFER ftbuf FOR _file-trig.
DEFINE VARIABLE savevnt LIKE _file-trig._event.
REPEAT PRESELECT EACH _file-trig WHERE _file-trig._trig-crc NE ?:
FIND NEXT _file-trig.
DISPLAY "Compiling:" _file-trig._proc-name.
COMPILE VALUE(_file-trig._proc-name) SAVE NO-ERROR.
IF NOT COMPILER:ERROR THEN
DO:
RCODE-INFO:FILE-NAME = _proc-name.
CREATE ftbuf.
ASSIGN
ftbuf._proc-name = _file-trig._proc-name
ftbuf._file-recid = _file-trig._file-recid
savevnt = _file-trig._event
ftbuf._override = _file-trig._override
ftbuf._trig-crc = RCODE-INFO:CRC-VALUE.
DELETE _file-trig.
ASSIGN
ftbuf._event = savevnt.
END.
ELSE MESSAGE "Couldn't compile:" _file-trig._proc-name VIEW-AS
ALERT-BOX.
END.
ONLINE PROCEDURES OR UTILITIES:
===============================
REFERENCES TO WRITTEN DOCUMENTATION:
====================================
Progress Software Technical Support Note # 15892