Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to execute "alter session" commands in perl

Status
Not open for further replies.

ktsrikanth

Programmer
Feb 6, 2001
22
0
0
US
hi,

We are using Oracle database and or the performance checks we need to execute a Oracle command like,
alter session set sql_trace = TRUE ;
after we establish the conection with oracle. I was wondering if you have any sample code where you can execute these alter session commands for oracle database thru' perl.

Thanks,
Rajesh
 
I imagine you would execute those commands just as you would any other SQL command. Use the DBI Perl module (available at CPAN) with its Oracle DBD counterpart, and invoke the do() method with your "alter session" statement (documentation is available with the DBI module that will explain the syntax).

brendanc@icehouse.net
 
Rajesh,

How are you connecting to Oracle? Could you post some source code demostrating how you do it? Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
don't know if you've found an answer yet, but we do this and it works--assume you can connect with DBD::Oracle, and that $dbh is your database handle

$date_conv = $dbh->prepare("ALTER SESSION SET NLS_DATE_FORMAT = 'MM/DD/YYYY HH24:MI:SS'");
$try = $date_conv->execute; Brad Gunsalus
Cymtec Systems, Inc.
bgunsalus@cymtec.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top