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

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: DBI:
its about DBI->connect() syntax

 



rajjj
Novice

Aug 11, 2006, 8:38 AM

Post #1 of 3 (2532 views)
its about DBI->connect() syntax Can't Post

hi all,

im asked to script the command "c:\>sqlplus abc/xyz@xxxx as sysdba" in perl.

that's executing in command prompt perfectly and giving the sql prompt.

how to use those words in the function " DBI->connect()" method to get a database handle.

im new to perl scripting .

can anybody help me out for this . it will be gr8ly appreciated.

thanx in advance..


d1zz13
User

Aug 11, 2006, 8:48 AM

Post #2 of 3 (2531 views)
Re: [rajjj] its about DBI->connect() syntax [In reply to] Can't Post

Rajjj,

You can just use backticks to run that actual command in the Windows OS if you want.

I have a script which calls the command like this

Code
`sqlplus $username\/$password\@$database \@$runscript`;


If you don't actually want a sqlplus session, which I imagine you don't then you can use a connect string like this

Code
my $dbhandle = DBI->connect( "dbi:Oracle:$dbname", $user, $pass, { RaiseError => 1,AutoCommit => 0 } ) or die "Can't connect to Oracle database: $DBI::errstr\n";


As for how you connect with sysdba, I'm sure a search on Google could help you out with that one.

Regards
Rich

If it aint broke then don't try to fix it


d1zz13
User

Aug 11, 2006, 8:55 AM

Post #3 of 3 (2528 views)
Re: [d1zz13] its about DBI->connect() syntax [In reply to] Can't Post

Having just checked the documentation, there are instructions for connecting as SYSDBA.

Regards
Rich

If it aint broke then don't try to fix it

 
 


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

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