Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^7: CGI-SQL Query Issue

by poj (Abbot)
on Mar 18, 2016 at 12:50 UTC ( [id://1158225]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1158225]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (6)
As of 2024-04-19 14:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found