Re: [Zope] how to get the created table names

2000-11-24 Thread Chalu Kim


There is no tag that shows tables and there will be not be such tag.

What you might want to look into ; ZnolkWizard.. This is a handy module
which queries for tables in your database and build create/edit/delete
forms. There is also a handy way to specify key-related data. This gets
you half way to build UIs when you have many tables.

Good luck.

Jose Soares wrote:
> 
> There isn't a SQL standard command to show the tables in the database.
> Thus evry database has a different command to do such job.
> For example:
> 
> DBMaker:
>   to show TABLES:  select  *  from SYSTABLE
>   to show COLUMNS: SELECT  COLUMN_NAME,TYPE_NAME,PRECISION  FROM
> SYSCOLUMN  WHERE  TABLE_NAME=''
> MySQL:
>   to show TABLES:  SHOW TABLES
>   to show COLUMNS: DESC 
> PostreSQL:
>   to show TABLES:  select tablename from pg_tables where tablename not
> like 'pg_%'
>   to show COLUMNS: SELECT a.attname, t.typname, CASE WHEN a.attlen > 0
> THEN attlen ELSE a.atttypmod END as length FROM pg_class c, pg_attribute
> a, pg_type t WHERE c.relname = '' AND a.attnum > 0 AND
> a.attrelid = c.oid AND a.atttypid = t.oid
> 
> I wrote a couple of ZSQL Methods to emulate a generic ISQL
> to query a database using the SQL language
> which shows the names of every table in the database
> and every column name, type and length of every table.
> If you want I can send you it.
> 
> José
> 
> 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]
> > http://lists.zope.org/mailman/listinfo/zope
> > **   No cross posts or HTML encoding!  **
> > (Related lists -
> >  http://lists.zope.org/mailman/listinfo/zope-announce
> >  http://lists.zope.org/mailman/listinfo/zope-dev )

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] how to get the created table names

2000-11-24 Thread Steve Spicklemire


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

Here is a snippet from some working code:



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

-steve

> "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> COLUMNS: SELECT COLUMN_NAME,TYPE_NAME,PRECISION FROM
Jose> SYSCOLUMN WHERE TABLE_NAME='' MySQL: to show
Jose> TABLES: SHOW TABLES to show COLUMNS: DESC 
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 = '' 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] http://lists.zope.org/mailman/listinfo/zope ** No
>> cross posts or HTML encoding!  ** (Related lists -
>> http://lists.zope.org/mailman/listinfo/zope-announce
>> http://lists.zope.org/mailman/listinfo/zope-dev )


Jose> ___ Zope
Jose> maillist - [EMAIL PROTECTED]
Jose> http://lists.zope.org/mailman/listinfo/zope ** No cross
Jose> posts or HTML encoding!  ** (Related lists -
Jose> http://lists.zope.org/mailman/listinfo/zope-announce
Jose> http://lists.zope.org/mailman/listinfo/zope-dev )


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] how to get the created table names

2000-11-24 Thread Jose Soares

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

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


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


José

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]
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )