Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2005

    Unanswered: Question on the BCP Utility

    Hi All,

    I have a question regarding copying data between Oracle and Sybase databases. Basically, here is the scenario that I have:

    Oracle : Table has Field1, Field2 and Field3

    Sybase : Table1 has Field1
    Table2 has Field2
    Table3 has Field3

    I need to be able to copy the 3 fields: Field1, Field2 and Field3 from the Sybase tables to the Oracle table.

    Oracle DB and Sybase DB are running on two different servers in
    different GEOs.

    If I can get the data in a flat file from Sybase in a comma delimited form, I can load it into the Oracle table using the Oracle SQL*Loader utility.

    Here is my question: I read about a utility called BCP in Sybase. Is it possible to get the comma delimited file as required by me from all the 3 tables. If somebody can provide me with an example or explain how to do this, I would greatly appreciate it.

    Basically I am not too familiar with Sybase. Apologies if this is too simple a question for this forum.


  2. #2
    Join Date
    Jan 2005
    hi,you can not bcp three tables in one single command.
    I suggest you bcp them out seperately and paste them together with comma.

  3. #3
    Join Date
    Jan 2004
    Provided Answers: 4
    You can create a view on the three Sybase tables:
    create view vs_sybase as
       select Field1, Field2, Field3
       from Table1, Table2, Table3
       where <insert correct joining conditions>
    Then, bcp-out the data of the view, and import that data ni the Oracle-table.

    Good luck!
    I'm not crazy, I'm an aeroplane!

  4. #4
    Join Date
    Jan 2005
    Thanks very much, Martijnvs amd Mor, for your suggestions. Hope you don't mind me asking one more, me being a newbie to Sybase. Would I be able to create the commas in my flat file once I do the bcp? (Ex. a,b,c)

  5. #5
    Join Date
    Jan 2005
    Use the -t option on the bcp utility.


    bcp mydb..vs_sybase out filename -t, -c -U user -P password

  6. #6
    Join Date
    Jan 2005
    That does it, PhantomDBA! Thanks very much. You guys are all so very helpful. Thank you.

  7. #7
    Join Date
    Aug 2004

    , vs tabs

    you can use the default sperator (tab) for bcp... in sqlldr control file just mention the sepetor as tab..

Posting Permissions

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