AutoSYNC Software User's Guide (Update 17)

Triggers
HP AutoSYNC User’s Guide522580-018
6-7
TRIGGERONFILESET Example
TRIGGERONFILESET Example
Change the library pointer in object files GETME and GETMETOO to GETUL after
synchronizing the entire object subvolume to a location with a different name:y
Note on Triggers that invoke SQLCI
Users wishing to invoke SQLCI in a trigger must refer to a TACL macro containing the
SQLCI commands, instead of including the SQLCI command in the string of the trigger.
For example, the trigger invoked with the command:
will fail with the following error message reported in the log:
SYNC $data.objd.* TO \paris.$datab.objp.*,
TRIGGERONFILESET "RUN TRFIXLIB #DESTFSET";
==========================================================================
== Name: TRFIXLIB
==
== Purpose: Change library pointer in objects GETME and GETMETOO to GETUL
== after the object subvolume has been synchronized to a
== location with a different name
== Usage:
== SYNC $data.objd.* TO \paris.$datab.objp.*,
== TRIGGERONFILESET "RUN TRFIXLIB #DESTFSET";
==
== Note that the macro assumes the objects and user library reside on the
== same subvolume.
==========================================================================
?tacl macro
#frame
#push file dummy bind_out
#push objv objsv
== Go extract the vol and subvol names from the destination file set
#setmany file dummy,[#filenames %1%]
#set objv [#fileinfo /volume/ [file]]
#set objsv [#fileinfo /subvol/ [file]]
== Change the library pointers
#output
#output Pointing objects GETME, GETMETOO to library [objv].[objsv].GETUL
[#if not [#empty [#inlineprocess]] |then| #inlineeof]
#set #inlineprefix // [#push #inlineprefix]
bind/name,inline,outv bind_out/
// change library [objv].[objsv].GETUL in [objv].[objsv].GETME
// change library [objv].[objsv].GETUL in [objv].[objsv].GETMETOO
#output
#outputv bind_out == Force display to record in log file
#inlineeof
#unframe
SYNC $data.test.sqacct TO \paris.$datab.testb.sqacctb,
TRIGGER "SQLCI ALTER TABLE #SYNCFILE
AUDIT;EXIT;";
FILE OPEN ERROR - $RECEIVE - file in use (12) ;