Oracle extract to SQL Server 6.5

From: Paul Delahunty <pdelahunty_at_hotmail.com>
Date: Tue, 23 Mar 1999 13:32:45 -0000
Message-ID: <7d856r$plh_at_news.dns.microsoft.com>



Hi All,

I am trying to extract an Oracle table in a format that will allow me to BCP the generated flat file into an identical SQL Server 6.5 table. There are character, date and number columns in the Oracle table and these should go inot Char, Datetime and int columns on SQL Server side.

I am currently extracting out the date and int columsn in this format

SELECT    RPAD(NVL(substr(ManucpCode,1,10),' '),10) ||
	  RPAD(NVL(substr(MacPacCPCode,1,10),' '),10) ||
          RPAD(NVL(substr(MSSalesCPCode,1,10),' '),10) ||
          RPAD(NVL(substr(CMGCPCode,1,10),' '),10) ||
          RPAD(NVL(substr(Region,1,10),' '),10) ||
          RPAD(NVL(substr(DRPFlag,1,1),' '),1)  ||
          RPAD(NVL(substr(Descr,1,50),' '),50)  ||
          RPAD(NVL(substr(CPEmail,1,60),' '),60) ||
          RPAD(NVL(substr(TO_Char(DateLastModified,'Mon DD YYYY
MM:SSPM'),1,26),' '),26) ||
          RPAD(NVL(substr(CPEmail_cc,1,250),' '),250) ||
          RPAD(TO_Char(CPLeadtime),12)
FROM      CPReference$;

but I am getting errors in the BCP. CHaracters are fine but int and dates are giving me problems. I am trying to export the date as charactrer but this too is causing problems. Is there prefixes, hidden characters etc. that I have to account for ? Is there any way of doing this,

Regards

Paul Received on Tue Mar 23 1999 - 14:32:45 CET

Original text of this message