Dear Perl Monks,
I am new to Perl, and am currently adapting a previously-made program to my research needs. Basically, it systematically queries the PubMed database with a long list of string queries that it gets from an MS Access database file, and returns information on the papers it finds back into my Access database. I was told that the program was ready to run out of the box, but already I've encountered a couple errors:

Question 1:
In the subroutine that is supposed to grab the queries from my database, I run into this error output...

DBD::ODBC::st execute failed: [Microsoft][ODBC Microsoft Access Driver +] Too few parameters. Expected 2. (SQL-07002)(DBD: st_execute/SQLExec +ute err=-1) at SearchPubMed2.pl line 178. Retrieve SearchTerms - Couldn't execute statement: [Microsoft][ODBC Mi +crosoft Access Driver] Too few parameters. Expected 2. (SQL-07002)(DB +D: st_execute/SQLExecute err=-1) at SearchPubMed2.pl line 178.

...on the execute line of this section of code...
my $sth = $dbh->{LongReadLen} = 255; $sth = $dbh->prepare($SearchOnSearchTermIDSQL); $sth->execute() or die "Retrieve SearchTerms - Couldn't execute statement: " . $st +h->errstr;

Not really sure what it means; let me know if you need more information to solve this problem.

Question 2:
I don't know if anyone is too familiar with PubMed, but i'm using their E-Fetch utility to retrieve information from papers that come out from my query. Perlide highlights in red this line of text...
my $efetch = "$utils/efetch.fcgi?db=$db&WebEnv=" . $WebEnvID . "&query_key=" . $QueryKey  . "&retmode=xml&rettype=docsum&email=email@university.edu";
...whenever I attempt to run (i'm using a different email address, obviously). Is this concatenation missing any specific variables? I imagined that the "&query_key=" would come from the output of a previous subroutine that uses E-Search to grab that value.

Thanks for any tips you might have!


In reply to programmatic database querying by molly

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.