Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

DBI: interpreting column_info()

by ibm1620 (Monk)
on Feb 17, 2013 at 06:43 UTC ( #1019110=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    # Get all columns for each table of interest
    #
    ...
        my @list = map $_ // 'undef', @$aref;
        say join '|', @list;
    }
    
  2. or download this
    dw_contact_source
    undef|dwcust1|dw_contact_source|contact_id|4|BIGINT|20|undef|undef|10|
    +0|undef|undef|4|undef|undef|1|NO|undef|undef|undef|undef|undef|undef|
    +undef|undef|undef|undef|undef|undef|undef|undef|undef|undef|undef|und
    +ef|1|bigint(20)|undef|0
    ...
    undef|dwcust1|dw_contact_source|contact_type_id|4|TINYINT|4|undef|unde
    +f|10|0|undef|undef|4|undef|undef|3|NO|undef|undef|undef|undef|undef|u
    +ndef|undef|undef|undef|undef|undef|undef|undef|undef|undef|undef|unde
    +f|undef||tinyint(4)|undef|0
    undef|dwcust1|dw_contact_source|insert_date|11|DATETIME|19|undef|0|und
    +ef|0|undef|undef|9|-79|undef|4|NO|undef|undef|undef|undef|undef|undef
    +|undef|undef|undef|undef|undef|undef|undef|undef|undef|undef|undef|un
    +def||datetime|undef|0
    undef|dwcust1|dw_contact_source|update_date|11|DATETIME|19|undef|0|und
    +ef|0|undef|undef|9|-79|undef|5|NO|undef|undef|undef|undef|undef|undef
    +|undef|undef|undef|undef|undef|undef|undef|undef|undef|undef|undef|un
    +def||datetime|undef|0
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1019110]
Front-paged by Corion
help
Chatterbox?
[ambrus]: Corion: my guess is to first read the start of the file to check what format it is out of two or more possibilities, then rewind it and handle it differently depending on the program
[ambrus]: s/program/format/
[Dumu]: ambrus: it's about testing a file for being multiple possible file formats
[ambrus]: In particular, you might want to detect the encoding of a HTML file from between utf-16 versus ascii-based and encoding given in a META tag.
[ambrus]: Dumu: it should probably be safe to change the encoding if you rewind first with seek $file, 0, 0 first
[Dumu]: ambrus: good guess. I'm trying to contribute to a CPAN module, and the existing tests assume they're looking at text files
[Dumu]: ambrus: thank you. I was seeking afterwards. I'll seek first.
[jedikaiti]: Hello, Dumu!
[Dumu]: hello again jedikaiti! thanks everyone today for being in the monastery!

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2017-11-20 17:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (291 votes). Check out past polls.

    Notices?