EssLROUpdateObject

Stores an updated version of an LRO on the server.

Syntax

ESS_FUNC_M EssLROUpdateObject (hCtx, plinkId, usOption, pLRODesc);
ParameterData TypeDescription

hCtx

ESS_HCTX_T

API context handle.

plinkId

ESS_LROHANDLE_API_T

Pointer to object identification structure.

usOption

ESS_USHORT_T

Option specifying whether to store the object, its catalog entry, or both. Use one of the following:

  • ESS_LRO_OBJ_API stores only the object.

  • ESS_LRO_CATALOG_API stores only the catalog entry.

  • ESS_LRO_BOTH_API stores the object and the catalog entry.

pLRODesc

ESS_LRODESC_API_T

Pointer to object's description structure.

Notes

Return Value

If successful, returns ESS_STS_NOERR. Otherwise, returns an error code.

Access

A call to this function requires write privileges (ESS_PRIV_WRITE) to the active database.

Example

ESS_STS_T ESS_LRO UpdateObject (ESS_HCTX_T hCtx)
{
        ESS_STS_T               sts = ESS_STS_NOERR;
        ESS_LROHANDLE_API_T     linkId;
        ESS_LRODESC_API_T       lroDesc;
        ESS_USHORT_T            usOption = 2;   /* Default is catalog */

        memset (&linkId, 0, sizeof(ESS_LROHANDLE_API_T));
        memset (&lroDesc, 0, sizeof(ESS_LRODESC_API_T));

        linkId.hObject = 25;
        linkId.cellKey.cellOffset = 149;
        linkId.cellKey.blkOffset = 113.0;
        linkId.cellKey.segment = 0.0;

        /* Linked object is a LRO. (Windows Application) */
        lroDesc.usObjType = 1;

        /* Update both object and catalog */
        usOption = ESS_LRO_BOTH_API; 
        strcpy (lroDesc.lro.lroInfo.objName, "e:\\lro\\lroex.c");
        strcpy (lroDesc.lro.lroInfo.objDesc, "My C file");  

        strcpy (lroDesc.userName, "user1");
        lroDesc.linkId.hObject = linkId.hObject;

        sts = EssLROUpdateObject(hCtx, &linkId, usOption, &lroDesc);
        if (sts)
        {
                printf("Could not update linked object.\n");
        }
        return sts;
}

See Also