DBD::Chart::st execute failed
DBD::Chart::st execute failed
am 03.01.2007 14:45:43 von tzago
------_=_NextPart_001_01C72F3D.76A2891F
Content-Type: text/plain;
charset="windows-1250"
Content-Transfer-Encoding: quoted-printable
=20
Whenever when I try to plot a percentage value, I get these erros.
=20
DBD::Chart::st execute failed: Supplied value not compatible with target =
field at parameter 1. at gv_ind_1_18.pl line 147.
Can't take log of -2e+38 at =
/usr/lib/perl5/site_perl/5.8.0/DBD/Chart/Plot.pm line 1591.
=20
My data type is set to Float
=20
$dbh->do('CREATE CHART tb_serie_1 (HORA CHAR(30), serie_1 FLOAT)');
$sth =3D $dbh->prepare('INSERT INTO tb_serie_1 VALUES( ?, ?)');
$sth->func(1, \@SERIES_CAT, chart_bind_param_array);
$sth->func(2, \@SERIES_VAL_1, chart_bind_param_array);
%stsary =3D ();
$sth->func(\%stsary, chart_bind_param_status);
$sth->execute;
$sth->finish();
=20
Then I tried to change the data type to DECIMAL with no avail.
=20
To solve this problem I have to multiply the SERIES_CAT by 10, but the =
value shown in my graph is not the correct percentage, once the values =
are multiplied by 10.
=20
Any Idea how I can solve this problem?
=20
Thanks in advance.
=20
BR=92s
=20
Thiago
=20
=20
--=20
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.16.3/614 - Release Date: 2/1/2007 =
14:58
=20
------_=_NextPart_001_01C72F3D.76A2891F--
RE: DBD::Chart::st execute failed
am 03.01.2007 15:01:36 von tzago
------_=_NextPart_001_01C72F3F.AE7E6D1E
Content-Type: text/plain;
charset="windows-1250"
Content-Transfer-Encoding: quoted-printable
=20
I=92mean multiply SERIES_VAL_1 by 10 and not SERIES_CAT as mentioned =
before.
=20
=20
Tks!
=20
Thiago
_____ =20
From: THIAGO LACERDA ZAGO=20
Sent: quarta-feira, 3 de janeiro de 2007 11:46
To: 'Dean Arnold'
Cc: dbi-users@perl.org
Subject: DBD::Chart::st execute failed
=20
=20
Whenever when I try to plot a percentage value, I get these erros.
=20
DBD::Chart::st execute failed: Supplied value not compatible with target =
field at parameter 1. at gv_ind_1_18.pl line 147.
Can't take log of -2e+38 at =
/usr/lib/perl5/site_perl/5.8.0/DBD/Chart/Plot.pm line 1591.
=20
My data type is set to Float
=20
$dbh->do('CREATE CHART tb_serie_1 (HORA CHAR(30), serie_1 FLOAT)');
$sth =3D $dbh->prepare('INSERT INTO tb_serie_1 VALUES( ?, ?)');
$sth->func(1, \@SERIES_CAT, chart_bind_param_array);
$sth->func(2, \@SERIES_VAL_1, chart_bind_param_array);
%stsary =3D ();
$sth->func(\%stsary, chart_bind_param_status);
$sth->execute;
$sth->finish();
=20
Then I tried to change the data type to DECIMAL with no avail.
=20
To solve this problem I have to multiply the SERIES_CAT by 10, but the =
value shown in my graph is not the correct percentage, once the values =
are multiplied by 10.
=20
Any Idea how I can solve this problem?
=20
Thanks in advance.
=20
BR=92s
=20
Thiago
=20
=20
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.16.3/614 - Release Date: 2/1/2007 =
14:58
--=20
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.16.3/614 - Release Date: 2/1/2007 =
14:58
=20
------_=_NextPart_001_01C72F3F.AE7E6D1E--
Re: DBD::Chart::st execute failed
am 03.01.2007 18:53:16 von darnold
THIAGO LACERDA ZAGO wrote:
>
>
> Whenever when I try to plot a percentage value, I get these erros.
>
> DBD::Chart::st execute failed: Supplied value not compatible with target field at parameter 1.
> at gv_ind_1_18.pl line 147.
>
> Can't take log of -2e+38 at /usr/lib/perl5/site_perl/5.8.0/DBD/Chart/Plot.pm line 1591.
>
>
> My data type is set to Float
>
> $dbh->do('CREATE CHART tb_serie_1 (HORA CHAR(30), serie_1 FLOAT)');
>
> $sth = $dbh->prepare('INSERT INTO tb_serie_1 VALUES( ?, ?)');
>
> $sth->func(1, \@SERIES_CAT, chart_bind_param_array);
>
> $sth->func(2, \@SERIES_VAL_1, chart_bind_param_array);
>
> %stsary = ();
>
> $sth->func(\%stsary, chart_bind_param_status);
>
> $sth->execute;
>
> $sth->finish();
>
What version of DBD::Chart are you using ?
How big are the arrays you're binding ?
Do you know which value is causing the error ?
Can you send the list of values you're trying to
bind ? (Send to me directly, preferably not to the
dbi list)
Regards,
Dean Arnold
Presicient Corp.
Re: DBD::Chart::st execute failed
am 04.01.2007 18:38:09 von darnold
THIAGO LACERDA ZAGO wrote:
> Good morning!
>
> Dean,
>
> I'm using DBD::Chart version that I downloaded from I don't remember exactly where, but it is this one: DBD-Chart-0.82.tar.gz.
> I read thoroughly the README.txt file and proceeded exactly as its recommendations.
>
> The array bond is the size of 20 values length.
>
The issue is the use of the comma as the decimal separator.
The regex I borrowed to validate float/decimal values doesn't
support it. I also suspect it will confuse Perl, e.g., run:
perl -e "$x = '0,5'; print 124 * $x, qq/\n/;"
and you'll likely get undesired results. Keep in mind that something
like "1,234,567" might also be interpretted as a float/decimal...but
whether its 1234567 or 1234.567 is a bit nebulous as well.
So you have 2 options:
1. Change your numbers to use a period instead of comma for the decimal point.
2 Hack your copy of Chart.pm at line 1663 to change
($p=~/^[\-\+]?\d+(\.\d+(E[\-\+]?\d+)?)?$/i));
to
($p=~/^[\-\+]?\d+([\.,]\d+(E[\-\+]?\d+)?)?$/i));
However, I can't be certain the latter won't break something
later during evaluation...I'll leave that to you to test.
Dean Arnold
Presicient Corp.
Re: DBD::Chart::st execute failed
am 04.01.2007 19:55:40 von darnold
THIAGO LACERDA ZAGO wrote:
> Good evening!
>
> Dean,
>
> Actually, the values I sent to you were not from my perl print function,
> it was from the result of my TOAD query.
>
>
> As you can see, @SERIES_VAL_1 is filled right in the Fetch loop above.
>
> The print result is shown bellow.
>
> serie_1 = 0
> serie_1 = .72
> serie_1 = 0
> serie_1 = 0
> serie_1 = .68
> serie_1 = .98
OK, it looks like its the fractionals wo/ leading zero. Which is a bug
in DBD::Chart.
So rather than modifying the regex, here's some patches to replace
it with a better test:
At Chart.pm line 1570, change
use DBI qw(:sql_types);
to
use DBI qw(:sql_types looks_like_number);
At line 1663, change
($p=~/^[\-\+]?\d+(\.\d+(E[\-\+]?\d+)?)?$/i));
to
(looks_like_number($p))[0]);
That seems to fix it for me.
- Dean