Loading ...
Sorry, an error occurred while loading the content.
 

SQL Question

Expand Messages
  • Van Andel, Robbert
    I received a perl file to troubleshoot and am perplexed by the following piece of code my $sth=$dbh- prepare( select code,qty from custcode where account=? );
    Message 1 of 2 , Sep 1, 2003
      I received a perl file to troubleshoot and am perplexed by the following
      piece of code

      my $sth=$dbh->prepare("select code,qty from custcode where account=?");

      What does the question mark do in the sql statement?

      Robbert van Andel




      [Non-text portions of this message have been removed]
    • Jenda Krynicky
      From: Van Andel, Robbert ... It denotes the place where will be the parameter passed to $sth- execute(...) inserted. It s called
      Message 2 of 2 , Sep 1, 2003
        From: "Van Andel, Robbert" <RVanAndel@...>
        > I received a perl file to troubleshoot and am perplexed by the
        > following piece of code
        >
        > my $sth=$dbh->prepare("select code,qty from custcode where
        > account=?");
        >
        > What does the question mark do in the sql statement?

        It denotes the place where will be the parameter passed to
        $sth->execute(...)
        inserted. It's called "placeholder". See more info in DBI's docs.

        HTH, Jenda
        ===== Jenda@... === http://Jenda.Krynicky.cz =====
        When it comes to wine, women and song, wizards are allowed
        to get drunk and croon as much as they like.
        -- Terry Pratchett in Sourcery
      Your message has been successfully submitted and would be delivered to recipients shortly.