1、創建一個Data Pipeline
![]() |
| 選擇[Database][Data Pipeline] |
![]() |
| 選擇來源、目的資料庫、資料列 |
完成這裡已經可以點選[Design]-[Execute]直接傳輸、測試。
2、建立Pipeline Object
![]() |
| 選擇 Standard Class |
![]() |
| 選擇 pipeline |
為了在執行的時候可以在window 讀取到目前傳輸的進度,
所以可以在 pipeline object 內加入這些。
在 Instance Variables 內宣告
在 even pipemeter() 中加入以下內容
3、建立一個 window 來執行
![]() |
| 宣告 剛剛建立的pipeline object 與 目的端使用的連線 |
建立三個 statictext、一個 datawindow。
![]() |
| 建立可視物件 |
接下來設定好 SQLCA、SQLCA2 的連線,
create u_pipe 再將三個訊息指向 st_123 就準備完成。
ip_pipe = create u_pipe
ip_pipe.ist_read = st_1
ip_pipe.ist_written = st_2
ip_pipe.ist_errors = st_3
執行時指定 ip_pipe.dataobject ,
再執行 ip_pipe.start(SQLCA, SQLCA2, dw_error) 就會開始傳輸,
如果有發生錯誤也會直接顯示在 dw_error 上面。
dw_error.reset()
ip_pipe.dataobject = "p_table1"
ll_rtn = ip_pipe.start(SQLCA, SQLCA2, dw_error)









pipeline.start 後若有錯詳細失敗原因會顯示在dw_error內error_message欄位內(PB-pipeline painter內操操作觀察所得)。
回覆刪除請問閣下是否有試過以Powerscript執行pipeline Object時,如何轉出在dw_error內的detail error message呢?
其實我不太懂您的問題在哪裡
刪除已經存到dw_error這個datawindow內
要轉出來?不就是直接看你想怎麼儲存這個資料的問題而已嗎?
在下,試過pipeline object 執行多次資料庫間抄寫,若以dataWindow control 作為pipeline dberor outputOK,但若改以
回覆刪除DataStore control時NG,pipeline.start(),return code仍可正確取得,但如欲取得detail error message時是出現DataStore control null reference runtime錯誤(但在PB Help中syntax 是允許的,即使用DataWindow control或DataStore Control皆可作為pipeline error output interface)。
我的問題是這個null reference造成困擾(當使用dataStoreControl時),不知閣下是否測過、遇過,若有又是如何破解的(誠心討教)?
(ps)my edition of PB is 10.0 build5032.