Akopia Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date ][Interchange by thread ]

RE: [mv] mv3.14-3 and Sybase ASAny DBI



some more background info on the server:

the sybase server runs as cc-shop. the database is called servershop. it
contains the table artikel.

with this perlscript i can retrieve data from it:


#!/usr/bin/perl -w
use DBI;
use strict;
my($database) = "SERVERSHOP";   
my($data_source) = "DBI:ASAny:$database";
my($username) = "UID=minivend;PWD=123654;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__



but i really dont know how to write the catalof.cfg so it connects. how
can i give the ENG parameter?


thanks for any help!

klaus


_______________________________________________
Minivend-users mailing list
Minivend-users@minivend.com
http://www.minivend.com/mailman/listinfo/minivend-users


Search for: Match: Format: Sort by: