{{tag>category:"OpenInsight 16-Bit" author:"Don Miller - C3 Inc." author:"Oystein Reigem" author:"Revelation Software Technical Support" author:"Richard Bright" author:"Donald Bakke"}}
[[https://www.revelation.com/the-works|Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community]]
==== How to deploy a large # of Dict Changes (OpenInsight 16-Bit) ====
=== At 10 JAN 2003 01:36:55PM Don Miller - C3 Inc. wrote: ===
I need to deploy a fair number of dictionary changes to a number of Runtimes (16/32 Bit). I have a program written in AREV 3.12 which will do this, but it isn't useful in a general sense.
Here is the code I use. Questions:
1. I know I can convert this to a stored procedure which presumably can be deployed.
2. How can I get it to deploy and then execute during the installation of an upgrade.
***********Source Code Follows**************
**********************************************************************
*PROGRAM: UP_DICT
*COPYRIGHT 2000 2001, 2002
* C3 INC.
* 3 BARNARD LANE
* BLOOMFIELD, CT 06002
* (800) 243-9583
*
* PURPOSE: INSTALL DICTIONARY CHANGES INTO SP&T
* WINDOWS OR MS-DOS NORMAL FILES AND TUTORIAL FILES
*
**********************************************************************
* MUST BE COMPILED TO DOS \OIDATA\CONVERT\UP_DICT WITH THE (CL) OPTION
DECLARE SUBROUTINE MSG
$INSERT SYSINCLUDE,STATUS.CONSTANTS
MSG('Type YES to Update All Dictionaries/Data Files','RECE',RESP)
IF RESP NE 'YES' THEN STOP
BUF='
STATUP(PUSH$,'',BUF) ;* SAVE THE STATUS LINE
PERFORM "ATTACH \OIDATA\CONVERT"
FILE.LIST='
OPEN 'FILES' TO FILES THEN
PERFORM 'SELECT FILES WITH F1=\OIDATA\CONVERT" BY @ID (S)'
IF @RECCOUNT =\OIDATA\CONVERT' THEN
FILE.LIST=REC
END
END
GOTO L0:
END
END
MSG.TXT=Files / Dictionaries to be installed OR upgraded:|':FILE.LIST
MSG.TXT:=||To halt this process press + now ...'
MSG.TXT:=|When you get to the Debugger, type END'
MAP='
MAP=M'
MAP=C'
MSG(MSG.TXT,MAP,'','')
* IF RESP=CHAR(27) THEN STOP
FILE.COUNT=COUNT(FILE.LIST,@FM)+1
IMAGE='
MSG('Installing Dictionary/File Changes|Please Wait..','UB',IMAGE,'')
EQU TESTING TO 0 ;* set to 1 to test
IF TESTING=1 THEN DEBUG
FOR I=1 TO FILE.COUNT
SFN=FILE.LIST[i]
DFN=SFN
* replacements end in the tag _NEW
SWAP "_NEW" WITH "" IN DFN
DFLAG=0
IF SFN1,5=DICT.' THEN DFLAG=1 ;* DICTIONARY FLAG
OPEN SFN TO FILE.IN ELSE
MSG('ERROR OPENING SOURCE FILE: ':SFN)
GOTO NEXTI
END
* FIRST DO LIVE FILE
* THERE ARE "LIVE" FILES AND TUTORIAL FILES
EXECUTE 'ATTACH \OIDATA\SPT ':DFN
OPEN DFN TO FILE.OUT ELSE
* NOT THERE .. CREATE IT
EXECUTE 'MAKETABLE \OIDATA\SPT ':DFN:' (S)'
OPEN DFN TO FILE.OUT ELSE
MSG('ERROR CREATING DESTINATION TABLE: ':DFN)
GOTO NEXTI
END
END
IF DFLAG=1 THEN
STATUP(SINGLE$,3,'Working On ':DFN)
PERFORM 'SELECT ':SFN:' WITH TYPE=F""G""S" AND WITH INDEXED=0' ;* don't overwrite index items
IF TESTING=0 THEN PERFORM 'COPY ':SFN:' (O) TO:(':DFN
* do the tutorial file
EXECUTE 'ATTACH \OIDATA\SPT_TUTO ':DFN
OPEN DFN TO FILE.OUT ELSE
* NOT THERE .. CREATE IT
EXECUTE 'MAKETABLE \OIDATA\SPT_TUTO ':DFN:' (S)'
OPEN DFN TO FILE.OUT ELSE
MSG('ERROR CREATING DESTINATION TABLE: ':DFN)
GOTO NEXTI
END
END
PERFORM 'SELECT ':SFN:' WITH TYPE=F""G""S" AND WITH INDEXED=0'
IF TESTING=0 THEN PERFORM 'COPY ':SFN:' (O) TO:(':DFN
END ELSE
* NOT A DICTIONARY - COPY THE TABLE RECORDS IN
STATUP(SINGLE$,3,'Working On ':DFN)
IF TESTING=0 THEN
EXECUTE 'ATTACH \OIDATA\SPT ':DFN
OPEN DFN TO FILE.OUT ELSE
EXECUTE 'MAKETABLE \OIDATA\SPT ':DFN:' (S)'
OPEN DFN TO FILE.OUT ELSE
MSG('ERROR CREATING DESTINATION TABLE ':DFN)
GOTO NEXTI
END
END
EXECUTE 'COPY ':SFN:' * (O) TO:(':DFN
* do the tutorial
EXECUTE 'ATTACH \OIDATA\SPT_TUTO ':DFN
OPEN DFN TO FILE.OUT ELSE
* NOT THERE .. CREATE IT
EXECUTE 'MAKETABLE \OIDATA\SPT_TUTO ':DFN:' (S)'
OPEN DFN TO FILE.OUT ELSE
MSG('ERROR CREATING TABLE: ':DFN)
GOTO NEXTI
END
END
EXECUTE 'COPY ':SFN:' * (O) TO:(':DFN
END
END
NEXTI:
STATUP(SINGLE$,3,'')
NEXT I
STATUP(POP$,'',BUF)
MSG('','DB',IMAGE,)
STOP
****************************************************
Thanks in advance for any help ..
Don Miller
C3 Inc.
----
=== At 10 JAN 2003 03:20PM Oystein Reigem wrote: ===
Don,
[i]2. How can I get it to deploy and then execute during the installation of an upgrade.[/i]
If I get you right this is the kind of stuff I need to know soon myself.
But if I get you right this is also the kind of stuff I thought [i]you[/i] knew. I read some earlier posting of yours which indicated you did.
My first thought was that the execution of the procedure should be possible to do in the %PROCESS% part of the installation. I haven't got the RDK manual with me here now, but by looking in the online help I found out it's RDKModuleInstall that does the relevant procesing. RDKModuleInstall is unfortunately not docced in the online help, but OI contains the source. RDKModuleInstall uses an insert RDKDeploy_Equates which lists a bunch of "sections" with a promising [i]EXECUTE PROCEDURES[/i] among them.
My assumption was that the %PROCESS% stuff runs last, after all the normally deployed rows have been copied in, your procedure among them. But according to this posting by Aaron Kaplan %PROCESS% runs [i]first[/i]: . This means you must copy your procedure in %PROCESS%, before executing it. I assume a suitable [i]UPDATE ROWS[/i] section could manage that.
(If that is impossible for some reason I would suggest a workaround with [i]two[/i] deployments - one for copying in the procedure and one for running it. Both deployments could be wrapped in [i]one[/i] InstallShield installation.)
- Oystein -
----
=== At 10 JAN 2003 03:24PM Revelation Software Technical Support wrote: ===
Don-
Emulate the RDK procedures.
Make a sysupgrade table.
In the %process% record, put the list entries in the format of (filename/recordname)- ie
UPDATE ROWS
DICT.SYSAPPS/UTF8_ENABLED
DICT.SYSREPOSLANGUAGE/APP_ID
DICT.SYSREPOSLANGUAGE/CONTROL_NAMES
DICT.SYSREPOSLANGUAGE/ENGLISH_TEXT
DICT.SYSREPOSLANGUAGE/ENTITY_ID
Copy the dictionary record into the sysupgrade file with a key of filename/recordname.
Send out the file to client.
Client runs RDKINSTALL 'dir_where_file_is'
Simple as that.
----
=== At 10 JAN 2003 06:20PM Richard Bright wrote: ===
Oystein,
I have used the general method (as outlined by the RevSoft Tech Support) for yonks. This doesnt have to be a Dict only RDKInstall, use it whenever Dict items need to be refreshed as part of periodic updates.
Stored Proceedures: Using the RDKInstall its possible to deploy a stored proceedure, call it to carry out a process and then later on remove the stored proceedure - all as part of the RDKInstall process. That is the RDKInstall is very flexable.
----
=== At 11 JAN 2003 06:31AM Oystein Reigem wrote: ===
Richard, RevSoftTechSupp,
Thanks. I'll need both methods.
Hope Don got the help he needed too.
- Oystein -
----
=== At 11 JAN 2003 06:45AM Don Miller - C3 Inc. wrote: ===
----
=== At 11 JAN 2003 06:58AM Don Miller - C3 Inc. wrote: ===
Oystein, et. al.
Sorry for the blank post, the key got me.
I know how to copy a small # of dict elements. They problem with this upgrade is that I need to copy several hundred Dict items and, possibly create new tables along the way. In addition, the needed table(s) may not be attached AND I need to swap tables on the fly. For example, I have a table named PATIENT (which contains live user data) which is located in \OIDATA\SPT). I also have a table with the same name in \OIDATA\SPT_TUTO which contains sample information for tutorial exercises. When running the app, the user can switch to the tutorial exercises for refresher training or to check whether a particular task will work for them.
The process that I can run from an AREV runtime can do this easily by simply starting AREV and running RUN DOS \OIDATA\UP_DICT from a TCL. However, I want to stop having to install a runtime single-user AREV system as part of my app and secondly it is essentially non-productive to have to run 2 upgrades. I try not to deploy dictionary chages as part of an RDK because I have found that deploying table changes by including DICT items by including them has usually been error prone. The changes seem to get installed into the production system but invariably don't get installed in the tutorial unless the user re-starts the app in the tutorial account and then re-runs the RDKINSTALL again.
It seems that the RDKMODULEINSTALL only processes the DICT item once and it can't be included twice. However, If I could be sure that the stored procedure would be copied first and then run AFTER the other changes have been installed, I think it would work properly. Hence, my post.
Don Miller
C3 Inc.
----
=== At 11 JAN 2003 12:19PM Donald Bakke wrote: ===
Don,
Have you tried to create multiple UPDATE ROWS sections separated by the necessary DETACH TABLES and ATTACH TABLES sections? Like this:
UPDATE ROWS
* Dictionary changes here
DETACH TABLES
PATIENT
ATTACH TABLES
\OIDATA\SPT_TUTO/PATIENT/SPT
UPDATE ROWS
* Dictionary changes here
If you absolutely must call a stored procedure then you'll probably have to embed another UPDATE ROWS followed by an EXECUTE PROCEDURES section to make sure it executes when you need it. The entries created with the RDK UI get copied over [i]after[/i] the %PROCESS% items do.
dbakke@srpcs.com
[url=http://www.srpcs.com]SRP Computer Solutions, Inc.[/url]
[img]http://www.srpcs.com/srpicon1.gif[/img]
[[https://www.revelation.com/revweb/oecgi4p.php/O4W_HANDOFF?DESTN=O4W_RUN_FORM&INQID=WORKS_READ&SUMMARY=1&KEY=78DE6361308DF7DB85256CAA0066421E|View this thread on the Works forum...]]