Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2004
    Posts
    5

    Question Unanswered: Help needed with bcp

    I need to export a fixed number of fields from different(multiple) Sybase tables and write it as a formatted string to an ASCII file.

    Can i use bcp for this??

    Will it represent NULL correctly??

    I'm thinking bcp so that dataserver wont be loaded while i do my processing.

    Do i need to bcp out each table individually or is there a way i can combine fields from all the tables and bcp out to a single file???

    Do i need to write a separate 'c' program to parse through the bcp output and create a string or is there an easier way to do it.

    For example,

    there are two fields : Name(from table 'customer') & Phone number(from table 'custinfo')

    But my text file needs to have it in the format

    "Subscriber:name=<>&phonenumber:<>;"

    Please suggest a way to do this.

  2. #2
    Join Date
    Nov 2003
    Posts
    10

    Bcp

    You need to BCP out individual tables and then you have to load them indvidually. The best way to do this is to create a join between two related tables and insert the data. OR Instead of using create table and then populating data, use select into <tablename>.

    HTH.

  3. #3
    Join Date
    Jul 2004
    Posts
    15
    You can create a view from the required select stmt and bcp out from the view

    Ratheesh

  4. #4
    Join Date
    Jul 2004
    Posts
    5

    \202^B and \202^B^D

    In the bcp output file , the NULL values are not getting displayed.
    Is there a way i can make it have NULL values also for my parsing program to recognise.

    I also see a lot of "\202^B" and "\202^B^D"

    why do these values occur?

    I saw them after a lot of blank spaces where NULL should have been.

    Please help!!

  5. #5
    Join Date
    Jul 2004
    Posts
    5

    not displayed values

    The above "\202^B" values are some values stored in fields not displayed by 'isql'

    I also found that bcp supports the option "-t" to get a delimiter between fields.

    This will be helpful for the parser program to recognise the NULL's.

    Thanks a lot for the help guys!!

Posting Permissions

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