Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2004

    Unanswered: Conneting to Oracle DB using Perl


    I am very new to perl and have installed the DBI and DBD package, however when using the following syntax:

    use DBI;

    # Connect to the Database
    my $db = DBI->connect("dbi:Oracle:xcal2k ", "username", "password", { AutoCommit => 0 } );

    # check connect to DB
    $db or (print <<EOD
    Error: Can't connect to database
    and die $DBI::errstr);

    print "connected.\n";

    I get the following error: DBI connect failed: ORA-24315: illegal attribute type (DBD ERROR: OCIAttrGet OCI_ATTR_ENV_CHARSET_ID) etc

    I have checked the service name 'xcal2k' exists in my TNS names file and is set up correctly. I can run this script on my colleagues pc's successfully. The only difference our pc's have is that I have multiple homes, is this the cause? if so how do I get around this?

    Any help would be greatly appreciated...

  2. #2
    Join Date
    Nov 2004

    Connection problems to DBI Oracle

    Hi dsehmby,
    Instead of using your code, try this:
    # Connect to the Database
    $db = DBI->connect("dbi:Oracle:xcal2k ", 'username', 'password') || die "Unable to connect to xcal2k: DBI::errstr\n";

    Hope this works,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts