Oh mighty Perl Monks!                                          §           I beseech your wisdom in my troubled past. For you see I have ventured on a noble quest but am lost on my journey. lol                  (I feel this is an excerpt out of the movie "Your Highness" http://www.imdb.com/title/tt1240982/ lol)                 anyhow ...                     I am successfully BINDing to my remote Dell KACE1000 with this snippet :
#!/usr/perl -w use DBI; my $database='MySQL ODBC 3.51 Driver'; my $hostname='192.168.1.100' my $username= 'R1'; #same for every customer my $password= 'box747'; #same for every customer my $dbh = DBI->connect("dbi:ODBC:DRIVER=$database;SERVER=$hostna +me;port=3306",$username$password)";
## heres my syntax confusion; Ive tried many statement approaches ## NONE of which seem to work valid ## this block gives me error confirming record/value traversal ## it is not returning anything; giving me this DBI::errstr error(s) ## bind_columns failed: called with 4 values but 74 are needed
my $sql = "SELECT * FROM ORG1.MACHINE"; ## SQL works in MySQL studio where ORG1:db and MACHINE:table my $sth = $dbh->prepare($sql); $sth->execute(); ## should I be sure to inject (undef) my ($ID, $NAME, $USER, $MAC); ## Titles correspond to Schema Viewer table names in CAPS #BIND results to variables ? $sth->bind_columns(undef, \$ID, \$NAME, \$USER, \$MAC); ##retrieve / return results while( $sth->fetch() ) { print "$ID, $NAME, $USER, $MAC\n"; } $sth->finish(); $dbh->disconnect();
## any help is very much appreciated                     ##Below is a screenshot of the returned error on execution                                 http://filedb.experts-exchange.com/incoming/2012/08_w33/t596770/ODBCfailederror.png

In reply to Dell KACE lookup script failure by jaaronanderson

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.