# EsbOtlRestructure

Description

EsbOtlRestructure() restructures an outline on the server. This is an asynchronous call.

Syntax

    EsbOtlRestructure (hCtx, usRestructType)

    ByVal hCtx           As Long
    ByVal usRestructType As Integer

Parameters

hCtx | Server login context handle. This must be the server on which the outline was saved using EsbOtlWriteOutline().
usRestructType | Type of restructuring to do. This can be one of the following values: ESB_DOR_ALLDATA ESB_DOR_INDATA ESB_DOR_LOWDATA ESB_DOR_NODATA

Return Value

Returns 0 if successful; otherwise:

OTLAPI_BAD_RESTRUCTTYPE

Notes

- The caller must have saved the outline using EsbOtlWriteOutline() before calling this function.
- This call is only valid for outlines saved to the server.
- This call is asynchronous. You should call EsbGetProcessState() after making this call until EsbGetProcessState() returns a status indicating the restructure operation is complete.
- In order for data to be properly restructured (saving data), the outline must have been opened using EsbOtlOpenOutline() with the fKeepTrans flag set to ESB_YES.

Access

This function requires you to have the appropriate level of access to the specified application and/or database to contain the outline object. To restructure the outline object, you must have Application Designer or Database Designer privilege (ESB_PRIV_APPDESIGN or ESB_PRIV_DBDESIGN) for the specified application or database containing the outline.

Example

    Declare Function EsbOtlRestructure Lib
    "ESBOTLW.DLL" (ByVal hCtx As Long, ByVal
    usRestructType As Integer) As Long

    Sub ESB_OtlRestructure()
    Dim hCtx As Long
    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)

    '***
    'body of code
    'write outline to server using
    'EsbOtlWriteOutline()
    '***
    If sts = 0 Then
       sts = EsbOtlRestructure(hCtx, ESB_DOR_ALLDATA)
    End If
    '***
    'need to call EsbGetProcessState()
    'to check for completion before proceeding
    '***
    End Sub

See Also

EsbOtlOpenOutline()
EsbOtlNewOutline()
EsbOtlWriteOutline()
EsbOtlVerifyOutline()
EsbOtlCloseOutline()