AdsDDRenameObject

Advantage Client Engine

Rename a data dictionary object.

Syntax

UNSIGNED32 AdsDDRenameObject( ADSHANDLE hDictionary,

UNSIGNED8 *pucObjectName,

UNSIGNED8 *pucNewObjectName,

UNSIGNED16 usObjectType,

UNSIGNED32 ulOptions );

 

Parameters

hDictionary (I)

Handle of a database connection.

pucObjectName (I)

Name of object to rename.

pucNewObjectName (I)

New name for the object.

usObjectType (I)

Database object type.
Can be ADS_DD_TABLE_OBJECT, ADS_DD_RELATION_OBJECT, ADS_DD_VIEW_OBJECT, ADS_DD_USER_OBJECT, ADS_DD_USER_GROUP_OBJECT, ADS_DD_PROCEDURE_OBJECT, ADS_DD_LINK_OBJECT, ADS_DD_TRIGGER_OBJECT
, ADS_DD_PUBLICATION_OBJECT, or ADS_DD_SUBSCRIPTION_OBJECT

ulOptions (I)

Renaming options. Specifying ADS_KEEP_TABLE_FILE_NAME when renaming table objects will not rename the physical table file.

 

Special Return Codes

AE_INVALID_OBJECT_NAME

The given new object name cannot be already in use by another dictionary object.

AE_TABLE_NOT_EXCLUSIVE

When renaming tables, the table must not be open by any user.

Remarks

AdsDDRenameObject can be used to rename an existing data dictionary object. Renaming tables requires that the table not be open by any user. By default, Advantage Database Sserver will rename the physical file to match the new table's object name. Specifying ADS_KEEP_TABLE_FILE_NAME will cause Advantage Database Server to not rename the physical file.

If the usObjectType parameter specifies a trigger object, the pucObjectName and pucNewObjectName parameters should be qualified with the table name the trigger belongs to followed by two colon characters ( :: ). For example, "Customers::AfterInsertTrig" would specify you want to rename the trigger called "AfterInsertTrig" that belongs to the "Customers" table.

Note Renaming a user while that user is connected is not recommended. The renamed user's permissions will not be affected in any way, but some places where the user name is logged may not reflect the user's new name.

 

Note Scripts, views, etc which contain references to renamed objects will not be automatically modified to reflect name changes.

See Also

sp_RenameDDObject