# EsbOtlCopyAliasTable

Description

EsbOtlCopyAliasTable() copies an alias table to another alias table.

Syntax

    EsbOtlCopyAliasTable (hOutline, pszSourceAliasTable, pszDestAliasTable, fMerge)

    ByVal hOutline            As Long
    ByVal pszSourceAliasTable As String
    ByVal pszDestAliasTable   As String
    ByVal fMerge              As Integer

Parameters

hOutline | Outline context handle.
pszSourceAliasTable | Name of alias table to copy from. If this parameter is "", the default alias table is used.
pszDestAliasTable | Name of alias table to copy to.
fMerge | Set to ESB_YES to merge the source file into the existing destination alias table. Set to ESB_NO to clear the destination alias table before copying.

Return Value

Returns 0 if successful; otherwise one of the following:

OTLAPI_BAD_ALIASTABLE
OTLAPI_ERR_MAXALIASTABLES
OTLAPI_ERR_ALIASTABLENAME

Notes

- If the destination alias table does not exist, it is created. If the destination alias table exists, it is cleared first, unless the fMerge flag is set to ESB_YES.
- The maximum number of alias tables in a single outline (including the default table) is 10.

Example

    Declare Function EsbOtlCopyAliasTable Lib
    "ESBOTLW" (ByVal hOutline As Long, ByVal pszSourceAliasTable
    As String, ByVal pszDestAliasTable As String,
    ByVal fMerge As Integer) As Long

    Sub ESB_OtlCopyAliasTable()
    Dim sts As Long
    Dim Object As ESB_OBJDEF_T
    Dim hOutline As Long

    Object.hCtx = hCtx
    Object.Type = ESB_OBJTYPE_OUTLINE
    Object.AppName = "Sample"
    Object.DbName = "Basic"
    Object.FileName = "Basic"

    sts = EsbOtlOpenOutline(hCtx,
    Object, ESB_YES, ESB_YES, hOutline)

    If sts = 0 Then
       sts = EsbOtlCopyAliasTable
        (hOutline, "", "Alias Table 2", ESB_YES)
    End If
    End Sub

See Also

EsbOtlCreateAliasTable()
EsbOtlClearAliasTable()
EsbOtlRenameAliasTable()
EsbOtlDeleteAliasTable()