title: Passing variables into sqlplus query in perl
body: <p>I'm having an issue here. I am trying to pass a variable into a sqlplus query, and it does not seem to be working.</p>
  
  <pre><code>    my $connect = DBI-&gt;connect('DBI:Oracle:',$dbuser,$dbpasswd);
    my $query = "select sum(transaction_amnt) from comm_to_cand natural join cmte_id_to_geo where cycle='?'", $cycle;
    my $query_handle = $connect-&gt;prepare($query);
    $query_handle-&gt;execute();
    $cmte_money = $query_handle-&gt;fetchrow_array();
  
    print 'Money: ';
    print $cmte_money;
  
    if($cmte_money &gt; 0)
    {
      print 'HI';
    }
    else
    {
      print 'NOOOO';
    }
  </code></pre>
  
  <p>I can get the query to work when I change the "cycles" variable from a variable to a constant, and the if statement checking will print hi, so the databases work I'm positive.</p>
  
  <p>I've scoured the internet, and I can't seem to find an answer.</p>