Re: ORACLE DRIVER



Cyril,
Check out http://www.orafaq.com/faq/perl
The Oracle DBD is a perl module you may need to install. Once you have
it, you have only to change the dbi connect parameter to use the
Oracle driver rather than ODBC. The beauty of DBI;-)

DBI->connect('dbi:Oracle:INSTANCE', 'cyril', 'cyril123')
# where INSTANCE is your Oracle database instance name

Regards,
Paul

On Dec 27, 2007 4:24 PM, <Cyril.George@xxxxxxxxxxxxxxxxxx> wrote:
Hi Paul,
Thanks for the reply.

The perl script im using for database connection is this:
[trap is a table in my oracle database & ORACLE is the dsn name]

use DBI;
use strict;

my $dbh = DBI->connect('dbi:odbc::ORACLE', 'cyril', 'cyril123')
or die "error creating handle\n";
print "db handle success ..\n";

my $sql=qq/select * from trap/;
my $sth=$dbh->prepare($sql);

$sth->execute();
my @row;
while (@row = $sth->fetchrow_array)
{
print "inside while loop:\n";

print join(", ", @row), "\n";
}

$dbh->disconnect();
print "closed db handle:\n";


the code is working and is giving me the desired output.
But I don't know how to make a connection using DBD

Here is what I got from the internet about DBD connection
#!/usr/bin/perl

use DBI
use strict;
my $driver = "mysql";
my $database = "TESTDB";
my $dsn = "DBI:$driver:database=$database";
my $userid = "testuser";
my $password = "test123";
my $dbh = DBI->connect($dsn, $userid, $password )
or die $DBI::errstr;


so if I want to connect to oracle is it that I can put oracle in place
of mysql?
Is it something :

my $dsn = "DBI:oracle:database=dbname";
my $dbh = DBI->connect($dsn, 'cyril', 'cyril123')

or is that we have to specify the DBD to load oracle driver?

And will changing the DB handle affect the rest of the program?
Kindly put some light on this please.

Thanks
--
Regards
CyRiL.
i-flex Solutions

--


-----Original Message-----
From: Paul Gallagher [mailto:gallagher.paul@xxxxxxxxx]

Sent: Thursday, December 27, 2007 1:05 PM
To: Cyril George-SJR
Cc: dbi-users@xxxxxxxx
Subject: Re: ORACLE DRIVER

Not sure I understand why you need ODBC Cyril. What program/client are
you connecting with?

I assumed it was some perl DBI script given the mailing list this is
on. If that is the case, I'd point you again to the native Oracle DBD
+ Instant Client (for Linux). ODBC not required.

Regards,
Paul

On Dec 27, 2007 1:50 PM, <Cyril.George@xxxxxxxxxxxxxxxxxx> wrote:
Hi Paul,
The thing is that I'm using in a Linux machine.
So I require an ODBC driver right?
So is there any free Oracle ODBC driver for Linux?
What I could gather was I should use Easysoft Oracle ODBC and unixODBC
manager
UnixODBC is a freeware but couldn't find any free Oracle Drivers.
Also if kindly suggest if there is any other alternative.

Thanks
--
Regards
CyRiL.
i-flex Solutions

--


-----Original Message-----
From: Paul Gallagher [mailto:gallagher.paul@xxxxxxxxx]
Sent: Thursday, December 27, 2007 10:23 AM
To: Cyril George-SJR
Cc: dbi-users@xxxxxxxx
Subject: Re: ORACLE DRIVER

Hi Cyril,

Oracle's own Instant Client kit should meet your needs. It is free,
even for production use.

I presume you are running under Windows, so see

http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/
winsoft.html
The main Instant Client site is at
http://www.oracle.com/technology/tech/oci/instantclient/index.html

Instant Client for Windows includes an ODBC driver, but if you are
using DBI you would probably benefit from using the native Oracle DBD
(and the Instant Client kit includes the necessary OCI support).

Regards,
Paul

On Dec 26, 2007 5:39 PM, <Cyril.George@xxxxxxxxxxxxxxxxxx> wrote:
Hi,

I have been using easysoft odbc driver for connecting to my oracle
database.

I want to know is there a free odbc driver that I can use for this
purpose.

Kindly assist me on this.



Thanks



Regards,

Cyril Thomas George

i-flex Solutions Ltd.

*: cyril.george@xxxxxxxxxxxxxxxxxx
<mailto:cyril.george@xxxxxxxxxxxxxxxxxx>





DISCLAIMER:
This message contains privileged and confidential information and is
intended only for an individual named. If you are not the intended
recipient, you should not disseminate, distribute, store, print, copy
or
deliver this message. Please notify the sender immediately by e-mail
if
you have received this e-mail by mistake and delete this e-mail from
your system. E-mail transmission cannot be guaranteed to be secure or
error-free as information could be intercepted, corrupted, lost,
destroyed, arrive late or incomplete or contain viruses. The sender,
therefore, does not accept liability for any errors or omissions in
the
contents of this message which arise as a result of e-mail
transmission.
If verification is required, please request a hard-copy version.



DISCLAIMER:
This message contains privileged and confidential information and is
intended only for an individual named. If you are not the intended
recipient, you should not disseminate, distribute, store, print, copy or
deliver this message. Please notify the sender immediately by e-mail if
you have received this e-mail by mistake and delete this e-mail from
your system. E-mail transmission cannot be guaranteed to be secure or
error-free as information could be intercepted, corrupted, lost,
destroyed, arrive late or incomplete or contain viruses. The sender,
therefore, does not accept liability for any errors or omissions in the
contents of this message which arise as a result of e-mail transmission.
If verification is required, please request a hard-copy version.



DISCLAIMER:
This message contains privileged and confidential information and is intended only for an individual named. If you are not the intended recipient, you should not disseminate, distribute, store, print, copy or deliver this message. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete or contain viruses. The sender, therefore, does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required, please request a hard-copy version.

.



Relevant Pages

  • RE: Bug in Oracle driver ?
    ... I still think that this is a bug in the DBD Oracle driver. ... the problem is how the driver passes these values to Oracle. ... bind:p1 done ...
    (perl.dbi.users)
  • Re: Oracle linked server : wont run if driver AllowInProc is off
    ... Why don't you use oracle driver instead? ... > I've tested a link server from msde to oracle on a win2k server test ... > DB Oracle driver i was using to interface with Oracle. ... > That server is a true SQL server and is running multiple instances. ...
    (microsoft.public.sqlserver.server)
  • Re: Oracle client driver
    ... I have an application that only requires the Oracle driver to communicate by ... You can do a custom install of the client to pick and choose ...
    (comp.databases.oracle.misc)
  • Re: executeBatch()
    ... I could see it in the oracle trace I made. ... No SQL Server Profiler says one call per statement. ... Should I test merants oracle driver too!? ...
    (microsoft.public.sqlserver.jdbcdriver)
  • Re: Need help with Access 97 and Oracle 9i
    ... I'm trying to make the connection on the my local machine. ... discussed using ODBC driver to connect to Oracle. ... I found that the Microsoft ODBC Driver doesn't ... I'm looking for anything I can get; suggestions, recommendations, ...
    (microsoft.public.access.externaldata)