Re: Possible to get field names and types in a table without executing a query?
- From: matthew.persico@xxxxxxxxx (Matthew Persico)
- Date: Tue, 27 Jun 2006 17:01:21 -0400
On 6/27/06, Jordan Sissel <psionic@xxxxxxxxx> wrote:
iirc, you can use $dbh->table_info() or tables() or type_info() functions to
pull that information without having to do a hack where you select 0 rows
just to poll for column names.
Right?
Yes. Unless you want the information for a particular query you are
executing. Then use the hack method.
But I've jsut done some tests and discovered that $sth->{TYPE} returns
numbers which then have to be applied to $dbh->type_info(). And that
function will return multiple entries for many types, which may not be
useful...
For accuracy on single tables, use the functions. For queries, use the hack.
-Jordan
--
Matthew O. Persico
.
- 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: Jordan Sissel
- Possible to get field names and types in a table without executing a query?
- Prev by Date: Re: In search of ParamValues in error handler after a do call fails
- 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
|
|