EssRenameObject

Description

EssRenameObject() renames an existing object on the server or client object system.

Syntax

ESS_FUNC_M EssRenameObject (hCtx, ObjType, AppName, DbName,
OldName, NewName);
ESS_HCTX_ThCtx
ESS_OBJTYPE_TObjType
ESS_STR_TAppName
ESS_STR_TDbName
ESS_STR_TOldName
ESS_STR_TNewName

Parameters

hCtxEssbase API context handle. Can be local context handle returned by EssCreateLocalContext().
ObjTypeobject type (must be single type). Refer to Bitmask Data Types for a list of possible values
AppNameApplication name
DbNamedatabasename. If NULL, uses the Application subdirectory
OldNameOld name of object to rename
NewNameNew name of renamed object. Object names can be 8 characters long, and can contain all special characters allowed in DOS file names. No spaces, commas, backslashes, or periods are allowed.

Return Value

None.

Notes

Access

This function requires the caller to have Application or Database Design privilege (ESS_PRIV_APPDESIGN or ESS_PRIV_DBDESIGN) for the specified application or database containing the object.

Example

ESS_STS_T 
ESS_RenameObject (ESS_HCTX_T hCtx)   
{
   ESS_STS_T         sts = ESS_STS_NOERR;
   ESS_STR_T         AppName;
   ESS_STR_T         DbName;
   ESS_STR_T         OldName;        
   ESS_STR_T         NewName;       
   ESS_OBJTYPE_T     ObjType;     
   
   AppName    = "Sample";
   DbName     = "Basic";
   OldName    = "Test"; 
   NewName    = "NewTest";
   ObjType    = ESS_OBJTYPE_TEXT; 
   
   sts = EssRenameObject(hCtx, ObjType, AppName,
         DbName, OldName, NewName); 

   if(!sts)
      printf("The Object is renamed.\r\n");
 
   return (sts);
}

See Also

EssCopyObject()
EssCreateObject()
EssDeleteObject()
EssListObjects()