RE: ORACLE DRIVER



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

  • system() return code always -1 after DBI/DBD local connection
    ... I am attempting to package a common Perl v5.8.6 + DBI ... Oracle 10g client and appears to be able to connect OK ... After making a connection with DBI, ...
    (perl.dbi.users)
  • Re: 64bit Connection to Oracle
    ... You cannot use a 32 bit ODBC driver from the 64 bit world. ... I suppose that TNSPing and Oracle Sqlplus are working correctly with the 32 ... As after setting up 32 bit ODBC and then using the new ODBC connection ... ORA-06413 connection not open and when using Oracle OLE is shows ...
    (microsoft.public.sqlserver.odbc)
  • Re: possible bug in DBI with DBD::Oracle
    ... what was the ORacle version working with 1.16? ... connection method. ... to a DB using DBI once I successfully connected then failed (with ... But on one computer I get "OK NOK NOK NOK", ...
    (perl.dbi.users)
  • 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)
  • RE: ORACLE DRIVER
    ... The thing is that I'm using in a Linux machine. ... So is there any free Oracle ODBC driver for Linux? ... UnixODBC is a freeware but couldn't find any free Oracle Drivers. ...
    (perl.dbi.users)