MySQL Lists are EOL. Please join:

List:MySQL and Perl« Previous MessageNext Message »
From:Paul Sharpe Date:March 15 1999 10:59am
Subject:Re: Help getting metadata from LISTFIELDS
View as plain text  
On Fri, 12 Mar 1999, Jochen Wiedmann wrote:

> > Subject: Help getting metadata from LISTFIELDS
> > Date: Fri, 12 Mar 1999 14:10:40 +0000 (GMT)
> > From: Paul Sharpe <paul@stripped>
> > To: msql-mysql-modules@stripped
> > 
> > How do I access the metadata I expected this
> > 'SQL EXTENSION' to return?
> > 
> The LISTFIELDS instruction (which is internally mysql_list_fields, of
> course)
> does nothing more than returning an empty table. You can think of it as
> being equivalent to
> 	SELECT * FROM $table WHERE 1=0
> So the number 0 is correct for the rows. What do you expect it to return?

I expected to be able to access the metadata for $table somehow as the
Mysql manual says

  Calling mysql_list_fields() is similar to executing the query 
  SHOW fields FROM table...

and DBD::mysql says

	 Returns a statement handle that describes the
	 columns of $table.  Ses the docs of msqlListFields
	 or mysql_list_fields for details.

I'm not clear how I access the information returned by LISTFIELDS.

The point is also a bit moot as you say

> AFAIK I do not even have AUTO_INCREMENT available as part of the
> LISTFIELDS statement ... this ought to be fixed.

so fttb I think I'm going to have to revert to using 

  DESCRIBE $table

and parsing the resulting rows.  Being able to query the AUTO_UNIQUE_VALUE
status of a column in a base table would solve my my problem.


Help getting metadata from LISTFIELDSPaul Sharpe12 Mar
Re: Help getting metadata from LISTFIELDSJochen Wiedmann13 Mar
  • Re: Help getting metadata from LISTFIELDSPaul Sharpe15 Mar