SOLVED: Multi-database queries attempt December 02, 2022 11:30PM |
Registered: 5 years ago Posts: 74 |
gwsdQRY_HF_Test is Data Source gwsdQRY_PO_Test is Data Source gwsdQRY_Join is Data Source sHFSQL is string = [ SELECT PurcLineBinary.PurcLineBinaryID, PurcLineBinary.ROWID, PurcLineBinary.PURC_ORDER_ID, PurcLineBinary.PURC_ORDER_LINE_NO, PurcLineBinary.TYPE, PurcLineBinary.BITS, PurcLineBinary.BITS_LENGTH, PurcLineBinary.Description FROM PurcLineBinary WHERE PurcLineBinary.Description LIKE '%ANODIZE%' ] IF NOT HExecuteSQLQuery(gwsdQRY_HF_Test,HF_Server,hNoBind,sHFSQL) THEN Error(HErrorInfo()) ELSE HReadFirst(gwsdQRY_HF_Test) END sPO_POL is string =[ SELECT PURCHASE_ORDER.ROWID+10 AS ROWID_PO10, PURCHASE_ORDER.ID AS ID, PURCHASE_ORDER.VENDOR_ID AS VENDOR_ID FROM PURCHASE_ORDER ORDER BY ORDER_DATE DESC, VENDOR_ID ASC ] IF NOT HExecuteSQLQuery(gwsdQRY_PO_Test,SQL_Server,hQueryWithoutCorrection+hNoBind,sPO_POL) // HExecuteSQLQuery()gwsdQRY_PO_Test,SQL_Server,hNoBind,sPO_POL) then Error(HErrorInfo()) ELSE HReadFirst(gwsdQRY_PO_Test) HReadSeekFirst(gwsdQRY_PO_Test,rowid_po10,gwsdQRY_HF_Test.rowid) END Info("HF recs: "+HNbRec(gwsdQRY_HF_Test),"PO_POL recs: "+HNbRec(gwsdQRY_PO_Test)) sJoin is string = [ select * FROM gwsdQRY_HF_Test,gwsdQRY_PO_Test where gwsdQRY_HF_Test.ROWID = gwsdQRY_PO_Test.ROWID_PO10 ] IF NOT HExecuteSQLQuery(gwsdQRY_Join,hNoBind,sJoin) THEN Error(HErrorInfo()) ELSE HReadFirst(gwsdQRY_Join) END Info("Join recs:"+HNbRec(gwsdQRY_Join))
Re: Multi-database queries attempt December 04, 2022 05:38PM |
Registered: 5 years ago Posts: 79 |
Re: Multi-database queries attempt December 04, 2022 09:17PM |
Registered: 5 years ago Posts: 74 |
Re: SOLVED: Multi-database queries attempt December 05, 2022 04:10AM |
Registered: 5 years ago Posts: 79 |
Re: SOLVED: Multi-database queries attempt December 05, 2022 08:50PM |
Registered: 5 years ago Posts: 74 |
QRY_PO_POL_Search.pOrderDateFrom = StringToDate("01/01/2021",maskDateSystem) QRY_PO_POL_Search.pOrderDateTo = StringToDate("03/01/2021",maskDateSystem) HExecuteQuery(QRY_PO_POL_Search) QRY_PLB_ByDescription.pDescription = "anodize" HExecuteQuery(QRY_PLB_ByDescription) Info("SQL: "+HNbRec(QRY_PO_POL_Search),"HF: "+HNbRec(QRY_PLB_ByDescription)) IF NOT HExecuteQuery(QRY_PO_POl_Seach_test) THEN Error("4 HExecuteQuery(QRY_PO_POl_Seach_test)", HError,HErrorInfo()) ELSE Info("Join recs:"+HNbRec(QRY_PO_POl_Seach_test)) HReadFirst(QRY_PO_POl_Seach_test) END Info("First Vendor = "+QRY_PO_POl_Seach_test.VENDOR_ID)