AdsDDSetViewProperty

Advantage Client Engine

Sets one property associated with a view in the data dictionary.

Syntax

UNSIGNED32 AdsDDSetViewProperty( ADSHANDLE hDBConn,

UNSIGNED8 *pucViewName,

UNSIGNED16 usPropertyID,

VOID *pvProperty,

UNSIGNED16 usPropertyLen );

Parameters

hDBConn (I)

Handle of a database connection.

pucViewName (I)

Name of the view object to set the associated property.

usPropertyID (I)

Index of a view property to set. See Remarks for allowed values.

pvProperty (I)

Pointer to the buffer where the property is stored.

usPropertyLen (I)

The size of the property specified by the pvProperty.

Special Return Codes

AE_INVALID_OBJECT_NAME

Possible cause for the error is that the pucViewName does not specify a valid view in the database.

AE_INVALID_PROPERTY_ID

Either the value supplied in usPropertyID is not a valid view property ID, or the specified property cannot be set.

Remarks

AdsDDSetViewProperty sets one property associated with the specified view. The new property overwrites the existing property in the data dictionary. The primary benefit to using this API over deleting and re-creating the view is that it maintains existing permissions on the view object. The following are the valid values of usPropertyID and the expected value in pvProperty and usPropertyLen.

ALTER permissions on the view are required to modify data dictionary view properties. See Advantage Data Dictionary User Permissions for more information.

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

Stores a new description for the view. The pvProperty parameter is expected to be a NULL terminated string. usPropertyLen is the length of the string including the NULL terminator. If pvProperty is NULL or empty string, the view description is removed.

ADS_DD_VIEW_STMT

Changes the SQL SELECT statement associated with the view.

Example

After making a connection to the database, set a new statement for "view1".

AdsConnect60( "n:\\MyData\\myData.ADD", ADS_REMOTE_SERVER, "ADSSYS", NULL, ADS_DEFAULT, &hDD );

ulReturnCode = AdsDDSetViewProperty( hDD, "View1", ADS_DD_VIEW_STMT, "select * from test", 19 );

See Also

AdsDDAddView

AdsDDRemoveView

AdsDDGetViewProperty

sp_ModifyViewProperty