odbc_tables

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

odbc_tablesGet the list of table names stored in a specific data source

Beschreibung

odbc_tables(
    resource $odbc,
    ?string $catalog = null,
    ?string $schema = null,
    ?string $table = null,
    ?string $types = null
): resource|false

Lists all tables in the requested range.

To support enumeration of qualifiers, owners, and table types, the following special semantics for the catalog, schema, table, and table_type are available:

  • If catalog is a single percent character (%) and schema and table are empty strings, then the result set contains a list of valid qualifiers for the data source. (All columns except the TABLE_QUALIFIER column contain NULLs.)
  • If schema is a single percent character (%) and catalog and table are empty strings, then the result set contains a list of valid owners for the data source. (All columns except the TABLE_OWNER column contain NULLs.)
  • If table_type is a single percent character (%) and catalog, schema and table are empty strings, then the result set contains a list of valid table types for the data source. (All columns except the TABLE_TYPE column contain NULLs.)

Parameter-Liste

odbc

Eine ODBC-Verbindungsressource, siehe odbc_connect() für Details.

catalog

Der Katalog ('Kennzeichner' in ODBC 2 Terminologie).

schema

Das Schema ('Besitzer' in ODBC 2 Terminologie). Dieser Parameter akzeptiert die folgenden Suchmuster: % für 0 oder mehr Zeichen und _ für genau ein beliebiges Zeichen.

table

The name. Dieser Parameter akzeptiert die folgenden Suchmuster: % für 0 oder mehr Zeichen und _ für genau ein beliebiges Zeichen.

types

If table_type is not an empty string, it must contain a list of comma-separated values for the types of interest; each value may be enclosed in single quotes (') or unquoted. For example, 'TABLE','VIEW' or TABLE, VIEW. If the data source does not support a specified table type, odbc_tables() does not return any results for that type.

Rückgabewerte

Returns an ODBC result identifier containing the information Bei einem Fehler wird false zurückgegeben..

The result set has the following columns:

  • TABLE_CAT
  • TABLE_SCHEM
  • TABLE_NAME
  • TABLE_TYPE
  • REMARKS
Treiber können zusätzliche Spalten melden.

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

Changelog

Version Beschreibung
8.0.0 schema, table and types are now nullable.

Beispiele

Beispiel #1 List Tables in a Catalog

<?php
$conn 
odbc_connect($dsn$user$pass);
$tables odbc_tables($conn'SalesOrders''dbo''%''TABLE');
while ((
$row odbc_fetch_array($tables))) {
    
print_r($row);
    break; 
// further rows omitted for brevity
}
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

Array
(
    [TABLE_CAT] => SalesOrders
    [TABLE_SCHEM] => dbo
    [TABLE_NAME] => Orders
    [TABLE_TYPE] => TABLE
    [REMARKS] =>
)

Siehe auch

Hier Kannst Du einen Kommentar verfassen


Bitte gib mindestens 10 Zeichen ein.
Wird geladen... Bitte warte.
* Pflichtangabe
Es sind noch keine Kommentare vorhanden.

Midjourney Tutorial - Anleitung für Anfänger

Über Midjourney, dem Tool zur Erstellung digitaler Bilder mithilfe von künstlicher Intelligenz, gibt es ein informatives Video mit dem Titel "Midjourney Tutorial auf Deutsch - Anleitung für Anfänger" ...

Mike94

Autor : Mike94
Kategorie: KI Tutorials

Grundlagen von Views in MySQL

Views in einer MySQL-Datenbank bieten die Möglichkeit, eine virtuelle Tabelle basierend auf dem Ergebnis einer SQL-Abfrage zu erstellen. ...

admin

Autor : admin
Kategorie: mySQL-Tutorials

Definition von Stored Procedures - eine Einführung

Stored Procedures sind vordefinierte SQL-Codeblöcke, die in einer Datenbank gespeichert sind und bei Bedarf aufgerufen werden können. ...

Bernie

Autor : ebiz-consult GmbH & Co. KG
Kategorie: mySQL-Tutorials

Tutorial veröffentlichen

Tutorial veröffentlichen

Teile Dein Wissen mit anderen Entwicklern weltweit

Du bist Profi in deinem Bereich und möchtest dein Wissen teilen, dann melde dich jetzt an und teile es mit unserer PHP-Community

mehr erfahren

Tutorial veröffentlichen

Berechnungen durchführen

Hallo liebe Forenmitglieder, meine erste frage ist zum Aufbau meiner kleinen Berechnungswebseite, nichts kommerzielles, soll nur eine Anwendung f ...

Geschrieben von matze511 am 21.04.2024 21:42:37
Forum: PHP Developer Forum
Professioneller Webentwickler & Webdesigner

Of course, here is the translation: Hello, Thank you for your interest in the long-term project. Your extensive skills and experience in web dev ...

Geschrieben von Athelstan am 15.04.2024 09:25:39
Forum: Jobgesuche
Wir stellen unsere SEO-Agentur vor

Hallo In der heutigen digitalen Welt war es für Unternehmen noch nie so einfach, ihre Reichweite weltweit zu vergrößern. Wenn Sie außerhalb I ...

Geschrieben von thomasmuller am 14.04.2024 07:18:33
Forum: User stellen sich vor
Spielplan für 4 Gruppen zu je 6 Teams auf 2 Feldern

Hallöchen zusammen, ich versuche derzeit unseren Excel-Spielplan in PHP zu überführen. Eigentlich bin ich auch shon fertig - wenn da nicht dies ...

Geschrieben von derH0st am 11.04.2024 15:58:37
Forum: PHP Developer Forum