PHP.nl

odbc_columnprivileges

odbc_columnprivileges

Lists columns and associated privileges for the given table

 **odbc_columnprivileges** Odbc\Connection $odbc  $catalog string $schema string $table string $column

Lists columns and associated privileges for the given table.

odbc``catalogodbc.parameter.catalog

schemaodbc.parameter.schema odbc.parameter.search

tableThe table name. odbc.parameter.search

columnThe column name. odbc.parameter.search

odbc.result.object-return-falseforfailure This result object can be used to fetch a list of columns and associated privileges.

The result set has the following columns:

odbc.result.driver-specific

  • TABLE_CAT

  • TABLE_SCHEM

  • TABLE_NAME

  • COLUMN_NAME

  • GRANTOR

  • GRANTEE

  • PRIVILEGE

  • IS_GRANTABLE

    The result set is ordered by , , , and . TABLE_CAT``TABLE_SCHEM``TABLE_NAME``COLUMN_NAME``PRIVILEGE

Voorbeeld: List Privileges for a Column

<?php
$conn = odbc_connect($dsn, $user, $pass);
$privileges = odbc_columnprivileges($conn, 'TutorialDB', 'dbo', 'test', 'id');
while (($row = odbc_fetch_array($privileges))) {
    print_r($row);
    break; // further rows omitted for brevity
}
?>
Array
(
    [TABLE_CAT] => TutorialDB
    [TABLE_SCHEM] => dbo
    [TABLE_NAME] => test
    [COLUMN_NAME] => id
    [GRANTOR] => dbo
    [GRANTEE] => dbo
    [PRIVILEGE] => INSERT
    [IS_GRANTABLE] => YES
)