Re: find out data type

[prev] [thread] [next] [Date index for 2005/06/29]

From: David Baird
Subject: Re: find out data type
Date: 13:51 on 29 Jun 2005
Marc Lambrichs wrote:

> If I get all my columns with $class->columns, is there a way to find 
> out what data type each column has (not depending on dbms)?
>
> Marc

CDBI::Plugin::Type may help. It's supposed to be dbms-agnostic. I've 
never been able to find a definitive list of the column types that can 
be returned though. I *think* it gets its info from the DBD driver. I 
seem to get strings like 'varchar(255)' in some circumstances (SQLite2), 
and like 'varchar' in others (MySQL). Things I've either seen returned, 
had reported as returned, or just guessed might be returned, from this 
are listed in a couple of package globals: 
%Class::DBI::Plugin::AutoUntaint::TypesMap and 
%Class::DBI::FormBuilder::ValidMap (at the top of the respective modules).

d.

find out data type
Marc Lambrichs 12:55 on 29 Jun 2005

Re: find out data type
David Baird 13:51 on 29 Jun 2005

Generated at 16:36 on 28 Jul 2005 by mariachi v0.52