Re: Possible to get field names and types in a table without executing a query?
- From: jonathan.leffler@xxxxxxxxx (Jonathan Leffler)
- Date: Tue, 27 Jun 2006 12:45:59 -0700
On 6/27/06, Matthew Persico <matthew.persico@xxxxxxxxx> wrote:
So now I need one for every database?
Yes - and there a DBMS that make you do that the hard way, with raw access
to the system catalog.
Despite the prior thread entry refering to
select * from table where 0 = 1
as a hack in the 'bad' sense, I suggest that this is a hack in the 'good'
sense.
It is much more easily portable.
Suppose you have a real query:
select a.foo, b.bar.c.baz
from
a, b, c
where .....
The 0= 1 method works for that too. Contrast that with parsing the
from clause and the where clause to create a tabel catalog query. Yuk.
--
Jonathan Leffler <jonathan.leffler@xxxxxxxxx> #include <disclaimer.h>
Guardian of DBD::Informix - v2005.02 - http://dbi.perl.org
"I don't suffer from insanity - I enjoy every minute of it."
- Follow-Ups:
- Re: Possible to get field names and types in a table without executing a query?
- From: JupiterHost.Net
- Re: Possible to get field names and types in a table without executing a query?
- References:
- Possible to get field names and types in a table without executing a query?
- From: Brian Barto
- Re: Possible to get field names and types in a table without executing a query?
- From: JupiterHost.Net
- Re: Possible to get field names and types in a table without executing a query?
- From: Matthew Dougerty
- Re: Possible to get field names and types in a table without executing a query?
- From: JupiterHost.Net
- Re: Possible to get field names and types in a table without executing a query?
- From: Matthew Persico
- Possible to get field names and types in a table without executing a query?
- Prev by Date: Re: Possible to get field names and types in a table without executing a query?
- Next by Date: Re: Possible to get field names and types in a table without executing a query?
- Previous by thread: Re: Possible to get field names and types in a table without executing a query?
- Next by thread: Re: Possible to get field names and types in a table without executing a query?
- Index(es):