[ic] connecting to sybase
Andreas, Scott
Scott.Andreas@learningco.com
Wed, 14 Mar 2001 08:42:09 -0800
If you have IC version 4.6.X look under Administraion -> info and under
Database Information if you see your DBI listed, IC can connect using that
interface. Of course you need to declare your products database in IC to
use your dbi interface.
If it not listed there, install that module within the interchange
directory, then restart the server.
Other opotions are to install the dbi::sybase perl module Or, the one that
I'm looking at that has cross compatability with Microsoft SQL serve, since
both Sybase and Microsoft SQL Servers use Tabular Data Streams, is
dbi::freeTDS.
good luck.
-----Original Message-----
From: interchange-users-admin@lists.akopia.com
[mailto:interchange-users-admin@lists.akopia.com]On Behalf Of Klaus Koch
Sent: Wednesday, March 14, 2001 6:13 AM
To: interchange-users@lists.akopia.com
Subject: [ic] connecting to sybase
hello!
i have to switch a running shop from mysql to sybase anywhere studio.
i installed the ASAny DBI driver and i am able to connect with a perl
script and recieve data (i copied this script to the end of this mail).
the running sybase server is named cc-shop and the database is called
cshop.
but i cant figure out how to connect with the shop to the new database
i tried this (and many similar) configuration:
Database products products dbi:ASAny:cshop
Database products USER ic
Database products PASS 123456
Database products ENG cc-shop
i dont know if i can pass ENG simply like this (compare perlscript).
please, can someone who works with a sybase server help me? i just dont
know what to do now...
many thanks in advance!
klaus
this is the perl script which recieves data from the database:
#!/usr/bin/perl -w
use DBI;
use strict;
my($database) = "CSHOP";
my($data_source) = "DBI:ASAny:$database";
my($username) = "UID=ic;PWD=123456;ENG=cc-shop";
my($sel_statement) = "SELECT code,searchspec,ref01 FROM artikel";
my($dbh) = &db_connect($data_source, $username, '');
&db_query($sel_statement,$dbh);
$dbh->disconnect;
exit(0);
sub db_connect {
my($source,$user,$pass) = @_;
my($dbh) = DBI->connect($source, $user, $pass);
return($dbh);
}
sub db_query {
my($sel,$h) = @_;
my($row,$sth) = undef;
$sth = $h->prepare($sel);
$sth->execute;
print "Names: @{$sth->{NAME}}\n";
print "Fields: $sth->{NUM_OF_FIELDS}\n";
print "Params: $sth->{NUM_OF_PARAMS}\n";
print "\nFirst Name\tLast_name\tTitle\n";
while($row = $sth->fetch) {
print "@$row[0]\t@$row[1]\t\t@$row[2]\n";
}
$sth->finish;
}
__END__
_______________________________________________
Interchange-users mailing list
Interchange-users@lists.akopia.com
http://lists.akopia.com/mailman/listinfo/interchange-users