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

And when I run this script from command line, I get proper results..

Replies are listed 'Best First'.
Re^10: CGI-SQL Query Issue
by Mr. Muskrat (Canon) on Mar 18, 2016 at 15:36 UTC

    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.

      Hi, I do understand the proposal to check the environment, but I was looking for some workaround that could work. Now it seems like it won't, so I would check the environment. Going forward, could you please suggest what needs to be done? From Corion comments I could get this part that the user of web server doesn't has access to the Oracle libraries, or does not detect "sqlplus" commands. Also I tried to use DBI module to connect to DB in a different script, which I tried to trigger from the main script, but to no good. Could you please in particular what do I need to tell the LINUX infra team, as I just don't have any privileges in the system to do it myself. Thanks in advance for your help. Regards

        I also already linked the "Basic Debugging Checklist" for you. This list is not for admiration. It contains concrete, actionable points, and you should perform all the actions described there and inspect the results. Most actions are presented together with a rationale of which problem the action tries to diagnose. Maybe you can find out whether one of the actions diagnoses a problem you have.

        What error did you get from using DBI ?. Try this simple script

        #!/usr/bin/perl use strict; use warnings; use CGI; use CGI::Carp 'fatalsToBrowser'; use DBD::Oracle; my $q = new CGI; my $dbh = DBI->connect( 'dbi:Oracle:host=localhost;sid=DB','USER','PASSWORD', {RaiseError => 1 , PrintError => 0} ); my ($msg) = $dbh->selectrow_array( 'SELECT CURRENT_TIMESTAMP FROM DUAL'); print $q->header,$q->start_html, $q->h2($msg),$q->end_html;
        poj