Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Calling binary from Perl prog and passing arguments

Reply
Thread Tools

Calling binary from Perl prog and passing arguments

 
 
vineet
Guest
Posts: n/a
 
      01-17-2008
Hi Experts,

I have sql interface which connects to oracle database. When I execute
sql, it connects to database and give prompt where user can type sql
statemets to be executed ... some thing like
$
$
$SQL;
SQL>
SQL>
SQL> select * from employee;
........<display the sql result>.......

I wanted to write wrapper script over SQL interface and read a file
having SQL statement and passed it to SQL interface.

Can you please guide me how to start writing this.
Thanks,
VS
 
Reply With Quote
 
 
 
 
Jürgen Exner
Guest
Posts: n/a
 
      01-17-2008
vineet <> wrote:
>I have sql interface which connects to oracle database. When I execute
>sql, it connects to database and give prompt where user can type sql
>statemets to be executed ... some thing like
>$
>$
>$SQL;
>SQL>
>SQL>
>SQL> select * from employee;
>.......<display the sql result>.......
>
>I wanted to write wrapper script over SQL interface and read a file
>having SQL statement and passed it to SQL interface.


If you want the Perl program to interact with the external program's STDIO
then one of the "Expect" modules from CPAN is probably the best approach.

If you just want to pass parameters to the external program then system() or
qx// will do that already.

However, maybe you should investigate if accessing the database directly
from your Perl program is the best solution. Again, there are several
modules for database access on CPAN.

jue
>
>Can you please guide me how to start writing this.
>Thanks,
>VS

 
Reply With Quote
 
 
 
 
Mark Clements
Guest
Posts: n/a
 
      01-17-2008
vineet wrote:
> Hi Experts,
>
> I have sql interface which connects to oracle database. When I execute
> sql, it connects to database and give prompt where user can type sql
> statemets to be executed ... some thing like
> $
> $
> $SQL;
> SQL>
> SQL>
> SQL> select * from employee;
> .......<display the sql result>.......
>
> I wanted to write wrapper script over SQL interface and read a file
> having SQL statement and passed it to SQL interface.
>
> Can you please guide me how to start writing this.
> Thanks,
> VS

would

sqlplus < statement.sql

not do it, where statement.sql is the file containing the SQL statements?
 
Reply With Quote
 
vineet
Guest
Posts: n/a
 
      02-01-2008
Thanks group for your valuable time and advise.
I was looking some thing like expect
Vineet
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
C++ calling perl script - Not able to get the stack arguments pushedrom XPUSH in perl script Yogi Perl Misc 1 09-13-2012 11:30 AM
Calling a function that expects variable arguments from a functionwith variable arguments Navaneeth C Programming 4 11-20-2010 05:35 AM
Reading binary file created a C++ program inside a Perl prog freesoft12@gmail.com Perl Misc 6 02-10-2010 07:03 AM
functions and arguments.length; passing unknown number of arguments oldyork90 Javascript 10 09-27-2008 03:05 AM
Starting and stopping a prog. from another prog. andoni.oconchubhair@ie.fid-intl.com Java 1 10-22-2006 10:43 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57