How to remove data from different databases in the same data window

zhaozj2021-02-08  206

Detapouts are required from different databases (EG: DB1 = ORACLE; DB2 = Sybase) during a project development process as a report in the same data window. The idea is as follows:

1. Create two Tabular type DataWindow, dw_oracle, dw_sybase.

2. Create a Composite DataWindow "DW_CMPST". Place dw_oracle and dw_syabse in this data window. Name "dw_orcl" and "dw_sbs", respectively.

3. Write the following statement in the script:

DataWindowChild LDWC_Report Transaction New_Sqlca; Connect Using Sqlca; // Using the default transaction object

dw_cmpst.GetChild ( "dw_orcl", ldwc_report) // get a reference tothe first report in the composite ldwc_report.SetTransObject (SQLCA) ldwc_report.Retrieve () DISCONNECT USING SQLCA; NEW_SQLCA = CREATE Transaction // second transaction object NEW_SQLCA.DBMS = "SYC Sybase System 10/11" NEW_SQLCA.Database = "database" NEW_SQLCA.LogPass = "password" NEW_SQLCA.ServerName = "sybase_server" NEW_SQLCA.LogId = "logid" NEW_SQLCA.DBParm = "Release = '11', StaticBind = 0, DateTimeAllowed = 'Yes' "CONNECT USING NEW_SQLCA; dw_cmpst.GetChild (" dw_sbs ", ldwc_report) // reference ldwc_report.SetTransObject (NEW_SQLCA) ldwc_report.Retrieve () DISCONNECT USING NEW_SQLCA; SetNull (NEW_SQLCA);

DW_CMPST.RETRIEVE () // Remove the data and display

The last sentence has an error, remove this statement and does not display the data, and you can't help it. Later, I got the following answers in a foreign forum:

Change DW_CMPST.RETRIEVE () to the following statement:

DW_CMPST.SETREDREDRAW (FALSE)

DW_CMPST.MODIFY ("DataWindow.Print.Preview = YES")

DW_CMPST.MODIFY ("DataWindow.Print.preview = no")

DW_CMPST.SETREDREDRAW (TRUE)

转载请注明原文地址:https://www.9cbs.com/read-2663.html

New Post(0)