#!/usr/bin/perl -w use warnings; use strict; use CGI; use DBI; use CGI::Carp qw(fatalsToBrowser); my $query=new CGI; my $cgiobj = CGI -> new(); #my $xlsdata; my $querydata; my $querycreated; #print "Content-type:text/html\n\n"; my $querytitle = $cgiobj -> param('querytitle'); $ENV{ORACLE_HOME}="/home/oracle/product/10.2.0/db_1"; our $conn = DBI->connect("dbi:Oracle:host=10.0.0.1;sid=dev;","queryeditor","editor"); die($DBI::errstr) unless $conn; print $querytitle; print "Content-type: application/HTML\n"; print "Content-disposition: inline; filename=\"Report.html\"\n"; print "Pragma: no-cache\n"; print "Expires: 0\n\n"; my $query_detail1 = "select querydata from querydetail where querytitle='$querytitle'"; my $query_records1 = $conn->prepare($query_detail1) or die("Error on preparing the sql statement1 \n"); $query_records1->execute() or die("Error on getting the data from QUERYDETAIL \n"); while(my @query_resultset1= $query_records1->fetchrow_array) { my $mainquery= $query_resultset1[0]; #print $mainquery; my $query_records2 = $conn->prepare($mainquery) or die("Error on preparing the sql statement2 \n"); $query_records2->execute() or die("Error on getting the data from QUERYDETAIL \n"); print "