You are not logged in or registered. Please login or register to use the full functionality of this Website SybaseTeam.Com...
Hello There, Guest! (LoginRegister) Remember Me? Current time: 10-22-2014, 12:08 AM
   Home  |  About Us  |  Sybase Training  |  Synergy  |  Consulting  |  Job Openings  |  Tech Videos  |  Rules and Disclaimer  |  Search
Post Reply 
Forum Tools
control file for loading a fixed width file using BCP
11-02-2011, 09:44 PM
Post: #1
Quote this message in a reply
control file for loading a fixed width file using BCP


Hi,

Can any one let me know how I can write a control file for loading a fixed width file using BCP.



Best Regards,

linga


Find all posts by this user
11-03-2011, 04:08 AM
Post: #2
Quote this message in a reply
RE: control file for loading a fixed width file using BCP


What exactly do you mean by "control file" ? The shell script or bcp format file ?

bcp has a format file. Check the Sybase documentation; look at the Utility Guide; then bcp; then format file.

As long as the columns in the fixed width (or variable width) data file match the table, you do not need a bcp format file for loading it into a db using bcp. Such things as non-standard field separators, record terminators, etc are all handled via command line options. You only need a format file if the columns in the data file (in or out) are scrambled or the datatypes are not matched.

Even then, is it easier to start out with:
    bcp mytable out -F1 -L10 -f mytable.fmt
which will create a format file; then you can edit it to suit.

For a shell script we need more information, assuming you want to cut, chop, sort, etc. The command line to launch bcp is easy enough, so I do not think that is what you are seeking.



Ashirvad to my Shishyas, Cheers to the others
Derek Asirvadem
Information Architect / Sr Sybase DBA
Website
Selection of Useful Documents for the Sybase DBA
Visit this user's website Find all posts by this user
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Sybase interfaces File dbgirl 1 2,092 09-27-2012 10:48 PM
Last Post: DerekAsirvadem
  Write to file karthizen 1 2,106 04-13-2012 06:43 AM
Last Post: DerekAsirvadem

Options:
Forum Jump:


Contact Us | SybaseTeam | Disclaimer & Rules | Return to Top | Return to Content | Lite (Archive) Mode | RSS Syndication