Solved

sybase bcp out command - would like to have where statement to limit bulk out data

Posted on 2014-03-18
5
1,341 Views
Last Modified: 2014-05-18
hello
I would like to bulk out data from sybase one table but with having where statement. i.e. date column >= '2014/1/1'. would somebody kindly help to advice how this is possible...?

thanks in advance!
sleepingluke
0
Comment
Question by:sleepingluke
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 26

Expert Comment

by:wilcoxon
ID: 39938626
This is not possible using bcp.  The simplest way I know to do this is to install sqsh (http://sourceforge.net/projects/sqsh/ - it used to be sqsh.org but that appears to be gone) and do a query like "select * from table where date >= '2014/1/1'; -mbcp".
0
 
LVL 1

Expert Comment

by:troublesaga
ID: 39938996
The other option that I know is to create a view and bcp out the view.
0
 
LVL 26

Accepted Solution

by:
wilcoxon earned 500 total points
ID: 39939688
The last option I can think of is to bcp out the full table and then use an awk/perl script to essentially grep the rows you want (only works for char-format bcp and not binary format).  However,  I think both my suggestion for sqsh and troublesaga's view suggestion are better options (if you can do them).

sqsh is incredibly useful.  I use it all the time and dread whenever I'm on a system where I'm stuck with isql.
0
 
LVL 13

Expert Comment

by:alpmoon
ID: 39941497
I second  troublesaga's suggestion. I guess creating a view would be easiest. You will use view name instead of table name in bcp command.
0
 

Author Closing Comment

by:sleepingluke
ID: 40073777
thank you very much!!!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Looking for Sybase 12.5.4 EBF ESD#9.1 or 10 patch 5 806
Sybase sample database 13 738
SQL Left join on same table 4 331
remote logins for proxy table in sybase 5 68
The following article is comprised of the pearls we have garnered deploying virtualization solutions since Virtual Server 2005 and subsequent 2008 RTM+ Hyper-V in standalone and clustered environments.
By reading this blog, MSPs will gain insight into how to improve communications with their clients as well as establish a more profitable business.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question