?
Solved

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

Posted on 2014-03-18
5
Medium Priority
?
1,443 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 2000 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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

An introduction to the wonderful sport of Scam Baiting.  Learn how to help fight scammers by beating them at their own game. This great pass time helps the world, while providing an endless source of entertainment. Enjoy!
Active Directory can easily get cluttered with unused service, user and computer accounts. In this article, I will show you the way I like to implement ADCleanup..
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

777 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