cancel
Showing results for 
Search instead for 
Did you mean: 

Need help on DBD::MaxDB

Former Member
0 Kudos

Hi,

I am new to MaxDB, I have installed DBD::MaxDB perl package on CentOS X64.

I am able to connect and fetch data from localhost but when i am trying to connect to remote database (MaxDB) it fails, with and error.

DBI connect('database=<Name>:host=<host_name>,...) failed: Connection failed (RTE:serverDB name too long) at perl2_maxdb_connect.pl line 13

conn at perl2_maxdb_connect.pl line

Also it gives an error as,

DBI connect('<Database_name>:'<Host_name>',...) failed: Connection failed (RTE:database not running: no request pipe) at perl2_maxdb_connect.pl line 13

conn at perl2_maxdb_connect.pl line

Please find my Perl script as below,

use DBI;

use DBD::MaxDB;

$platform = "MaxDB";

$database = "<Name_of_Database>";

$host = "<Remote_Host_Name>";

$user123 = "<User_Name>";

$pw = "<Password>";

$dsn = "dbi:MaxDB:$database:$host";

$dbn = DBI->connect($dsn, $user123, $pw) or die "conn";

$query = "SELECT * FROM ";

$query_handle = $dbn->prepare($query);

$query_handle->execute();

$query_handle->bind_columns(undef,\$name_cl1,\$name_c2);

while ($query_handle->fetch()) {

print "$name_cl1,$name_c2\n";

}

Please let me know if i am missing something.

Accepted Solutions (0)

Answers (1)

Answers (1)

thomasschulz2
Participant
0 Kudos

Hi,

if you take a look to the man page (man DBD::MaxDB), you can find this syntax for the connection URL:

"dbi:MaxDB:/<database_server>[:<port>]/<database_name>[?<options>]"

At our environment (openSuse), we had to remove the first slash, so that this version should work for you:

...

$dsn = "dbi:MaxDB:$host/$database";

...

Regards,

Thomas

0 Kudos

Hi Thomas,

Thanks a lot, this saved me lots of debugging and investigation time

Regards,

Bala.