FAQ
Hi all, I'm new in DBI and I'm really stuck, some can explain me this code:

use DBI;

my $dbh = DBI->connect( 'dbi:Oracle:db',
'$username',
'$passwd',
) or die "$DBI::errstr";
EOF

its supposed I get a connection with that ?

'dbi:Oracle:db' -> this is the driver and the database associated,
where I can config the host where the Oracle DB resides ?

Please excuse if my question is stupid but I search in the docs and
nothing about this is explained....

Hernan Dario A.

--
No matter how fast processors get,
software consistently finds new ways to eat up the extra speed

Search Discussions

  • Reidy, Ron at Jan 13, 2005 at 7:19 pm
    Please read the DBD::Oracle docs http://search.cpan.org/~timb/DBD-Oracle-1.16/Oracle.pm

    -----------------
    Ron Reidy
    Lead DBA
    Array BioPharma, Inc.


    -----Original Message-----
    From: Hernan Arredondo
    Sent: Thursday, January 13, 2005 12:11 PM
    To: dbi-users@perl.org
    Subject: New in DBI


    Hi all, I'm new in DBI and I'm really stuck, some can explain me this code:

    use DBI;

    my $dbh = DBI->connect( 'dbi:Oracle:db',
    '$username',
    '$passwd',
    ) or die "$DBI::errstr";
    EOF

    its supposed I get a connection with that ?

    'dbi:Oracle:db' -> this is the driver and the database associated,
    where I can config the host where the Oracle DB resides ?

    Please excuse if my question is stupid but I search in the docs and
    nothing about this is explained....

    Hernan Dario A.

    --
    No matter how fast processors get,
    software consistently finds new ways to eat up the extra speed

    This electronic message transmission is a PRIVATE communication which contains
    information which may be confidential or privileged. The information is intended
    to be for the use of the individual or entity named above. If you are not the
    intended recipient, please be aware that any disclosure, copying, distribution
    or use of the contents of this information is prohibited. Please notify the
    sender of the delivery error by replying to this message, or notify us by
    telephone (877-633-2436, ext. 0), and then delete it from your system.
  • Vergara, Michael \(TEM\) at Jan 13, 2005 at 7:20 pm
    Hernan:

    In your string 'dbi:Oracle:db', the characters 'db' need
    to be replaced with your Oracle SID. For example, if
    your database's SID is 'TEST' (e.g.: you connect to the
    database with "sqlplus system/manager@TEST"), then
    your code should read 'dbi:Oracle:TEST'.

    HTH,
    Mike


    -----Original Message-----
    From: Hernan Arredondo
    Sent: Thursday, January 13, 2005 11:11 AM
    To: dbi-users@perl.org
    Subject: New in DBI


    Hi all, I'm new in DBI and I'm really stuck, some can explain me this code:

    use DBI;

    my $dbh = DBI->connect( 'dbi:Oracle:db',
    '$username',
    '$passwd',
    ) or die "$DBI::errstr";
    EOF

    its supposed I get a connection with that ?

    'dbi:Oracle:db' -> this is the driver and the database associated,
    where I can config the host where the Oracle DB resides ?

    Please excuse if my question is stupid but I search in the docs and
    nothing about this is explained....

    Hernan Dario A.

    --
    No matter how fast processors get,
    software consistently finds new ways to eat up the extra speed
  • Hernan Arredondo at Jan 13, 2005 at 7:35 pm
    Great, was a stupid question thanks...


    On Thu, 13 Jan 2005 11:20:04 -0800, Vergara, Michael (TEM)
    wrote:
    Hernan:

    In your string 'dbi:Oracle:db', the characters 'db' need
    to be replaced with your Oracle SID. For example, if
    your database's SID is 'TEST' (e.g.: you connect to the
    database with "sqlplus system/manager@TEST"), then
    your code should read 'dbi:Oracle:TEST'.

    HTH,
    Mike


    -----Original Message-----
    From: Hernan Arredondo
    Sent: Thursday, January 13, 2005 11:11 AM
    To: dbi-users@perl.org
    Subject: New in DBI

    Hi all, I'm new in DBI and I'm really stuck, some can explain me this code:

    use DBI;

    my $dbh = DBI->connect( 'dbi:Oracle:db',
    '$username',
    '$passwd',
    ) or die "$DBI::errstr";
    EOF

    its supposed I get a connection with that ?

    'dbi:Oracle:db' -> this is the driver and the database associated,
    where I can config the host where the Oracle DB resides ?

    Please excuse if my question is stupid but I search in the docs and
    nothing about this is explained....

    Hernan Dario A.

    --
    No matter how fast processors get,
    software consistently finds new ways to eat up the extra speed

    --
    No matter how fast processors get,
    software consistently finds new ways to eat up the extra speed
  • Ronald J Kimball at Jan 13, 2005 at 7:50 pm

    Hernan Arredondo wrote:

    Hi all, I'm new in DBI and I'm really stuck, some can explain me this
    code:

    use DBI;

    my $dbh = DBI->connect( 'dbi:Oracle:db',
    '$username',
    '$passwd',
    ) or die "$DBI::errstr";
    EOF
    Aside from the SID issue, you have single quotes around $username and
    $passwd, which means you are passing those literal strings as the username
    and password, rather than the contents of the variables. You don't need
    quotes at all around individual variables:

    my $dbh = DBI->connect( 'dbi:Oracle:db',
    $username,
    $passwd,
    ) or die $DBI::errstr;

    (with the correct SID still needing to be inserted)


    Ronald

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdbi-users @
categoriesperl
postedJan 13, '05 at 7:11p
activeJan 13, '05 at 7:50p
posts5
users4
websitedbi.perl.org

People

Translate

site design / logo © 2022 Grokbase