|
|
sybperl-l Archive
Up Prev Next
From: "Shanbhag, Mitesh (London)" <ShanbMit at exchange dot uk dot ml dot com>
Subject: RE: BCP to SQL 2000
Date: Sep 24 2002 4:21PM
thanx Mark
But is your script under UNIX or NT ? I read in the MSSQL::DBlib FAQ that
its not supported under UNIX.
Rgds,
Mitesh
-----Original Message-----
From: Mark Sutfin [mailto:MSutfin@affinitygroup.com]
Sent: Tuesday, September 24, 2002 5:11 PM
To: SybPerl Discussion List
Subject: RE: BCP to SQL 2000
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
|