DBI:ODBC - Can't connect to IBM AS400 using Linux

From: Keith Carangelo (caran_at_shore.net)
Date: 11/13/03


Date: 13 Nov 2003 06:32:37 -0800

Hello,

I'm having trouble connecting to an AS400 using DBI under Linux.
I can connect to the database fine using isql, but in Perl I get:

Connect failed to DBI:ODBC:SICASA1: [unixODBC][IBM][iSeries Access
ODBC Driver]Missing system name needed for connection.
(SQL-HY000)(DBD: db_login/SQLConnect err=-1) at tmp.pl line 16.

My Perl Program:

----------------------------------------------
#!/usr/bin/perl -w
use DBI;

# Connect to the database through ODBC.
my ($db, $user, $pass);

$db = 'DBI:ODBC:SICASA1';
$user = 'user';
$pass = 'pass';

my $dbh = DBI->connect( $db, $user, $pass )
|| die "Connect failed to $db:$DBI::errstr";
----------------------------------------------

My odbc.ini:

----------------------------------------------
[SICASA1]
Driver = iSeries Access ODBC Driver
Description = Production AS/400 Database
Trace = no
System = SICASA1.APPN.SNA.IBM.COM
DefaultPkgLibrary = TBLKMS
UID = user
PWD = pass
----------------------------------------------

Perl is 5.6.1, DBI is 1.37, DBD:ODBC is 1.06 and the IBM
iSeries ODBC Driver is version 16 (all latest)

Thanks for your help!
Keith



Relevant Pages

  • Re: Nameless CREATE
    ... The starting point is either an existing database or one that is ... "Describe" involves issuing an SQLDescribeCol function to ODBC ... essentially much the same as character data type apart from all 8 bits ... ALTER TABLE tablename ADD COLUMN BinaryColumn BINARY ...
    (comp.lang.forth)
  • Re: ODBC: Is there something called text/csv database?
    ... > SQL on a .csv. ... > Perl has something called DBI which means it is database independent. ... do I connect PerlDBI to ODBC or DBI can replace ODBC? ...
    (comp.lang.perl.misc)
  • (Slightly OT) Dec. 03 DDJ Article
    ... I couldn't find a single reference to DBI, ... and the author gives a rather elaborate description of using Perl to use ODBC ... Install DBI on client and server ...
    (perl.dbi.users)
  • Re: fields queries and utter disaster
    ... Unfortunately the \c ODBC DATABASE field switch is not supported in Word ... of course supports ODBC connections but Word ... Mac Word Test ... suggests that it should be possible to use query files (cf. .qry/.dqy ...
    (microsoft.public.mac.office.word)
  • Re: [VW 7.3.1] ODBCConnection
    ... I played around with a few combinations on the connection string and ... with a trusted SQL Server connection. ... there are differences for database connects. ... > any database specific odbc drivers. ...
    (comp.lang.smalltalk)