use strict; use warnings; use DBI; my $value = 45; my $dbh = DBI->connect("DBI:CSV:f_dir=.;csv_sep_char=\\;"); $dbh->{'csv_tables'}->{'my_table'} = { 'eol' => "\n", 'sep_char' => ";", 'quote_char' => undef, 'escape_char' => undef, 'file' => 'my_table.csv', 'col_names' => ["id", "value"] }; my $sth = $dbh->prepare(<execute($value) or die "Cannot execute: " . $sth->errstr(); $sth->bind_columns( \my $ret_1, \my $ret_2 ); while ( $sth->fetch() ) { print "key($ret_1) value($ret_2)\n"; } $sth->finish(); $dbh->disconnect(); exit; #### key;value 1;654 2;45 3;354 4;357 5;464 6;654 7;45 8;654 9;45 10;6546 #### Argument "value" isn't numeric in numeric eq (==) at /jey/.perl-lib/SQL/Statement.pm line 1120, line 1. key(2) value(45) key(7) value(45) key(9) value(45) #### SELECT * FROM table WHERE value = (SELECT * FROM table2 WHERE value2 = ?)