I am not sure about your connect method, I think that might be the source of your problem. It could be something to do with the escaping of your separation character when providing the arguments in that format.
Here is a modified version of your code which seems to do what you want.
use strict;
use warnings;
use DBI;
use Data::Dumper;
my $dbh = DBI->connect("DBI:CSV:", undef, undef, { csv_eol=> "\r\n", c
+sv_sep_char => '~'});
$dbh->{'csv_tables'}->{'JPDObj'} = {'file' => 'data/objectives-cqdc.tx
+t','col_names' => ["Obj","PosNbr","Year","Div","AVP","Dept","SDescr",
+"Major","Methods","Results","Accompl","JanUp","LDescr","Changes","Cha
+rs","Goals","Budget","CFObj"]};
$dbh->{'RaiseError'} = 1;
$@ = '';
my $Cposition = '00001576';
my $Cyear = 2014;
my $results = $dbh->selectall_arrayref( "SELECT Obj,SDescr,Major,Year,
+LDescr FROM JPDObj WHERE PosNbr = ? AND Year = ?", { Slice => {} }, $
+Cposition, $Cyear);
for ( @$results )
{
print Dumper( $_ ) . "\n";
}
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.