Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
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,514 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 27

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 27

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying 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

A walk-through example of how to obtain and apply new DID phone numbers to your cloud PBX enabled users that are configured in Office 365. Whether you have 1, 10 or 100+ users in your tenant, it's quite easy to get them phone-enabled and making/rece…
With so many activities to perform, Exchange administrators are always busy in organizations. If everything, including Exchange Servers, Outlook clients, and Office 365 accounts work without any issues, they can sit and relax. But unfortunately, it…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

636 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