I run it from the command line on an ubuntu box.

He's the dbi rap:

henri@henri-desktop:~$ perl -MDBI -e 'DBI->installed_versions;' Perl : 5.008008 (i486-linux-gnu-thread-multi) OS : linux (2.6.24-19-server) DBI : 1.609 DBD::mysql : 4.012 DBD::Sponge : 12.010002 DBD::Proxy : 0.2004 DBD::ODBC : 1.22 DBD::Multiplex : 2.09 DBD::Gofer : 0.011565 DBD::File : 0.37 DBD::ExampleP : 12.010007 DBD::DBM : 0.03
what got ran :
use DBI; use DBD::ODBC; use strict; use warnings; DBI->trace(DBD::ODBC->parse_trace_flags('odbcconnection|odbcunicode')) +; my $dbh = DBI->connect('dbi:ODBC:boutique', {RaiseError => 1, PrintErr +or => 1} ); # data source set up in /etc/odbc.ini my $table = "ARTICLES"; my $sql; my $query; my $result; my ($i, $j); $sql = SELECT "REF" FROM "$table" LIMIT 5|; print qq~sql : $sql\n\n~; $query = $dbh->prepare($sql); $query->execute; $result = $query->fetchall_arrayref(); for $i ( 0 .. $#{$result} ) { print qq~row $i : \t~; for $j ( 0 .. $#{$result->[$i]} ) { if ($result->[$i][$j] eq ""){ print qq~NULL\t~; } else { print qq~$result->[$i][$j]\t~; } } print qq~\n~; } $query->finish(); $dbh->disconnect();
trace ends with :
sql : SELECT "REF" FROM "ARTICLES" LIMIT 5 Error at Line : syntax error near LIMIT
the last few lines of /tmp/x.log are :
SQLDriverConnect 'boutique', 'HASH(0x8153c28)', 'xxxx' SQLConnect 'boutique', 'HASH(0x8153c28)' Turning autocommit on DRIVER_ODBC_VER = DRIVER_NAME = DRIVER_VERSION = DBD::ODBC is unicode built : NO SQL_DBMS_NAME = zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz +zzzzzzzzzz SQLMoreResults supported: 0 SQLDescribeParam supported: 0 SQLDescribeParam supported: 0 Processing sql in non-unicode mode SQLDisconnect=0
The 500 error I was refering to was partly solved by the command
export LC_TYPE=fr_FR

But I got only about 20 rows of of the 2000.

H

In reply to Re^6: Fetching data from Access using DBI by hacheb
in thread Fetching data from Access using DBI by hacheb

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.