Renames an existing object on the server or client object system.
Syntax
ESS_FUNC_M EssRenameObject (hCtx, ObjType, AppName, DbName, OldName, NewName);
Parameter | Data Type | Description |
---|---|---|
hCtx | ESS_HCTX_T | API context handle. Can be local context handle returned by EssCreateLocalContext(). |
ObjType | ESS_OBJTYPE_T | object type (must be single type). Refer to Bitmask Data Types (C) for a list of possible values |
AppName | ESS_STR_T | Application name |
DbName | ESS_STR_T | database name. If NULL, uses the Application subdirectory |
OldName | ESS_STR_T | Old name of object to rename |
NewName | ESS_STR_T | New name of renamed object. See Object Name Limits. |
Notes
To rename an object, the object must not be locked, and the new object must not already exist.
Outline objects and LRO objects cannot be renamed.
Use the EssRenameDatabase() function to rename a database, including its associated outline.
Objects cannot be renamed across different applications or databases. Use the EssCopyObject() function to copy an object to another application or database.
Return Value
None.
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