前言:

因為專案需求,必須將Oracle資料庫中某個資料表放入MS SQL Server,更進一步
的使用SQL語法或預存程序進行資料媒合與轉置動作,提供我們系統使用。


我們處理的流程很直覺:
MS SQL Server能直接將Excel檔案直接產生並匯入資料表,故我們需要將Oracle
資料表匯出成為Excel(xls or csv)檔案,甚至是其他格式的檔案,方便我們匯入MS 
SQL Server。

在網路上查詢,發現Sql Developer能直接將資料表查詢結果,轉匯出成為檔案,因
此記錄整個操作流程。



執行步驟:

Step 1. 開啟 Oracle SQL Developer
            Open Oracle SQL Developer



Step 2. 選擇資料庫並進行登入
            Login to Oracle Database



Step 3. 撰寫條件 (依據條件,產生你要產生的檔案格式)
            Enter Query Statement
            (In accordance with the conditions, resulting export file format you want)



Step 4. 右鍵點選查詢結果,選擇匯出..
            Right-click the query result , and select export



Step 5. 匯出格式設定
            Export format settings



Step 6. 可以擇許多格式。這個範例中,我們選擇insert
            There are many export file type. This example, we select insert.


Step 7. 選擇編碼
            Select Encode


Step 8. 輸入匯出檔案名稱與路徑,點選下一步
            Enter export path and export file name, click next


Step 9. 點選完成
            Click finish



Step 10. 如果檔案太大,匯出檔案不會自動開啟 (檔案類型為insert)
              If the file is too large, file does not automatically open (only for insert sql)



Step 11. 我們使用notepad++開啟,指令產生成功。
              Open export file with notepad++,  success.



P.S. : 如果您選擇格式text,則可以選擇左括號與右括號類型。
         If you select text format, you can select the type of left parenthesis and right parenthesis


參考資料:



--
謝謝!