Results 1 to 8 of 8
  1. #1
    Join Date
    May 2003
    Location
    UK
    Posts
    22

    Lightbulb Unanswered: bcp from solaris to windows

    All,

    I am having problems bcp'ing from Solaris 8 to windows both running the same version of Sybase. The problem is to do with the formatting of the text files.

    I know this because if I open the flat file in wordpad and then do a 'save as' it reformats the original file and then the new file bcp's in fine.

    This is all well and good for smaller bcp files, but I want to do some BIG bcp's which just won't open up in wordpad.

    Anyone have a workaround / solution for this.

    Many thanks in advance.....

  2. #2
    Join Date
    Feb 2002
    Location
    Willy is on vacation
    Posts
    1,208

    Re: bcp from solaris to windows

    On the UNIX server when you bcp out use the -F(first row) and -L(last row) to limit the output file size and of course use the -c(Character) because of cross platform.

    So you bcp out 1-00, then 101-200 and so forth.

  3. #3
    Join Date
    May 2003
    Location
    UK
    Posts
    22
    Thanks for the help but I want a way to do large bcp's.

    I should have mentioned that without resaving my text files in a windows o/s text editor I get the 'unexpected EOF encountered in bcp' message (or something similar).

    I do bcp with the -c flag, but I want to know if there is a way to 'pre-process' my large bcp files for them to be accepted into the windows install of Sybase.

    Cheers...

  4. #4
    Join Date
    Nov 2002
    Location
    Switzerland
    Posts
    524
    What's your character set on Winnt ? iso_1 or cp850 ?
    check using sp_helpsort
    Then try your bcp with -c -Jiso_1 (or cp850) option

  5. #5
    Join Date
    Sep 2002
    Location
    Hong Kong
    Posts
    159

    Re: bcp from solaris to windows

    Have you considered running unix2dos against your bcp output files?

  6. #6
    Join Date
    May 2003
    Location
    UK
    Posts
    22

    Thumbs up

    It looks like the character sets are different on the two machines (Unix = iso windows = cp850) - so I will try the bcp with the -J option

    I have not tested this yet but will let you know if it works. If not I will try unix2dos, I was not aware of its existence but it looks like this is the type of utility I had in mind..

    Thanks for all the help...

  7. #7
    Join Date
    Nov 2002
    Location
    Switzerland
    Posts
    524

    Exclamation

    Originally posted by syb_fkup
    It looks like the character sets are different on the two machines (Unix = iso windows = cp850) - so I will try the bcp with the -J option

    I have not tested this yet but will let you know if it works. If not I will try unix2dos, I was not aware of its existence but it looks like this is the type of utility I had in mind..

    Thanks for all the help...
    dos2unix or unix2dos won't convert charactersets !

  8. #8
    Join Date
    May 2003
    Location
    UK
    Posts
    22
    Well the results are in and heres what worked.... unix2dos

    I did as follows

    #In Unix

    bcp table out table -Usa -P -c #unix did not now cp850 characterset so no need for a -J

    #then

    unix2dos table > table2

    #and once I had it on my windows o/s

    bcp table in table -Usa -P -c

    This also worked without the -J option. I also tried with -J cp850 and -J iso_1 and they both went in fine also, having said that I did not check what the data itself looked like, very puzzling....

    But anyway theres the solution if you ever have the need - process your bcp files through unix2dos !!!

    Thanks for all the suggestions and help with this.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •