Hmm.. I think there is a method of a ZSQL result object called 'names'.. 

Here is a snippet from some working code:

<dtml-let specificTypes="getTypes(ttid=type, name='', tttype='')"

where 'getTypes' is a ZSQL Method and theNames is the list of column names returned
from the query...


>>>>> "Jose" == Jose Soares <[EMAIL PROTECTED]> writes:

    Jose> There isn't a SQL standard command to show the tables in the
    Jose> database.  Thus evry database has a different command to do
    Jose> such job.  For example:

    Jose> DBMaker: to show TABLES: select * from SYSTABLE to show
    Jose> SYSCOLUMN WHERE TABLE_NAME='<table_name>' MySQL: to show
    Jose> TABLES: SHOW TABLES to show COLUMNS: DESC <table_name>
    Jose> PostreSQL: to show TABLES: select tablename from pg_tables
    Jose> where tablename not like 'pg_%' to show COLUMNS: SELECT
    Jose> a.attname, t.typname, CASE WHEN a.attlen > 0 THEN attlen
    Jose> ELSE a.atttypmod END as length FROM pg_class c, pg_attribute
    Jose> a, pg_type t WHERE c.relname = '<table_name>' AND a.attnum >
    Jose> 0 AND a.attrelid = c.oid AND a.atttypid = t.oid

    Jose> I wrote a couple of ZSQL Methods to emulate a generic ISQL
    Jose> to query a database using the SQL language which shows the
    Jose> names of every table in the database and every column name,
    Jose> type and length of every table.  If you want I can send you
    Jose> it.

    Jose> Josť

    Jose> subrahmanyan kalathur wrote:

    >> hi,
    >> I would like to know the names of the created table in zsql
    >> method.  Kindly give me the tag for displaying the table
    >> names.( if exists.)
    >> thanks bye yours,
    >> K.H.Subrahmanyan
    >> ( [EMAIL PROTECTED] )
    >> _______________________________________________ Zope maillist -
    >> [EMAIL PROTECTED] ** No
    >> cross posts or HTML encoding!  ** (Related lists -
    >> )

    Jose> _______________________________________________ Zope
    Jose> maillist - [EMAIL PROTECTED]
    Jose> ** No cross
    Jose> posts or HTML encoding!  ** (Related lists -
    Jose> )

Zope maillist  -  [EMAIL PROTECTED]
**   No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to