BCP Problem using SYBASE 4.9.2

BCP Problem using SYBASE 4.9.2

Post by Diamond » Fri, 05 May 1995 04:00:00



I'm using ascii txt files created from FOXPRO as input into bcp with the
following cmd:

 bcp edb..pin in pin.txt -Usa -P<password> -e pin.err

I default for all prompts and terminate with \r\n at the end.  The msgs I
get include:

1000 rows sent to SQL Server
etc
Error converting client's char to SQL server char  (something like this)

Using VI, the txt file looks just fine.  Nothing out of order.  And
nothing is printed
the errors file.  Any ideas?  BTW the txt file end's with a control Z.

Another problem I have is with another file the get copied in successfully
but
the number of rows copied is more that doubled the # of records in the
input file.
I used bcp out and vi'ed the txt file and the records are misaligned and
have a
end of line indicator of control M.  Why is this happening and how do I
fix it? The
txt is being loaded into an empty table.  

Thanks for you assistance
Felicia

 
 
 

BCP Problem using SYBASE 4.9.2

Post by Paul Ch » Sat, 06 May 1995 04:00:00



>I'm using ascii txt files created from FOXPRO as input into bcp with the
>following cmd:

> bcp edb..pin in pin.txt -Usa -P<password> -e pin.err

>I default for all prompts and terminate with \r\n at the end.  The msgs I
>get include:

Try the "-c" option in the bcp command line.

  bcp edb..pin in pin.txt -Usa -P<password> -e pin.err -c

--
Paul Chen, Ph.D.
consulting at DEC
Disclaimer: My opinions only!

 
 
 

BCP Problem using SYBASE 4.9.2

Post by bry.. » Tue, 09 May 1995 04:00:00



> Path:

ngc!ngc.com!nntp-hub2.barrnet.net!news3.near.net!paperboy.wellfleet.com!news-fe
ed-1.peachnet.edu!gatech!howland.reston.ans.net!news-e1a.megaweb.com!newstf01.n
ews.aol.com!newsbf02.news.aol.com!not-for-mail


> Newsgroups: comp.databases.sybase
> Subject: BCP Problem using SYBASE 4.9.2
> Date: 4 May 1995 20:04:22 -0400
> Organization: America Online, Inc. (1-800-827-6364)
> Lines: 28



> NNTP-Posting-Host: newsbf02.mail.aol.com

> I'm using ascii txt files created from FOXPRO as input into bcp with the
> following cmd:

>  bcp edb..pin in pin.txt -Usa -P<password> -e pin.err

> I default for all prompts and terminate with \r\n at the end.  The msgs I
> get include:

> 1000 rows sent to SQL Server
> etc
> Error converting client's char to SQL server char  (something like this)

> Using VI, the txt file looks just fine.  Nothing out of order.  And
> nothing is printed
> the errors file.  Any ideas?  BTW the txt file end's with a control Z.

> Another problem I have is with another file the get copied in successfully
> but
> the number of rows copied is more that doubled the # of records in the
> input file.
> I used bcp out and vi'ed the txt file and the records are misaligned and
> have a
> end of line indicator of control M.  Why is this happening and how do I
> fix it? The
> txt is being loaded into an empty table.  

> Thanks for you assistance
> Felicia

First you need to add some more handles to the bcp line for good
measure. Add -S[servername] believe me it is very necessary!, you
don't want to bcp in to a different server by mistake. Next you need
to specify -c which means to bcp in char format. If you are using
a delimiter specified by you such as the ||, you need to use the
-t"||" handle.

Foxpro throws an end of line (^Z) into your file you need to take this
out by deleting it. Sybase doesn't like it.

The last and most important thing you need to do is make sure the
structure you are bcping in to is the same as the format file you
are feeding it with.

Good Luck,
Bryan

 
 
 

1. bcp using sybase ct_lib - datetime fields

Hi,

I've been having problems using bulk copy with Sybase CT_LIB when I
have a field of type DATETIME.
I have a C style string (char *) in my C program, that contains a
valid date string.  I need to know how to bind it to a sybase ct_lib
type.  
I do bcp into a table, without using a file (i.e. binding C vars
directly)

If I bind (blk_bind) using CS_CHAR_TYPE, i get a conversion error when
i send the row (blk_rowxfr).  when i bind using CS_DATETIME_TYPE, it
just doesnt work, (no error is shown)

- it works fine on tables that do not have datetime fields
- i used the same string with sybase db_lib, and it works fine too

(I think the problem may be with the way i fill the CS_DATAFMT struct)

============

Thanks in advance
amirn

2. HOLIDAY TABLE

3. Using a BCP file created by MSSQL to load into sybase table data

4. Longer to backup a log vs. db

5. Sybase using bcp with identity columns

6. California - CONTRACT - Oracle Manufacturing Consultant

7. Problem using Sybase Migration Wizard in Sybase Customer Resource Kit

8. Format Only Query

9. problems connecting to a ms sql server (using DBD-Sybase and sybase libs)

10. Problem when trying to bcp csv file with Double Quotes to sybase table

11. bcp/Importing table from Paradox for Windows into MSSQL 6.5 using bcp

12. Using BCP /n VS. BCP -f and column terminators

13. BCP Problems: Sybase 11.0.2 to MS SQL Server 7.0