Documentation for our re-implemented and
improved
ns_table for AOLserver 3.0 and later
ns_table
Overview
Find information about columns of tables in the database
Syntax
ns_table bestrowid dbhandle table
ns_table exists dbhandle table
ns_table list dbhandle
ns_table listall dbhandle
ns_table listwithfkeys dbhandle ?pattern? ?numOfKeys?
ns_table fkeymap dbhandle table
ns_table value dbhandle table key
Description
Each of these functions requires a database handle for the dbhandle argument and a table name for the table argument. Use ns_db gethandle to get a database handle.
ns_table bestrowid returns a list of the column names that uniquely identify a row in the specified table.
ns_table exists returns 1 (one) if the specified table exists in the specified database and 0 (zero) if it does not.
ns_table list returns a list of all the non-system tables in the specified database, including views.
ns_table listall returns a list of all tables in the specified database, including views and system tables.
ns_table listwithfkeys returns a list of all the non-system tables in the specified database with at least minNumOfKeys and at most maxNumOfKeys foreign keys (default is any number of keys). For instance:
ns_table listwithfkeys $db {3 5} | returns all non-system tables with 3 to 5 foreign keys. |
ns_table listwithfkeys $db {"" 4} | returns all non-system tables with at most 4 foreign keys. |
ns_table listwithfkeys $db {2 ""} | returns all non-system tables with at least 2 foreign keys (note that maxNumOfKeys is optional). |
ns_table fkeymap returns a map where the key is the name of a foreign key column in the specified table and database and the value is a pair denoting the target table and column
ns_table value returns table information specified with the Customize Table page in Database Services. For example, key = "description" will return the table description.