Re: Possible to get field names and types in a table without executing a query?
- From: mlists@xxxxxxxxxxxxxxx (JupiterHost.Net)
- Date: Tue, 27 Jun 2006 16:51:17 -0500
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.
How can you gaurantee all DB engines will return the column names with no value on an empty query?
For instance I'd expect fetchall_hashref() to return {} on a query with no results...
It'd be better to use the DB engine's built in tools, perhaps abstracting the engine specific guts into a method that does what it needs for the handle's engine and they all return the same hash...
*If* your app needs support every DB that is...
.
- Follow-Ups:
- RE: Possible to get field names and types in a table without executing a query?
- From: Ronald J Kimball
- 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
- Re: Possible to get field names and types in a table without executing a query?
- From: Jonathan Leffler
- 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):
Relevant Pages
|