How to take data out of different databases and put them in the same data window

Source: Internet
Author: User
Tags modify connect reference sybase window
Data | database
The need to remove data from different databases (eg:db1=oracle;db2=sybase) in one project development process as a report in a data window. Ideas are 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. Named "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 to
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= ', 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 data and display

The last sentence of error, remove this statement can not display data, baffled. Later in a foreign forum to get the following answer:

Change Dw_cmpst.retrieve () to the following statement:

Dw_cmpst.setredraw (False)

Dw_cmpst.modify ("Datawindow.print.preview=yes")

Dw_cmpst.modify ("Datawindow.print.preview=no")

Dw_cmpst.setredraw (True)






Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.