PHP 8.3.4 Released!

odbc_tableprivileges

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

odbc_tableprivilegesLists tables and the privileges associated with each table

Descrição

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

Lists tables in the requested range and the privileges associated with each 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 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

An ODBC result identifier ou false em caso de falha.

The result set has the following columns:

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

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

Exemplos

Exemplo #1 List Privileges of a Table

<?php
$conn
= odbc_connect($dsn, $user, $pass);
$privileges = odbc_tableprivileges($conn, 'SalesOrders', 'dbo', 'Orders');
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] => SalesOrders
    [TABLE_SCHEM] => dbo
    [TABLE_NAME] => Orders
    [GRANTOR] => dbo
    [GRANTEE] => dbo
    [PRIVILEGE] => DELETE
    [IS_GRANTABLE] => YES
)

Veja Também

  • odbc_tables() - Get the list of table names stored in a specific data source

add a note

User Contributed Notes

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