CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner:
Perl Oracle connectivity without password


New User

Jan 24, 2013, 1:27 PM

Post #1 of 2 (1097 views)
Perl Oracle connectivity without password Can't Post

friends could one of the perl expert tell me what I'm doing wrong here?

I'm still learning perl so newbie with this..whatever I do my connection string doesn't work.

1. trying to connect oracle database with perl script with below argument on cmd prompt.

`$ list_tables /@testdb`

2. Query dba_tables and list tables of user ABC
3. Also get output in logfile

> #!/usr/local/bin/perl -w
> use strict;
> use Getopt::Std;
> use OracleAgent;
> use OracleLoginString;
> my exitStatus = 0;
> my %options = ();
> my $oracleLogin;
> getopts("o",'\%options);
> if (defined $options{o}) {
> $oracleLogin = $options{o};
> }
> else {
> exitWithError());
> }
> my $db = DBI->connect('dbi:Oracle:',$oracleLogin,'') or die "Can't connect to Oracle database: $DBI::errstr\n";
> exit($exitStatus);

Basically when I execute script I just want to provide instance name and not password.
$ list_tables /@testdb

I can connect from sqlplus prompt without password since using oracle login e.g. $sqlplus "/@testdb'

thanks for looking into this....



Veteran / Moderator

Jan 24, 2013, 6:16 PM

Post #2 of 2 (1076 views)
Re: [khallas301] Perl Oracle connectivity without password [In reply to] Can't Post

Try passing an empty string for the password.


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives