Re: DBIx::Chart, ORA-00907: missing right parenthesis
- From: "Bala" <balaknathan@xxxxxxxxx>
- Date: 20 Nov 2005 23:14:34 -0800
I think it's possibly the qoute at the start which does not have a
proper matching one at the end of the query. Your script looks fine and
the error is thrown just by DBI
- Bala
Jeya wrote:
> Hi,
> I'm getting following error when I use the below attached script. I'm
> trying to generate multiline graph. Can any body help me. What am I
> doing wrong?
>
> Error message:
> ----------------------------------------------------------------------------------------------------------------------------------
> Prep chart:
> ORA-00907: missing right parenthesis (DBD ERROR: error possibly near
> <*> indicator at char 489 in 'select * from
>
> (select
> to_char(sample_date, 'dd-MON-yyyy') Dt,
> to_number(replace(total_m,',','')) Total_M
>
> from
> dbreg.DATABASE_MONTHLY_GROWTH
>
> where
> DB_ID = 'GIS_PRD'
> AND TABLESPACE = 'GIS_DATA'<*>')
>
> ---------------------------------------------------------------------------------------------------------------------------------
>
>
> =================THE SCRIPT======================================
>
> #!/apps/oracle/ActivePerl/bin/perl -w
>
> use CGI::Carp qw(fatalsToBrowser);
> use Date::Calc qw(:all);
> use DBIx::Chart;
>
> #use DBI qw(:sql_types);
>
>
>
> #$|=1;
>
> #$^W=1;
>
>
>
> $dbh = DBIx::Chart->connect('dbi:Oracle:PD_DBREGPD', '******', '*****'
> , { PrintError => 0, RaiseError => 0, AutoCommit => 0 })
>
> or die "Cannot connect\n";
>
> $qry = $dbh->prepare("select * from
> (select
> to_char(sample_date, 'dd-MON-yyyy') Dt,
> to_number(replace(total_m,',','')) Total_M
>
> from
> dbreg.DATABASE_MONTHLY_GROWTH
>
> where
> DB_ID = 'GIS_PRD'
> AND TABLESPACE = 'GIS_DATA'
> returning linegraph(*)
> where color=red ) Total,
> (select
> to_char(sample_date, 'dd-MON-yyyy') Dt,
> to_number(replace(used_m,',','')) Used_M
>
> from
> dbreg.DATABASE_MONTHLY_GROWTH
>
> where
> DB_ID = 'GIS_PRD'
> AND TABLESPACE = 'GIS_DATA'
> returning linegraph(*)
> where color=red ) Used
> returning image, image
> WHERE
> WIDTH=600 AND HEIGHT=400 AND format='PNG' and
> KEEPORIGIN=1 and SHOWGRID=1 and linewidth=2 and
> gridcolor='lgray' and x_orient='VERTICAL' and
> x_axis = ' ' and y_axis = 'MB' and
> SIGNATURE='IPG-DBS : Jeyakanthan' and
> TITLE = 'Table Growth (GIS_DATA)' and
> MAPTYPE='HTML'",{
> chart_type_map => [
> [ { NAME => 'Dt', TYPE => SQL_VARCHAR, PRECISION => 20 },
> { NAME => 'Total_M', TYPE => SQL_NUMBER } ],
> [ { NAME => 'Dt', TYPE => SQL_VARCHAR, PRECISION => 20 },
> { NAME => 'Used_M', TYPE => SQL_NUMBER } ],
> ],
> }
>
> )|| die("Prep chart:\n$DBI::errstr\n");
>
> #$qry->bind_param(1, $tbl);
>
> $qry->execute() || die("Exec chart:\n$DBI::errstr\n");
>
> $img = $qry->fetchrow_arrayref;
> dump_img($img,'png','test',1);
>
> $qry->finish;
> $dbh->commit;
> $dbh->disconnect;
>
>
> sub dump_img {
> my ($row, $fmt, $fname, $nomap) = @_;
> open(OUTF, ">../htdocs/ipg-dbs/tmp/test.png");
> binmode OUTF;
> print OUTF $$row[0];
> close OUTF;
>
> #print HTML $$row[1], "\n" unless $nomap;
> #1;
> }
>
>
> print "Content-type: text/html\n\n";
>
> print<<HTML;
>
> <html>
> <head>test</head>
> <body>
> <table>
> <tr><td><img src=/ipg-dbs/tmp/test.png usemap=#multwidth></td></tr>
> </table>
> </body>
> </html>
> HTML
>
> exit;
>
> ==========================END OF SCRIPT===========================
.
- Follow-Ups:
- References:
- Prev by Date: DBIx::Chart, ORA-00907: missing right parenthesis
- Next by Date: ANNOUNCE: DBD::monetdb 0.07
- Previous by thread: DBIx::Chart, ORA-00907: missing right parenthesis
- Next by thread: Re: DBIx::Chart, ORA-00907: missing right parenthesis
- Index(es):
Relevant Pages
|