Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

How to specify null delimited in format file

 
   Database Forums (Home) -> Sybase RSS
Next:  Worker processes getting stuck on 'sync sleep' st..  
Author Message
Subind

External


Since: Dec 06, 2006
Posts: 9



(Msg. 1) Posted: Mon Dec 18, 2006 10:08 pm
Post subject: How to specify null delimited in format file
Archived from groups: comp>databases>sybase (more info?)

Hello,
Can anyone help me on this issue. I have a file which is of
fixed-length. so its delimiter would be a null string (""). I want of
bcp this file using a format file. Does anyone know how to specify null
string as delimiter in format file.
Currently the format file looks like this. but it doesn't work although
it does the bcping work but the data inserted is not proper.

10.0
39
1 SYBCHAR 0 2 "" 1 month
2 SYBCHAR 0 39 "" 2 advisor
3 SYBCHAR 0 5 "" 3 identity
4 SYBCHAR 0 8 "" 4 symbol


Please help.....

Regards,
Subind.

 >> Stay informed about: How to specify null delimited in format file 
Back to top
Login to vote
SybaseNeal

External


Since: Apr 15, 2005
Posts: 26



(Msg. 2) Posted: Tue Dec 19, 2006 8:32 am
Post subject: Re: How to specify null delimited in format file [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hello,

You can specify that NULL be the field terminator with "\0:

http://manuals.sybase.com/onlinebooks/group-as/asg1251e/utility/@Gener..._BookTe

For example:

% cat bcp.fmt
10.0
9
1 SYBCHAR 0 11 "\0" 1 au_id
2 SYBCHAR 0 40 "\0" 2 au_lname
3 SYBCHAR 0 20 "\0" 3 au_fname
4 SYBCHAR 0 12 "\0" 4 phone
5 SYBCHAR 1 40 "\0" 5 address
6 SYBCHAR 1 20 "\0" 6 city
7 SYBCHAR 1 2 "\0" 7 state
8 SYBCHAR 1 12 "\0" 8 country
9 SYBCHAR 1 10 "\0" 9 postalcode

 >> Stay informed about: How to specify null delimited in format file 
Back to top
Login to vote
Subind

External


Since: Dec 06, 2006
Posts: 9



(Msg. 3) Posted: Wed Dec 20, 2006 8:59 pm
Post subject: Re: How to specify null delimited in format file [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hey gr8 men, this is a good link that you provided.Helped me to resolve
my problem.
Thanks for the help.....

-Subind.

SybaseNeal wrote:
> Hello,
>
> You can specify that NULL be the field terminator with "\0:
>
> http://manuals.sybase.com/onlinebooks/group-as/asg1251e/utility/@Gener..._BookTe
>
> For example:
>
> % cat bcp.fmt
> 10.0
> 9
> 1 SYBCHAR 0 11 "\0" 1 au_id
> 2 SYBCHAR 0 40 "\0" 2 au_lname
> 3 SYBCHAR 0 20 "\0" 3 au_fname
> 4 SYBCHAR 0 12 "\0" 4 phone
> 5 SYBCHAR 1 40 "\0" 5 address
> 6 SYBCHAR 1 20 "\0" 6 city
> 7 SYBCHAR 1 2 "\0" 7 state
> 8 SYBCHAR 1 12 "\0" 8 country
> 9 SYBCHAR 1 10 "\0" 9 postalcode
 >> Stay informed about: How to specify null delimited in format file 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
NULL = 2? - Say I have a tables that has two columns - column a and column b. Both support NULL values I'd like to find all the rows where a <> a. Unfortunately, NULL values seem to be confounding this. If I do... INSERT table (a,b) VALUES (NULL,2); ....d...

select @@servername returns NULL - Hello I have a question - when i do a select @@servername as SA returns NULL how can i see to which server I'm logged into? isql -Usa -Pabc1234 and if i dont do the -S how can i check other then a select * from sysservers? which i can have many ..

Why is master..sysprocesses.hostname is NULL for my progra.. - I am running into the following situation... Machine 1 Solaris 10/using mutiple Zones Sybase ASE 15 Machine 2 Solaris 8 Sybase ASE 12.5 I have a program that makes a connection to a Sybase ASE database and then makes an entry into a table selecting..

what is the output format of a backup - Hi, When we do a backup of a data base ASA what is the output format (txt, ASCII...)? Tkanks for your help.

Directing ISQL output to compressed format - Hello! I have an ISQL query that generates a rather huge CSV output. May someone please suggest how I can generate a compressed output file (GZ) directly with ISQL? What's the trick? It's a bit of a problem if I plain first create the CSV and then GZ...
   Database Forums (Home) -> Sybase All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]