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: "Sardar, Amit" <amit dot sardar at gs dot com>
Subject: Need help with bcp
Date: Jul 8 2000 1:24AM

I am trying to bulkinsert into a sybase # table from an perl array  and am
getting this  error message 
Can you please help ?

**********************************************************************

Msg 4837, Level 16, State 3
Server 'NYCSTRDQ01', Line 1
        Bad row data received from the client while bulk copying into object
1648879984 in database 2. Received a row of length 29541 while maximum
possible row length is 12.
DB-Library error:
        General SQL Server error: Check messages from the SQL Server.

*******************************************************************
#!/opt/local/bin/perl5
 
use Sybase::DBlib;
use Sybase::BCP;
use Getopt::Std;
getopts('s:u:p:d:f:');
 
$user=$opt_u;
$password=$opt_p;
$server=$opt_s;
$database=$opt_d;
 
 
 
&BCP_SETL ( TRUE   ) ; 
                                        $dbp =  new
Sybase::DBlib($user,$password,$server);
                                        $ret =  $dbp->dbuse($database) ;
                                $sql = "create table #trade_ext_ref_wil
(ext_trade_ref_wil  char(10) ) ";
 
 
 
                                $ret = $dbp->dbcmd($sql);
                                $ret = $dbp->dbsqlexec;
                                $ret = $dbp->dbresults;
 
 
                                while (@dat =  $dbp->dbnextrow)
                                {
                                ;
                                }
 
$status = $dbp->bcp_init("#trade_ext_ref_wil" , '', '', DB_IN )   ;
 
$status = $dbp->bcp_meminit(1)  ;
 
$a[0]  = "0000" ;
 
$status= $dbp->bcp_sendrow ( @a )   ;
   
 
$sql = "select * from #trade_ext_ref_wil   ";
 
 
 
 
                                $ret = $dbp->dbcmd($sql);
                                $ret = $dbp->dbsqlexec;
                                $ret = $dbp->dbresults;
 
 
                                while (@dat =  $dbp->dbnextrow)
                                {
                                print $dat[0] ;
                                }

****************************************************************************
**********





Amit Sardar
212 855 9690