[sf-perl] Opening a pipe to sqlplus

Loo, Peter # PHX Peter.Loo at source.wolterskluwer.com
Tue Oct 3 10:56:08 PDT 2006


Hi Dan,

I have finally freed up to look into Expect.pm.  So far, I am impressed
and find it to be a useful package.  However, there isn't much
documentation out there.  I used the code that you had sent below
exactly with one additional line:

$sqlplus->send("quit\n");

Instead of quiting out, I am just stuck at the SQL> prompt.

SQL*Plus: Release 9.2.0.4.0 - Production on Tue Oct 3 10:55:24 2006

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

Enter password: 
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bit
Production
With the Partitioning, OLAP and Data Mining options

Am I doing something wrong?
 
Peter

-----Original Message-----
From: sanfrancisco-pm-bounces+peter.loo=source.wolterskluwer.com at pm.org
[mailto:sanfrancisco-pm-bounces+peter.loo=source.wolterskluwer.com at pm.or
g] On Behalf Of Loo, Peter # PHX
Sent: Monday, July 10, 2006 3:19 PM
To: San Francisco Perl Mongers User Group
Subject: Re: [sf-perl] Opening a pipe to sqlplus


Thanks Dan, I am looking into Expect as we don't have it installed here.
 
Peter

-----Original Message-----
From: sanfrancisco-pm-bounces+peter.loo=source.wolterskluwer.com at pm.org
[mailto:sanfrancisco-pm-bounces+peter.loo=source.wolterskluwer.com at pm.or
g] On Behalf Of Dan Sully
Sent: Monday, July 10, 2006 9:55 AM
To: San Francisco Perl Mongers User Group
Subject: Re: [sf-perl] Opening a pipe to sqlplus

* Loo, Peter # PHX shaped the electrons to say...

>I was just wondering if anyone knows how to code an "open" statement to

>"sqlplus" while concealing the userid and password.  The problem that I

>am having is when the pipe is opened, one can view the userid and 
>password using the Unix command "ps -ef".

Something like this:

my $sqlplus = Expect->spawn('sqlplus', join('@', $username, $sid));

$sqlplus->expect(30, ['Enter password: ', sub {
	my $self = shift;
	$self->log_stdout(0);
	$self->send("$password\r");
	$self->expect(0, '-re', "\r\n");
	$self->log_stdout(1);
}]);

$sqlplus->interact;


-D
--
dd if=/dev/sarcasm of=/dev/clue
_______________________________________________
SanFrancisco-pm mailing list
SanFrancisco-pm at pm.org
http://mail.pm.org/mailman/listinfo/sanfrancisco-pm


This E-mail message is for the sole use of the intended recipient(s) and
may contain confidential and privileged information.  Any unauthorized
review, use, disclosure or distribution is prohibited.  If you are not
the intended recipient, please contact the sender by reply E-mail, and
destroy all copies of the original message.
_______________________________________________
SanFrancisco-pm mailing list
SanFrancisco-pm at pm.org
http://mail.pm.org/mailman/listinfo/sanfrancisco-pm


This E-mail message is for the sole use of the intended recipient(s) and
may contain confidential and privileged information.  Any unauthorized
review, use, disclosure or distribution is prohibited.  If you are not
the intended recipient, please contact the sender by reply E-mail, and
destroy all copies of the original message.


More information about the SanFrancisco-pm mailing list