PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Mark Sutfin <MSutfin at affinitygroup dot com>
Subject: RE: BCP to SQL 2000
Date: Sep 24 2002 4:10PM

I haven't made this work yet, (due to permissions and db_option settings)
but I'm getting closer. Perhaps you'd like to take a stab at it...

use strict;
use MSSQL::DBlib;
use MSSQL::DBlib::Const::BCP;

my $user 		= 'msutfin';
my $pass 		= 'xxxxxxx';
my $server 		= 'online-staging';
my $database 	= 'ccr_dev';
my $table		= 'personofferhistoryload';
my $datafile 	= 'g:\agisdev\docs\currdev\11425\bcp_infile.txt';
my $errfile 	= 'g:\agisdev\docs\currdev\11425\bcp_errfile.txt';
my $direction	= DB_IN;

my $dbh 	= MSSQL::DBlib->dblogin($user, $pass, $server);
my $use_status = $dbh->dbuse($database);
my $init_status = $dbh->bcp_init($table, $datafile, $errfile, $direction);
my ($status, $rows_copied) = $dbh->bcp_exec;
print "status: $use_status\n";
print "rows_copied: $rows_copied\n";

$dbh->dbclose;


-----Original Message-----
From: Shanbhag, Mitesh (London) [mailto:ShanbMit@exchange.uk.ml.com]
Sent: Tuesday, September 24, 2002 9:52 AM
To: SybPerl Discussion List
Subject: BCP to SQL 2000


Does Sybase::BCP work with SQL 2000 ? Is there some other way I can x'fer
data from UNIX (using Perl on UNIX) to a SQL server ?

Thanks,
Mitesh