Sponsored Content
Top Forums Shell Programming and Scripting Bcp command error in uploading data to Sybase Post 303024233 by Suresh on Thursday 4th of October 2018 08:55:40 AM
Old 10-04-2018
Thank you. Actually the problem is with the file format at end of each line. So, I have added a semicolon delimiter and tried accessing the bcp command to load the data into Sybase.

Code:
awk -v d=`date +%Y%d%d";"` -FS="," -vOFS=";" '{$2=d; print $1,$2}' temp.txt > new_file.txt

22055;20181004;
21088;20181004;
93840;20181004;
30990;20181004;
50990;20181004;
50950;20181004;

bcp db..table_name in new_file.txt -U$Login -PPASSWD -S$DBName -c -t";"

Copied 11 rows to database

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Data transfer from DB2 to Sybase using Perl?

Hi, Good Morning everybody. I need to write a perl script which will get some data from DB2 table and then put it into Sybase table. I have the experience in Oracle and Unix but new to these perl, DB2 and Sybase technologies. Appreciate if any one can suggest with a sample code. Thanks... (1 Reply)
Discussion started by: rajus19
1 Replies

2. UNIX for Advanced & Expert Users

Need a script for uploading data from unix box to mysql databse

how to upload system information(unix box) to MySql database's(running in another unix box) respective tables using a script only..i.e once script runs all the informations like hostid,hostna,disks,cpu etc get stored to respective tables of MySql database.... (2 Replies)
Discussion started by: shubhendu.pyne
2 Replies

3. Shell Programming and Scripting

get the data from sybase and append to the file

How to get the data from the sybase database and append the data obtained into the file. For example, I will get the filename 'temp' from the database. This filename is associated with the number 1.6... This number 1.6 needs to be copied into the file that matches the filename in the... (1 Reply)
Discussion started by: vinay123
1 Replies

4. Shell Programming and Scripting

fetching data from sybase using perl

How can I fetch and retreive data(of each result set) of multiple result set from sybase by calling a stored procedure using perl DBI module on an unix solaris environment????? Please help (3 Replies)
Discussion started by: wadhwa.pooja
3 Replies

5. 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

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. 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

8. 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

9. Shell Programming and Scripting

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, my $bcp_files = new Sybase::BCP $usr, $pass, $server; ---------- Post updated at 02:05 AM ---------- Previous update... (0 Replies)
Discussion started by: Deei
0 Replies
Apache::Session::Serialize::Sybase(3pm) 		User Contributed Perl Documentation		   Apache::Session::Serialize::Sybase(3pm)

NAME
Apache::Session::Serialize::Sybase - Use Storable to zip up persistent data and unpack/pack to put into Sybase-compatible image field SYNOPSIS
use Apache::Session::Serialize::Sybase; $zipped = Apache::Session::Serialize::Sybase::serialize($ref); $ref = Apache::Session::Serialize::Sybase::unserialize($zipped); DESCRIPTION
This module fulfills the serialization interface of Apache::Session by taking the data from Apache::Session::Serialize::Storable and modifying it to work with Sybase IMAGE fields. Note that you do not need to quote these values before inserting into the database, and that if you are using DBI::Sybase, you cannot use the data in a placeholder. If you use Apache::Session::Sybase as your session class, this will all get taken care of. AUTHOR
Apache::Session::Serialize::Storable was written by Jeffrey William Baker <jwbaker@acm.org>; the Sybase-specific data manipulation was written by Mark Landry <mdlandry@lincoln.midcoast.com> for use in an earlier version of Apache::Session::DBI::Sybase and placed here by Chris Winters <chris@cwinters.com>. SEE ALSO
Apache::Session::Serialize::Storable, Apache::Session::Sybase perl v5.10.1 2010-10-18 Apache::Session::Serialize::Sybase(3pm)
All times are GMT -4. The time now is 01:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy