bcp error


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting bcp error
# 1  
Old 09-13-2010
bcp error

hi all,

Getting error while working on sybase::bcp as below,

DB-Library error:
Attempt to convert data stopped by syntax error in source field.

Code is like,
Code:
my $bcp_files = new Sybase::BCP $usr, $pass, $server;



---------- Post updated at 02:05 AM ---------- Previous update was at 01:24 AM ----------

hey, got the solution but cant understood....

My data is,
Code:
 col1|col1|status|2010/09/13 01:38:02|IST

now last 2 columns are swapping their position while doing bcp... any clues ?
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bcp command error in uploading data to Sybase

Hi All, I had an issue in executing bcp command to connect to Sybase from Unix script for uploading the data from file to table. I have a file called vrs_temp.txt (with two columns): 22055;20181001 21088;20181001 93840;20181001 30990;20181001 50990;20181001 50950;20181001Created a... (4 Replies)
Discussion started by: Suresh
4 Replies

2. UNIX for Dummies Questions & Answers

BCP with cat not working

Hello, I am facing a typical problem in my code . If I run bcp alone it is working fine if I run BCP with cat it is not working . Not able to find where the error is occurring in cat . Can you please help bcp ${_DBName}..logfile in ${_currdate} -f$PANEL_HOME/format/logfile.fmt -Q -U$_UserId... (11 Replies)
Discussion started by: arunkumar_mca
11 Replies

3. Shell Programming and Scripting

Execute bcp commands from SQSH

Hi I am using SQSH to construct 10-20 bcp commands that I would like to execute. I can write all to file and open and do a for loop in the file. My question is if there is some way I can skip the file part and somehow pipe out the resulting dataset from SQSH and execute those directly? My... (1 Reply)
Discussion started by: bicm_mike
1 Replies

4. Shell Programming and Scripting

bcp command help

Hi, When i execute a script in unix, the result i got is :: ./purgeErrors.ksh: bcp: not found What is the meaning of that output ? --- Aditya (9 Replies)
Discussion started by: chaditya
9 Replies

5. Shell Programming and Scripting

sybase::bcp

I am trying to bcp in using sybase::bcp perl module. I can find we can give user, pwd and server name in the parameters. How can I give database and table name? (1 Reply)
Discussion started by: Deei
1 Replies

6. Shell Programming and Scripting

BCP command or module

Hi All, I am trying to bcp in data file into database. now there is bcp command available in unix and another perl module Sybase::BCP is also available. Can anyone please let me know if there is any limitations of bcp command in unix. whichever is good to use? (1 Reply)
Discussion started by: Deei
1 Replies

7. UNIX and Linux Applications

Sybase help: Open client, bcp function

To begin: I use Linux The Problem: I need bcp functionality for scripts. Perl modules, such as Sybase:xfer, require ctlib which comes with Sybase Open Client. Talking with Sybase sales reps is an exercise in futility and hate. They know absolutely nothing about their own products and will... (0 Replies)
Discussion started by: Bubnoff
0 Replies

8. UNIX for Advanced & Expert Users

to create format file for bcp in

I want to create the format file for bcp in a file to the table. My Versions are: Unix: Sun OS, DB: Sybase. How can i create the format file. Is there any way to create the format by bcp command or some system sp. Please help. (3 Replies)
Discussion started by: Arunprasad
3 Replies

9. UNIX for Advanced & Expert Users

bcp core dump on Solaris 5.7

I am importing data into a new database using bcp (ASE 11.0) on Solaris 5.7. I keep getting a core dump error when my ksh script attempts to load one table. All other tables load fine. If I load the table directly from the command line without a script the table loads fine. Does anybody know... (1 Reply)
Discussion started by: gerald_agoi
1 Replies
Login or Register to Ask a Question
freebcp(1)							 FreeTDS Utilities							freebcp(1)

NAME
freebcp - bulk loading utility for Sybase and Microsoft databases SYNOPSIS
freebcp [[database.]owner.]object_name {in | [query]out} datafile { -c | -n | -f formatfile } [-b batchsize] [-F firstrow] [-L lastrow] [-e errfile] [-I interfaces] [-m maxerrors] [-t field_term] [-r row_term] [-h hints] [-T textsize] [-A packet_size] [-O options] [-S servername] [-U username] [-P password] [-EdVv] DESCRIPTION
freebcp is a utility program distributed with FreeTDS. freebcp replicates (in part at least) the functionality of the "bcp" utility pro- grams distributed by Sybase and Microsoft. freebcp makes use of the db-lib bcp API provided by FreeTDS. This API is also available to application developers. The manual pages or online help for Sybase or SQL Server can be referenced for more detailed information on "bcp" functionality. TABLES AND FILES
database The database of the object being copied. Optional if the table/view is in the default database for username. owner The owner of the object being copied. Optional if username or the database owner is the owner of the table. object_name Usually, object_name is the name of the database table you wish to access. It can also be a view (and, subject to constraints, it is sometimes possible to load a view). It can also be an SQL query, cf. queryout, below. in | [query]out The direction of the bulk copy operation. 'in' indicates data are to be copied from a host file into a database table; 'out' indi- cates data are to be copied from a database table to a host file. 'queryout' indicates that table_name is in fact a query, rather than a database object. freebcp will execute the query and write the results to a file. (It is a good idea to have the query return one and only one result set.) datafile The name of an operating system file. OPTIONS
-c The host data file is (or will be) in "character" format, i.e., a text file. Encoding is determined by the client charset attribute in freetds.conf. -n The host data file is in "native" format. This is a format that freebcp will be able to process, but is not portable or readable. -f formatfile The format of the host data file is described by formatfile. The layout of formatfile is identical to that understood by the Sybase and Microsoft bcp utilities, but is too complicated to describe here. -b batchsize The number of rows per batch of data copied. Batching applies only when you are bulk copying into the database. Each batch of data is effectively 'committed' into the database. The default value for batchsize is 1000. -F firstrow The first row to copy from the input file or database table. The default is the first row, row 1. -L lastrow The last row to copy from an input file or database table. The default is the last row. -r row_term The row terminator for a character file. May be more than one character. Default is newline (' '). Cf. -c, above. -t field_term The field terminator for character file. Also known as a column delimiter. May be more than one character. Default is tab (' '). Cf. -c, above. -m maxerrors Stop after encountering maxerror errors. Default 10. -e errfile Write errors to error_file. For uploads. Includes line and column information, and the row data. -S servername The name of the Database Server to which to connect. -U username A database login name. If username is not provided, a domain login is attempted for TDS 7+ connections. -P password A database password. -E Write the data in datafile to the table's IDENTITY column. Without this flag, the identity data present in the datafile will be ignored, and new IDENTITY values will be generated for the imported rows. -d Turn off any logging. (Unintuitive, perhaps.) -O options SQL text to set connection options prior to the bcp operation. If options is a valid filename, the SQL is read from the file instead. Sometimes needed for queryout. Example: "-O 'SET QUOTED_IDENTIFIER ON'" -I interfaces The name and location of the interfaces file to search when connecting to servername. Overrides freetds.conf. -h hints Set bcp hints. For valid values, cf. bcp_options() in the FreeTDS Reference Manual. -T textsize For text or image columns, set the maximum number of characters to request from the server. Defaults to the setting in freetds.conf. If not specified anywhere, defaults to the full size of the data. -A packet_size Set the size of a TDS packet to packet_size. Not sure why you would want to do this, except as an experiment. -v -V Print the version information and exit. ENVIRONMENT
DSQUERY default servername NOTES
When connecting to a Sybase database server, it is required that the TDS 5.0 protocol be used. When connecting to a Microsoft SQL Server 2000 database server, the TDS 7.1 protocol is required. Theoretically both Sybase and Microsoft support the TDS 4.2 protocol, but in reality they implement the bcp portion of TDS 4.2 differently. FreeTDS has no way of knowing which type of server it's connected to, hence TDS protocol 4.2 is not supported. HISTORY
freebcp first appeared in FreeTDS 0.60 AUTHORS
The freebcp utility was written by Bill Thompson (thompbil@exchange.uk.ml.com) BUGS
Currently, there is no support for text data types in freebcp, when SQL Server 2000 is the target database. doc 13 November 2011 freebcp(1)