Decompose PB data pipe syntax, add your own SQL, flexible use of data pipeline PBs with a very flexible import export function. But his own RETRIEVE can only join fixed parameters, so how can I flexibly join my SQL? As follows: PB9 SQL2K first establishes a U_PIPELINE object, adds a common START function, if you use PB's data pipelines, you are tired of your eyes. Straight into the subject: first analysis of the data pipeline p_catalog syntax: u_pipeline.dataobject = "p_catalog" syntax is as follows: PIPELINE (source_connect = drms, destination_connect = access, type = replace, commit = 100, errors = 100, keyname = "BookCatalog_x") SOURCE (Name = "BOOKCATALOG", Column (Type = Decimal, Name = "CATLID", DBTYPE = "DECIMAL (20, 0)", Key = YES, NULLS_ALLOWED = No) Column (Type = Decimal, Name = "RID", DBTYPE = "DECIMAL (18, 0)", NULLS_ALLOWED = YES) Column (Type = varchar, name = "BOOK_ID", DBTYPE = "VARCHAR (20)", NULLS_ALLOWED = NO) Column (Type = Decimal, Name = "Series_no ", dbtype =" decimal (4, 0) ", nulls_allowed = no) column (Type = varchar, name =" chapter_no ", dbtype =" varchar (20) ", nulls_allowed = no) column (type = varchar, name = "Chapter_name", dbtype = "VARCHAR (100)", NULLS_ALLOWED = No) Column (Type = Decimal, Name = "Page_Number", DBTYPE = "Decimal (4, 0)", NULLS_ALLOWED = NO) RETRIEVE (statement = " PBSELECT (Version (400) table (name = ~ "bookcatalog ~") column (name = ~ "bookcatalog.catlid ~") Column (name = ~ "bookcatalog.rid ~") Column (Name = ~ "Bookcatalog.book_id ~ ") Column (Name = ~" BOOKCATALOG.SERIES_NO ~ ") Column (Name = ~" BOOKCATALOG.CHAPTER_N o ~ ") Column (name = ~" bookcatalog.chapter_name ~ ") Column (name = ~" bookcatalog.page_number ~ ") // Note that this part is where we have to join your SQL
) ")
Destination (name = "bookcatalog", column (type = double, name = "catlid", dbtype = "double", key = yes, nulls_allowed = no, initial_value = "0") Column (Type = Double, Name = "RID ", dbtype =" double ", nulls_allowed = yes) column (type = varchar, name =" book_id ", dbtype =" varchar (20) ", nulls_allowed = no, initial_value =" spaces ") column (type = double, name = "Series_No", dbtype = "DOUBLE", nulls_allowed = no, initial_value = "0") COLUMN (type = varchar, name = "Chapter_No", dbtype = "VARCHAR (20)", nulls_allowed = no, initial_value = "spaces ") Column (type = varchar, name =" chapter_name ", dbtype =" varchar (100) ", nulls_allowed = no, initial_value =" spaces ") column (type = double, name =" Page_Number ", dBtype =" double " , NULLS_ALLOWED = NO, INITIAL_VALUE = "0")) Establish a function: wf_getsql_syntax will give the above you get the syntax to a_sql = u_pipeline.syntax pass to the function, a_sou_tabname is the incoming table name can change A_NO according to its own needs. A_NO is incoming Single number, can change / function name String WF_GETSQL_SYNTAX (String a_sql, string a_sou_tabname, string a_no) // A_SQL, the grammatical A_SOU_TABNAME To export the source table name // a_no Deliveries of the relevant order number // return a syntax pipe.syntax ls_start ls_where ls_end // author: Lin Feng Sun String ls_tab_name , Ls_col_name // table names and field names Liezi // // Order if upper (left (a_no, 3)) = "DGD" then ls_tab_name = "BookOrderList" ls_col_name = "BodmId" end ifString ls_start, ls_end, ls_wherelong ll_s_posll_s_pos = pos (a_sql, "destination") LS_START = MID (A_SQL, 1, LL_S_POS - 7) LS_END = MID (A_SQL, LL_S_POS - 6)