본문 바로가기

컴퓨터/파워빌더

파워빌더 - 파이프라인 사용하기


파이프라인을 사용하면 서로다른,혹은 같은 데이터베이스간의 자료를 아주쉽게 주거니 받거니 할수있습니다.
메뉴의 파이프라인 메뉴를 통해 직접 사용이 가능하며, 또한 프로그램내에서 스크립트로도
사용이 가능합니다.
이미 파이프라인을 만들어 놓은 후 그것을 DataObject로 불러들여 사용하는 예제입니다...

int li_ret
pipeline li_pipline  //파이프라인 오브젝트 생성
li_pipline = CREATE pipeline
//메뉴에서 미리 만들어 놓은 파이프라인 pipe_name
li_pipline.DataObject = pipe_name
// SQLSOURCE는 Source쪽의 Transaction ,트랜젝션 별도 생성
// SQLCA는 Destination쪽의 Transaction
// dw_1 는 파이프라인 에러메시지 처리용

li_ret = li_upipe.Start(SQLSOURCE, SQLCA, dw_1)
... li_ret - 에러사항 처리)
DESTROY  i_upipe

// 리턴값 value
/*
 -1   Pipe open failed
 -2   Too many columns
 -3   Table already exists
 -4   Table does not exist
 -5   Missing connection
 -6   Wrong arguments
 -7   Column mismatch
 -8   Fatal SQL error in source
 -9   Fatal SQL error in destination
-10  Maximum number of errors exceeded
-12  Bad table syntax
-13  Key required but not supplied
-15  Pipe already in progress
-16  Error in source database
-17  Error in destination database
-18  Destination database is read-only
If any argument's value is null, Start returns null */