Professional Web Applications Themes

Error in DBD::Chart (called from DBIx::Chart) - PERL Modules

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 = 'xx'; $DB = 'test'; $dbh = DBIx::Chart->connect($DATA_SOURCE, $USER_NAME, $PASSWORD, {RaiseError => 1, AutoCommit => 0}) or die "Cannot ...

  1. #1

    Default 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 = 'xx';
    $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 = 'xx';
    $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)

    walt Guest

  2. #2

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

    walt wrote:
    > 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 = 'xx';
    > $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;
    >
    Could you provide the versions of DBIx::Chart and
    DBD::Chart you're using ? Also, at which line of your
    script does it break ? prepare(), execute(), or fetch() ?

    Once I know which version you're using, I may be able
    to pinpoint the problem.

    Regards,
    Dean Arnold
    Presicient Corp.
    Dean Arnold Guest

  3. #3

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

    walt wrote:
    > 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 = 'xx';
    > $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
    Ooops, I think I may have spotted the issue. IIRC, DBIx::Chart doesn't
    support the 'AS' keyword for subquery aliases; so instead of

    > where color = 'blue' and shape = 'fillcircle') as line1,
    ....and...
    > where color = 'green' and shape = 'opensquare') as line2
    you'll need to change to
    > where color = 'blue' and shape = 'fillcircle') line1,
    ....and...
    > where color = 'green' and shape = 'opensquare') line2
    HTH,
    Dean Arnold
    Presicient Corp.
    Dean Arnold Guest

  4. #4

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

    On Fri, 19 May 2006 11:35:05 -0700, walt wrote:
    > 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?
    Incidentally, that's a warning, not an exception, and your program did not
    stop executing at that point. It may have produced incorrect results, no
    results at all, or thrown an actual exception later, for reasons stemming
    from an uninitialized value being used, but that's a separate issue.

    --
    Peter Scott
    [url]http://www.perlmedic.com/[/url]
    [url]http://www.perldebugged.com/[/url]

    Peter Scott Guest

Similar Threads

  1. stacked Bar chart/Line chart hybrid- Charting
    By Bayani Portier in forum Macromedia Flex General Discussion
    Replies: 4
    Last Post: February 15th, 12:33 PM
  2. which chart to use
    By sohilr in forum Macromedia Flex General Discussion
    Replies: 0
    Last Post: May 6th, 09:35 AM
  3. Refreshing chart data doesnt update chart
    By Mission2k in forum Macromedia Flex General Discussion
    Replies: 2
    Last Post: April 13th, 11:21 PM
  4. DBIx::Chart running out of cursors in Oracle
    By Robert Anderson in forum PERL Modules
    Replies: 1
    Last Post: May 11th, 07:34 PM
  5. Replies: 1
    Last Post: July 15th, 07:30 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139