Advantage Client Engine
Set the property of an existing article in the data dictionary.
UNSIGNED32 ENTRYPOINT AdsDDSetArticleProperty( ADSHANDLE hDictionary,
UNSIGNED8 *pucPublicationName,
UNSIGNED8 *pucObjectName,
UNSIGNED16 usPropertyID,
VOID *pvProperty,
UNSIGNED16 usPropertyLen );
hDictionary (I) |
A data dictionary connection. |
pucPublicationName (I) |
The name of a publication in the database. |
pucObjectName (I) |
The name of an article in the specified publication. |
usPropertyID (I) |
Index of the property to set. See Remarks for allowed values. |
pvProperty (I) |
Pointer to property value to be stored in the data dictionary. |
pusPropertyLen (I) |
Length of the property pointed to by the pvProperty parameter. |
AE_INVALID_PROPERTY_ID |
Either the value supplied in usPropertyID is not a valid article property, or the specified property cannot be modified. |
AE_INVALID_OBJECT_NAME |
The publication specified by pucPublicationName cannot be located in the data dictionary, or the article specified by pucObjectName does not exist in the publication. |
AdsDDSetArticleProperty sets one property for the specified article in the database. The new property overwrites the existing property in the data dictionary. The following are the valid values of usPropertyID and the expected value in pvProperty and usPropertyLen.
Note This function can be called inside a transaction, but will not be part of the transaction. Any changes it makes cannot be rolled back.
usPropertyID |
Description |
ADS_DD_COMMENT |
Changes the article description. The pvProperty is expected to be a NULL terminated string. usPropertyLen is the length of the string including the NULL terminator. If pvProperty is NULL or an empty string, the description is removed. |
ADS_DD_ARTICLE_FILTER |
Changes the replication filter for the article. If pvProperty is NULL or an empty string, the existing filter is removed. usPropertyLen is the length of the string including the NULL terminator. |
ADS_DD_ARTICLE_ID_COLUMNS |
Changes the identification columns to the given semicolon- or comma-delimited list of columns. Empty strings are not allowed for this property. usPropertyLen is the length of the string including the NULL terminator. |
ADS_DD_ARTICLE_INCLUDE_COLUMNS |
Sets the vertical filter for the article to the given semicolon or comma-delimited list of columns. Only columns specified in the list will be replicated. If pvProperty is NULL or is an empty string, the existing vertical filter is removed. usPropertyLen is the length of the string including the NULL terminator. Note that ADS_DD_ARTICLE_INCLUDE_COLUMNS and ADS_DD_ARTICLE_EXCLUDE_COLUMNS are mutually exclusive. Setting one property will clear the other. |
ADS_DD_ARTICLE_EXCLUDE_COLUMNS |
Sets the vertical filter for the article to be all columns not in the given semicolon or comma-delimited list of columns. All columns not specified in the list will be replicated. If any columns are added to the table after setting this vertical filter, the new columns will be replicated because they will not be in the exclusion list. If pvProperty is NULL or is an empty string, the existing filter is removed. usPropertyLen is the length of the string including the NULL terminator. Note that ADS_DD_ARTICLE_INCLUDE_COLUMNS and ADS_DD_ARTICLE_EXCLUDE_COLUMNS are mutually exclusive. Setting one property will clear the other. |
ADS_DD_ARTICLE_UPDATE_MERGE |
Sets the flag that specifies whether or not this article uses SQL MERGE statements when performing UPDATEs at the target. pvProperty is expected to contain a 2 byte (UNSIGNED16) value that is 0 (FALSE) or 1 (TRUE). |
ADS_DD_ARTICLE_INSERT_MERGE |
Sets the flag that specifies whether or not this article uses SQL MERGE statements when performing INSERTs at the target. pvProperty is expected to contain a 2 byte (UNSIGNED16) value that is 0 (FALSE) or 1 (TRUE). |
// set the replication filter to a specific department
strcpy( aucFilter, "Department = 5" );
ulRetVal = AdsDDSetArticleProperty( hConn, "mypub", "table1",
ADS_DD_ARTICLE_FILTER, aucFilter,
(UNSIGNED16)( strlen(aucFilter) + 1 ));
strcpy( aucVerticalFilter, "empid;lastname;firstname;department" );
ulRetVal = AdsDDSetArticleProperty( hConn, "mypub", "table1",
ADS_DD_ARTICLE_INCLUDE_COLUMNS, aucVerticalFilter,
(UNSIGNED16)( strlen(aucVerticalFilter) + 1 ) );
See Also