in reply to Re^6: CGI-SQL Query Issue
in thread CGI-SQL Query Issue

Create a file called dual.sql in cgi-bin with these 2 lines

select SYSDATE from dual; exit;

Create and access this cgi program

#!/usr/bin/perl use strict; use warnings; use CGI; use CGI::Carp 'fatalsToBrowser'; my $sqlfile = '/var/www/cgi-bin/dual.sql'; my $q = new CGI; my $connstr = 'USER/PASSWORD@DB'; my $msg = qx"sqlplus -s $connstr \@$sqlfile"; print $q->header,$q->start_html, $q->pre($msg),$q->end_html;
poj

Replies are listed 'Best First'.
Re^8: CGI-SQL Query Issue
by Anonymous Monk on Mar 18, 2016 at 15:22 UTC
    Hi, When I run this script, with this sql configured, I don't get any result on the web page. SQL does not seem to work. Regards
      And when I run this script from command line, I get proper results..

        Corion has already (correctly) told you multiple times that the web server doesn't know where to find sqlplus and that you will need to modify the environment in order to move forward.