Name

type_info_all (NEW )

Synopsis

$type_info_all = $dbh->type_info_all;

Warning: This method is experimental and may change.

Returns a reference to an array that holds information about each datatype variant supported by the database and driver. The array and its contents should be treated as read-only.

The first item is a reference to a hash of Name => Index pairs. The following items are references to arrays, one per supported datatype variant. The leading hash defines the names and order of the fields within the following list of arrays. For example:

$type_info_all = [
  {   TYPE_NAME         => 0,
      DATA_TYPE         => 1,
      COLUMN_SIZE       => 2,     # was PRECISION originally
      LITERAL_PREFIX    => 3,
      LITERAL_SUFFIX    => 4,
      CREATE_PARAMS     => 5,
      NULLABLE          => 6,
      CASE_SENSITIVE    => 7,
      SEARCHABLE        => 8,
      UNSIGNED_ATTRIBUTE=> 9,
      FIXED_PREC_SCALE  => 10,    # was MONEY originally
      AUTO_UNIQUE_VALUE => 11,    # was AUTO_INCREMENT originally
      LOCAL_TYPE_NAME   => 12,
      MINIMUM_SCALE     => 13,
      MAXIMUM_SCALE     => 14,
      NUM_PREC_RADIX    => 15,
  },
  [ 'VARCHAR', SQL_VARCHAR,
      undef, "'","'", undef,0, 1,1,0,0,0,undef,1,255, undef
  ],
  [ 'INTEGER', SQL_INTEGER,
      undef,  "", "", undef,0, 0,1,0,0,0,undef,0,  0, 10
  ],
];

Note that more than one row may have the same value in the DATA_TYPE field if there are different ways to spell the type name and/or there are variants of the type with different attributes (e.g., with and without AUTO_UNIQUE_VALUE set, with and without UNSIGNED_ATTRIBUTE, etc.).

The rows are ordered by DATA_TYPE first and then by how closely each type ...

Get Programming the Perl DBI now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.