For example "neat" (see below for perldoc) 'knows' if a string
is numeric or char in the database. If I could get a hash keyed
by $sth->{NAME} that had, say, DBD-specific metadata it'd help
quite a bit on handling some error situaions. One use is returning
a copy of the query with placeholders filled in for cut+paste
troubleshooting; another is pretty-printing results where numeric
sequences stored as strings need to be quoted for further use
(i.e., /^\d+$/ is not a good enough test for quotishness when
Perl gets all the data back as strings).

If whatever neat uses were exported -- perhaps in DBD-specific
fashion to accomodate varying levels of metadata available in
the different databases -- it'd sure help...

      "neat"
            $str = DBI::neat($value);
            $str = DBI::neat($value, $maxlen);

          Return a string containing a neat (and tidy) represen-
          tation of the supplied value.

          Strings will be quoted, although internal quotes will
          not be escaped.  Values known to be numeric will be
          unquoted. Undefined (NULL) values will be shown as
          "undef" (without quotes).

          If the string is flagged internally as utf8 then dou-
          ble quotes will be used, otherwise single quotes are
          used and unprintable characters will be replaced by
          dot (.).

          For result strings longer than $maxlen the result
          string will be truncated to "$maxlen-4" and ""...'""
          will be appended.  If $maxlen is 0 or "undef", it
          defaults to $DBI::neat_maxlen which, in turn, defaults
          to 400.

          This function is designed to format values for human
          consumption.  It is used internally by the DBI for
          "trace" output. It should typically not be used for
          formatting values for database use.  (See also
          "quote".)



--
Steven Lembark                                       85-09 90th Street
Workhorse Computing                                Woodhaven, NY 11421
[EMAIL PROTECTED]                                     1 888 359 3508

Reply via email to