# EsbUpdate

Description

EsbUpdate() sends an update specification to the active database as a single string.

Syntax

    EsbUpdate (hCtx, isStore, isUnlock, updQuery)

    ByVal hCtx     As Long
    ByVal isStore  As Integer
    ByVal isUnlock As Integer
    ByVal updQuery As String

Parameters

hCtx | Essbase VB API context handle.
isStore | Controls storage of data. If TRUE, data is stored in the server; if FALSE, no data is stored.
isUnlock | Controls unlocking of data blocks. If TRUE, all relevant blocks which are locked will be unlocked (after data is stored, if necessary). If FALSE, no blocks are unlocked.
updQuery | The update specification, as a single string (must be less than 32 KBytes).

Return Value

None.

Notes

- This function is equivalent to making a call to EsbBeginUpdate(), followed by calls to EsbSendString() and finally EsbEndUpdate(). The updated data can either be stored in the database, or just verified and any errors returned. Also, any data blocks locked for update can be unlocked by this call.
- The update specification string must be less than 32 KBytes long.
- If this function causes data to be stored (Store flag is TRUE), the relevant data blocks must previously have been locked for update (e.g. by calling EsbReport() with the Lock flag set to TRUE).
- If the caller attempts to write data it does not have permission to write to a database member, a warning is generated, and the database member is not updated.
- If both the Store and Unlock flags are set to FALSE, the database merely performs a syntax check of the update specification.

Access

This function requires the caller to have write privilege (ESB_PRIV_WRITE) to the active database.

Example

    Declare Function EsbUpdate Lib "ESBAPIW" (ByVal hCtx As Long, ByVal Store As Integer, ByVal Unlock As Integer, ByVal Query As String) As Long

    Sub ESB_Update ()
       Dim sts As Long
       Dim Store As Integer
       Dim pUnlock As Integer
       Dim Query As String

       Query = "Year Market Scenario AcItemss Product 12345"

       Store = ESB_YES
       pUnlock = ESB_NO

       '*******
       ' Update
       '*******
       sts = EsbUpdate (hCtx, Store, pUnlock, Query)
    End Sub

See Also

EsbBeginUpdate()
EsbEndUpdate()
EsbReport()
EsbSendString()
EsbUpdateFile()