2.12. SQL*Plus with Active State Perl

Perl is another language that integrates well with SQL*Plus scripts. The following is a Perl program that invokes the SQL*Plus script, Query_V1.SQL.

#######################################################
#
# Script Filename: query_v1.pl
#
# run this program with CMD> perl query_v1.pl
#######################################################
use Win32;
$Str1       = "sqlplus scott/tiger\@ora10 ";
$Str2       = "\@c:\\my_sqlplus\\query_v1 ";
$Argument1  = "status";

$Program = $Str1.$Str2.$Argument1;
system( "start $Program" );
print "end of program \n"

You can embed the invocation of Perl scripts within batch scripts. You can invoke SQL*Plus from batch scripts or from Perl. You have many options to intermix scripting languages ...

Get Programming Oracle® Triggers and Stored Procedures, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.