Error in DBD::Chart (called from DBIx::Chart)



I'm receiving this error message when I run a PERL script:
Use of uninitialized value in string ne at
C:/Perl/site/lib/DBD/Chart.pm line 2491.

Why does this fail? or give me this error? What does it want to be
initialized?
What is DBD:Chart want me to do in DBIx::Chart?


This is the script used to create a composite of 2 line graphs on to
one "image":

#!C:\Perl\bin\perl.exe -w

use DBIx::Chart;
use DBI qw(:sql_types);

$DSN = 'Testing';
$DATA_SOURCE = "DBI:ODBC:$DSN";
$USER_NAME = 'sa';
$PASSWORD = 'xxxxx';
$DB = 'test';
$dbh = DBIx::Chart->connect($DATA_SOURCE, $USER_NAME, $PASSWORD,
{RaiseError => 1, AutoCommit => 0})
or die "Cannot connect to $DATA_SOURCE: $DBI::errstr \n";
DBI->trace(2, 'logfile.log');

$sql = qq( select * from

(select (rtrim(PCBJOBNUMBER)+', '+ rtrim(PCBPNUM)+', '+
rtrim(LLJC_Line_Number_LONG)+', '+ rtrim(PCBTASKNUM)) as job_task,
cast(PCBESTIMATEQTY as integer) as esthrs
from $DB..pcb00125
where pcbjobnumber = 'm0603412' and pcbpnum = '001'
returning linegraph(*)
where color = 'blue' and shape = 'fillcircle') as line1,

(select (rtrim(PCBJOBNUMBER)+', '+ rtrim(PCBPNUM)+', '+
rtrim(LLJC_Line_Number_LONG)+', '+ rtrim(PCBTASKNUM)) as job_task,
cast(PCBACTUALQTY as integer) as acthrs
from $DB..pcb00125
where pcbjobnumber = 'm0603412' and pcbpnum = '001'
returning linegraph(*)
where color = 'green' and shape = 'opensquare') as line2

returning image
where width = 600 and height = 500
and x_axis = 'Tasks'
and y_axis = 'Hours'
and keeporigin = 1
and showvalues = 1
and showpoints = 1
and showgrid = 0
and format = 'png'
and maptype = 'HTML'
and mapname = 'plot'
);
$rsth = $dbh->prepare($sql);
$rsth->execute;
$row = $rsth->fetchrow_arrayref;

# output picture
open(OUTF, '>graph.png');
binmode OUTF;
print OUTF $$row[0];
close OUTF;

$rsth->finish;
$dbh->disconnect;


As a side note I ran this script and it produced an output just fine:

#!C:\Perl\bin\perl.exe -w

use DBIx::Chart;
use DBI qw(:sql_types);

$DSN = 'Testing';
$DATA_SOURCE = "DBI:ODBC:$DSN";
$USER_NAME = 'sa';
$PASSWORD = 'xxxxx';
$DB = 'test';
$dbh = DBIx::Chart->connect($DATA_SOURCE, $USER_NAME, $PASSWORD,
{RaiseError => 1, AutoCommit => 0})
or die "Cannot connect to $DATA_SOURCE: $DBI::errstr \n";

$sql = qq( select USRTAB09, count(*)as shop_count
from $DB..PCB00175
where PCBJOBNUMBER not like 'S%' and PCBJS != 'Closed'
group by USRTAB09
order by shop_count desc
returning linegraph(*)
where width = 1200 and height = 800
and x_axis='Tasks'
and y_axis='Count'
and keeporigin = 1
and showpoints = 1
and format = 'png'
and maptype = 'HTML'
and mapname = 'plot'
);
$rsth = $dbh->prepare($sql);
$rsth->execute;
$row = $rsth->fetchrow_arrayref;

# output picture
open(OUTF, '>graph.png');
binmode OUTF;
print OUTF $$row[0];
close OUTF;

$dbh->disconnect;


Thanks for any help,
Walt (warsting@xxxxxxxxx)

.



Relevant Pages

  • Re: Encrypting files
    ... >> I think this has something to do with the get16, when decrypting I ... The script works now, but I only have one small ... binmode INF; ... binmode OUTF; ...
    (comp.lang.perl.misc)
  • Re: Error in DBD::Chart (called from DBIx::Chart)
    ... Use of uninitialized value in string ne at ... Why does this fail? ... This is the script used to create a composite of 2 line graphs on to ... binmode OUTF; ...
    (comp.lang.perl.modules)
  • DBIx::Chart and Params
    ... I'm using Activestate 5.6.1 with DBI v1.48, ... Script works great if I code a literal. ... binmode OUTF; ...
    (perl.dbi.users)
  • Write to file problem
    ... Having done some programs in TCL over the years, ... and write the USB hotplug driver in TCL too. ... usb-storage script, but found that the script can open a file in /tmp, ... puts $outf "Test line" ...
    (comp.lang.tcl)