Table of Contents

COPY Method

Description

Method for copying entities.

Syntax

retval = Repository('COPY', entID, destination, source)

Parameters

The COPY method has the following parameters

ParameterDescription
Message'COPY'
destinationThe name of the entity to be created from the copy. The name should be the fully qualified repository id.
sourceThe entity that will be copied. The name should be the fully qualified repository id.

Returns

Use Get_Status() to test for error return.

Note: Always call the Get_Status function after calling Repository().

Remarks

The fully qualified Repository Id consists of four elements, which are '*' (asterisk) delimited:

* Application name

* Type ID

* Class ID

* Entity name

Methods are executed as follows: if class specific, execute at the class level; if type specific, execute at the type level; otherwise, execute the method.

See Also

Repository() function, Get_Repos_Entities(). Also, Stored Procedures chapter in the Guide to Application Development.

Example

/* Copy the source code of the CENTERWINDOW stored procedure to CENTERWINDOW_BACKUP */

Declare Function Get_Repos_Entities, Repository, Get_Status

AppID = @APPID<1>  ;* current application

TypeID = "STPROC"  ;* OpenInsight stored procedures

ClassID = ""  ;* Not Applicable

Stored_Proc_Name = 'CENTERWINDOW'

Backup_Proc_Name = 'CENTERWINDOW_BACKUP'

entid = AppID : '*' : TypeID : '*' : ClassID : '*' : Stored_Proc_Name

backupid = AppID : '*' : TypeID : '*' : ClassID : '*' : Backup_Proc_Name

result = Repository("COPY", backupid, entid)

*  test result

If Get_Status(ErrCode) then

   call msg(@window, 'Error Message returned: ' : ErrCode)

end