db_columns (public)

 db_columns [ -dbn dbn ] table_name

Defined in packages/acs-tcl/tcl/01-database-procs.tcl

Switches:
-dbn (optional)
The database name to use. If empty_string, uses the default database.
Parameters:
table_name (required)
Returns:
a Tcl list of all the columns in the table with the given name.
Author:
Lars Pind <lars@pinds.com>
Changelog:
yon@arsdigita.com 20000711 changed to return lowercase column names

Partial Call Graph (max 5 caller/called nodes):
%3 test_datamodel__acs_attribute_check datamodel__acs_attribute_check (test acs-tcl) db_columns db_columns test_datamodel__acs_attribute_check->db_columns db_foreach db_foreach (public) db_columns->db_foreach

Testcases:
datamodel__acs_attribute_check
Source code:
    set columns [list]

    # Works for both Oracle and PostgreSQL:
    db_foreach -dbn $dbn table_column_names {
        select lower(column_name) as column_name
        from user_tab_columns
        where table_name = upper(:table_name)
    } {
        lappend columns $column_name
    }

    return $columns
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: