v5:dictionary:comments
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| v5:dictionary:comments [2026/03/22 22:46] – mnewnham | v5:dictionary:comments [2026/03/22 23:45] (current) – mnewnham | ||
|---|---|---|---|
| Line 68: | Line 68: | ||
| < | < | ||
| </ | </ | ||
| + | |||
| </ | </ | ||
| </ | </ | ||
| + | ==== Modifying Comments ==== | ||
| + | Databases that support creating comments via dictionary table functions have limited ability to modify comments after creation. Only columns comments can be modified, and this requires the entire column specification to be provided. | ||
| + | |||
| + | ===== Creating Comments After Table Creation ===== | ||
| + | For databases that provide the ability to create comments after table creation, the following methods are provided | ||
| + | ==== Table ==== | ||
| + | <WRAP right box> | ||
| + | == Syntax == | ||
| + | |||
| + | ?string setTableCommentSql( | ||
| + | string $tableName, | ||
| + | ?string $comment | ||
| + | ) | ||
| + | |||
| + | </ | ||
| + | **ADODataDictionary:: | ||
| + | |||
| + | --------------------------------------- | ||
| + | |||
| + | <code php> | ||
| + | /* | ||
| + | * Assume connection to IBM DB2 database | ||
| + | */ | ||
| + | |||
| + | $table = ' | ||
| + | $comment = 'This is a table comment'; | ||
| + | |||
| + | $datadict = newDataDictionary($db); | ||
| + | $tableCommentSql = $datadict-> | ||
| + | |||
| + | /* | ||
| + | * Returns | ||
| + | */ | ||
| + | |||
| + | $db-> | ||
| + | </ | ||
| + | |||
| + | ==== Column ==== | ||
| + | <WRAP right box> | ||
| + | == Syntax == | ||
| + | |||
| + | ?string setColumnCommentSql( | ||
| + | string $tableName, | ||
| + | string $columnName, | ||
| + | ?string $comment | ||
| + | ) | ||
| + | |||
| + | </ | ||
| + | **ADODataDictionary:: | ||
| + | |||
| + | --------------------------------------- | ||
| + | |||
| + | ==== Index ==== | ||
| + | <WRAP right box> | ||
| + | == Syntax == | ||
| + | |||
| + | ?string setIndexCommentSql( | ||
| + | string $tableName, | ||
| + | string $indexName, | ||
| + | ?string $comment | ||
| + | ) | ||
| + | |||
| + | </ | ||
| + | **ADODataDictionary:: | ||
| + | |||
| + | --------------------------------------- | ||
| + | ===== Reading Comments ===== | ||
| + | All databases use the same methods to retrieve comments set in the database. | ||
| + | ==== Table ==== | ||
| + | <WRAP right box> | ||
| + | == Syntax == | ||
| + | |||
| + | ?string getTableCommentSql( | ||
| + | string $tableName | ||
| + | ) | ||
| + | |||
| + | </ | ||
| + | **ADODataDictionary:: | ||
| + | |||
| + | --------------------------------------- | ||
| + | <code php> | ||
| + | /* | ||
| + | * Assume connection to a PostgresQL database | ||
| + | */ | ||
| + | |||
| + | $table = ' | ||
| + | |||
| + | |||
| + | $datadict = newDataDictionary($db); | ||
| + | $tableCommentSql = $datadict-> | ||
| + | |||
| + | /* | ||
| + | * Returns | ||
| + | */ | ||
| + | |||
| + | $comment = $db-> | ||
| + | </ | ||
| + | ==== Column ==== | ||
| + | <WRAP right box> | ||
| + | == Syntax == | ||
| + | |||
| + | ?string getColumnCommentSql( | ||
| + | string $tableName, | ||
| + | string $columnName | ||
| + | ) | ||
| + | |||
| + | </ | ||
| + | **ADODataDictionary:: | ||
| + | |||
| + | --------------------------------------- | ||
| + | |||
| + | ==== Index ==== | ||
| + | <WRAP right box> | ||
| + | == Syntax == | ||
| + | |||
| + | ?string getIndexCommentSql( | ||
| + | string $tableName, | ||
| + | string $indexName | ||
| + | ) | ||
| + | |||
| + | </ | ||
| + | **ADODataDictionary:: | ||
| + | |||
| + | ---------------------------------- | ||
| + | |||
| + | ===== Deprecated Functions ===== | ||
| + | The functions **getCommentSql()** and **setCommentSql()** which get/set table comments in the oci8 driver are deprecated and will be removed in a later release. They currently alias **getTableCommentSql()** and **setTableCommentSql()** | ||
v5/dictionary/comments.1774215972.txt.gz · Last modified: by mnewnham
