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

Thanks for your reply, but the code seems to not work in my environment. Here is what is get :
name of the script is monk.pl... URL- "http://el2310/cgi-bin/monk.pl"
when I press enter, I get below error message:
Internal Server Error The server encountered an internal error or misconfiguration and was u +nable to complete your request. Please contact the server administrator, root@localhost and inform the +m of the time the error occurred, and anything you might have done th +at may have caused the error. More information about this error may be available in the server error + log.
-------------------------------------------------------------------------------- Apache/2.2.15 (Red Hat) Server at el2310 Port 80 ************* when I try to run it from command line, I get below error:
[ccacp@el2310 cgi-bin]$ perl monk.pl Can't locate Time/Piece.pm in @INC (@INC contains: /comptel/ccacp/elin +k/common/6.3/perl/lib/5.8.9/x86_64-linux-thread-multi /comptel/ccacp/ +elink/common/6.3/perl/lib/5.8.9 /comptel/ccacp/elink/common/6.3/perl/ +lib /comptel/ccacp/elink/common/6.3/perl/lib/site_perl/5.8.9/x86_64-l +inux-thread-multi /comptel/ccacp/elink/common/6.3/perl/lib/site_perl/ +5.8.9 /comptel/ccacp/elink/common/6.3/perl/lib/site_perl /comptel/cca +cp/elink/common/6.3/comptel_utilities/ctl_info/lib /comptel/ccacp/eli +nk/common/current/perl/lib/5.8.9/x86_64-linux-thread-multi /comptel/c +cacp/elink/common/current/perl/lib/5.8.9 /comptel/ccacp/elink/common/ +current/perl/lib/site_perl/5.8.9/x86_64-linux-thread-multi /comptel/c +cacp/elink/common/current/perl/lib/site_perl/5.8.9 /comptel/ccacp/eli +nk/common/current/perl/lib/site_perl /comptel/ccacp/elink/EventLink/b +ase/bin /temp/cpt2sve/comptel_common/tmp_cpt2sve/install/LINUXintel/p +erl/lib/5.8.9/x86_64-linux-thread-multi /temp/cpt2sve/comptel_common/ +tmp_cpt2sve/install/LINUXintel/perl/lib/5.8.9 /temp/cpt2sve/comptel_c +ommon/tmp_cpt2sve/install/LINUXintel/perl/lib/site_perl/5.8.9/x86_64- +linux-thread-multi /temp/cpt2sve/comptel_common/tmp_cpt2sve/install/L +INUXintel/perl/lib/site_perl/5.8.9 .) at monk.pl line 5. BEGIN failed--compilation aborted at monk.pl line 5.
************************ Please suggest.

Replies are listed 'Best First'.
Re^5: CGI-SQL Query Issue
by Corion (Patriarch) on Mar 18, 2016 at 11:23 UTC

    You're using an outdated version of Perl that has been unsupported for over five years. Either get your sysadmin to install the Time::Piece module, which also likely is available as a RedHat package, or install it yourself.

    Preferrably, you upgrade to a more recent version of Perl 5, like 5.22.

      I removed the "Time/Piece.pm" part from the code & tried to rerun it. This time the script worked, but when I enter the dates I just get the output as "Result for 20160303 to 20160320", I entered START DATE as 20160303 & END DATE as 20160320... Dates Start date : yyyy-mm-dd End date : yyyy-mm-dd Result for 20160303 to 20160320 The sql query result is not getting populated in the web page output. Could you suggest?

        Most likely, the sqlplus command is not being found, or it has an error. This could be, as I already told you, due to differences between your user and the user your script is being run under from the webserver. I also told you how you could start debugging this. Maybe now is a good time to revisit that link and start debugging the issue yourself?