Solved

Generating a Format File in Sybase ASE BCP

Posted on 2013-10-22
1
1,197 Views
Last Modified: 2013-10-23
I cannot figure out for the life of my how to generate a format file in a batch file in sybase. I use the following to create my bcp of data file:

bcp mytester.dbo.XTABLE out XTABLE.bcp -U sa -P mypass -T -n

I would think I could do like in sql server:

bcp mytester.dbo.XTABLE format XTABLE.bcp -U sa -P mypass -T -n
or
bcp mytester.dbo.XTABLE out XTABLE.bcp -U sa -P mypass -T -n  -f XTABLE.fmt

but it doesnt seem to work. it seems the only way to do it is in the mode when it prompts me for all details, which is unacceptable for waht I want to do (many tables in a BAT file).

Anyone know how to pull this off?
0
Comment
Question by:Jay Redd
1 Comment
 
LVL 24

Accepted Solution

by:
Joe Woodhouse earned 500 total points
ID: 39593423
That is how it works, sadly. If you want bcp to generate a format file for you, it does so interactively.

However the format file has a well documented structure and there's nothing stopping you from writing your own, programatically, in a batch file or script.

See the Utility Guide for ASE of your version, available for free from the Sybase site.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

Suggested Solutions

Title # Comments Views Activity
Sybase IQ developer edition and replication server developer edition 14 662
dbisql 5 637
Executing multiple sybase statements in perl dbi 2 94
SQL Query Syntax 12 91
Learn how to PXE Boot both BIOS & UEFI machines with DHCP Policies and Custom Vendor Classes
Many businesses neglect disaster recovery and treat it as an after-thought. I can tell you first hand that data will be lost, hard drives die, servers will be hacked, and careless (or malicious) employees can ruin your data.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

789 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