0

I am using Perl 5.14.2 on Ubuntu wheezy 64 bit.

I am trying to connect to a Pervasive SQL server v9.5 that is installed on a windows 2008 machine.

I tested the connection with isql and it works properly, I tested with the following command:

isql -v <db_name>

I use the DBD:ODBC v1.39 (latest version) perl module installed from cpan.

I am using the following command to connect to sql server:

use DBI;
my $db = DBI->connect('dbi:ODBC:Moked');

Moked is the connection name that was defined in the unixodbc v2.2.14 in odbc.ini.

/etc/odbc.ini

[Moked]
Driver=PERVASIVE_ODBC
Description=Pervasive ODBC Interface: Moked
ServerName=<ip>:<port>
DBQ=MIDA
UID=
PWD=
OpenMode=0
PvTranslate=

when I try to connect with the command i showed above I get error SQL-HY001 that by googling I understood that it relates to memory allocation, usually people get these while querying and not while trying to connect/

it seems that DBI does recognize the connection because if I type a different name, for example 'Moked2', i get the error SQL-IM002 instead.

any ideas? how can I debug this issue further? any information regarding the issue would be greatly appreciated.

thanks!

Community
  • 1
  • 1
ufk
  • 30,912
  • 70
  • 235
  • 386
  • Are you running perl from the command line or is it being served through Apache (or something)? If you are serving perl from Apache, does it work if you run it from the command line? – mirtheil Aug 23 '12 at 14:07
  • What version of the PSQL Linux client are you using? – mirtheil Aug 24 '12 at 12:38
  • psql v11.20 64 bit. it happens also when I test it in command line so it's not perl's fault. even in the isql64 client it gives exact error. – ufk Aug 24 '12 at 16:05

1 Answers1

1

You are getting the memory allocation error because the PSQL v11 client cannot reliably connect to a PSQL v9.5 server. If you want to use the v11 client, you need the v11 server too. You might be able to get away with the v11 client at a Btrieve level but there were significant changes between v9 and v11 on the ODBC side.

mirtheil
  • 8,952
  • 1
  • 30
  • 29
  • welp I did some re-installations tried 32 bit and 64 bit versions several times.. tried to install from ubuntu or download cpan modules for perl. in the end it works! i had no idea why.. i can't really understand what was the problem in the first place. but the v11 client works with psql v9.5. maybe I will encounter problems later because of the version changes but at least the connection works! thanks – ufk Aug 27 '12 at 09:44