CakeFest 2024: The Official CakePHP Conference

odbc_columnprivileges

(PHP 4, PHP 5, PHP 7, PHP 8)

odbc_columnprivilegesLists columns and associated privileges for the given table

Descrição

odbc_columnprivileges(
    resource $odbc,
    ?string $catalog,
    string $schema,
    string $table,
    string $column
): resource|false

Lists columns and associated privileges for the given table.

Parâmetros

odbc

O identificador da conexão ODBC. Consulte odbc_connect() para obter detalhes.

catalog

O catálogo ('qualifier' na linguagem ODBC 2).

schema

O esquema ('owner' na linguagem ODBC 2). Este parâmetro aceita os seguintes padrões de pesquisa: % para corresponder a zero ou mais caracteres e _ para corresponder a um único caractere.

table

The table name. Este parâmetro aceita os seguintes padrões de pesquisa: % para corresponder a zero ou mais caracteres e _ para corresponder a um único caractere.

column

The column name. Este parâmetro aceita os seguintes padrões de pesquisa: % para corresponder a zero ou mais caracteres e _ para corresponder a um único caractere.

Valor Retornado

Returns an ODBC result identifier ou false em caso de falha. This result identifier can be used to fetch a list of columns and associated privileges.

The result set has the following columns:

  • TABLE_CAT
  • TABLE_SCHEM
  • TABLE_NAME
  • COLUMN_NAME
  • GRANTOR
  • GRANTEE
  • PRIVILEGE
  • IS_GRANTABLE
Drivers podem listar colunas adicionais.

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

Exemplos

Exemplo #1 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
}
?>

O exemplo acima produzirá algo semelhante a:

Array
(
    [TABLE_CAT] => TutorialDB
    [TABLE_SCHEM] => dbo
    [TABLE_NAME] => test
    [COLUMN_NAME] => id
    [GRANTOR] => dbo
    [GRANTEE] => dbo
    [PRIVILEGE] => INSERT
    [IS_GRANTABLE] => YES
)
add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top