Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using two informix queries in one HELP

Status
Not open for further replies.

zishan619

Programmer
May 28, 2003
284
MX
Hi everyone:
I have basically two queries that I need to run to get my final data. The first query I have I made into a Pass Through query using Informix SQL. I need to take that query and make another query that joins up to an Informix table and make that into a pass through query. But its not working. Can anyone give me information on how to accomplish this task. Thanks
Z
 
Z:

We need some more information. How about posting you're queries?

Regards,

Ed
 
Ok...
First Pass through Informix query looks like this:
SELECT W.om_id, QM.typ_cd, AC.name, Max(A.date_time_posted) Date_Post, date('9/22/03') Date_Recvd, ESC.discov_date, ESC.acct_num, ESC.acct_num_combo, ESC.acct_num_conv, ESC.acct_num_ls, W.om_ch_name, W.om_ch_state_cd, W.om_ch_zip_cd, W.om_frd_src, ESC.start_csh_bal, ESC.start_csh_trans, ESC.start_rtl_trans, ESC.start_rtl_bal, ESC.card_used, ESC.prim_chg_state, ESC.prim_chg_ctry, ESC.prim_chg_region, ESC.fd_analyst_id, ESC.cycle, ESC.exception, ESC.frd_subtype, ESC.fraud_type, ESC.first_fraud_amt, ESC.first_fraud_date, ESC.initial_dept, ESC.posess_mc_prim, ESC.posess_mc_sec, ESC.posess_mc_auth, ESC.posess_vs_prim, ESC.posess_vs_sec, ESC.posess_vs_auth, ESC.service_abuse_desc, ESC.fraud_source_code, ESC.original_start_bal, ESC.start_date, W.om_ch_sts_cd, ESC.trans_type, ESC.affidavit_received, ESC.investig_ref
FROM main_esc_fams AS ESC INNER JOIN ((work_actions AS A INNER JOIN (work_items AS W INNER JOIN fd_qmstr2 AS QM ON W.om_qm2_id = QM.id) ON A.work_items_om_id = W.om_id) INNER JOIN act_codes AS AC ON A.act_cd_id = AC.id) ON ESC.om_id = W.om_id
GROUP BY W.om_id, QM.typ_cd, AC.name, ESC.discov_date, ESC.acct_num, ESC.acct_num_combo, ESC.acct_num_conv, ESC.acct_num_ls, W.om_ch_name, W.om_ch_state_cd, W.om_ch_zip_cd, W.om_frd_src, ESC.start_csh_bal, ESC.start_csh_trans, ESC.start_rtl_trans, ESC.start_rtl_bal, ESC.card_used, ESC.prim_chg_state, ESC.prim_chg_ctry, ESC.prim_chg_region, ESC.fd_analyst_id, ESC.cycle, ESC.exception, ESC.frd_subtype, ESC.fraud_type, ESC.first_fraud_amt, ESC.first_fraud_date, ESC.initial_dept, ESC.posess_mc_prim, ESC.posess_mc_sec, ESC.posess_mc_auth, ESC.posess_vs_prim, ESC.posess_vs_sec, ESC.posess_vs_auth, ESC.service_abuse_desc, ESC.fraud_source_code, ESC.original_start_bal, ESC.start_date, W.om_ch_sts_cd, ESC.trans_type, ESC.affidavit_received, ESC.investig_ref
HAVING AC.name='FILE INACTIVE' Or AC.name='DELETE CASE'

Second Query which I would like to make a Pass Through Informix Query looks like this: Now I am using the query above which is called Testttttt and joining it to another table in informix....

SELECT Testttttt.typ_cd, Testttttt.name, Testttttt.date_recvd, Testttttt.discov_date, Testttttt.acct_num, Testttttt.acct_num_combo, Testttttt.acct_num_conv, Testttttt.acct_num_ls, Testttttt.om_ch_name, Testttttt.om_ch_state_cd, Testttttt.om_ch_zip_cd, Testttttt.om_frd_src, Testttttt.start_csh_bal, Testttttt.start_csh_trans, Testttttt.start_rtl_trans, Testttttt.start_rtl_bal, Testttttt.card_used, Testttttt.prim_chg_state, Testttttt.prim_chg_ctry, Testttttt.prim_chg_region, Testttttt.fd_analyst_id, Testttttt.cycle, Testttttt.exception, Testttttt.frd_subtype, Testttttt.fraud_type, Testttttt.first_fraud_amt, Testttttt.first_fraud_date, Testttttt.initial_dept, Testttttt.posess_mc_prim, Testttttt.posess_mc_sec, Testttttt.posess_mc_auth, Testttttt.posess_vs_prim, Testttttt.posess_vs_sec, Testttttt.posess_vs_auth, Testttttt.service_abuse_desc, Testttttt.fraud_source_code, Testttttt.original_start_bal, Testttttt.start_date, Testttttt.om_ch_sts_cd, Testttttt.trans_type, Testttttt.affidavit_received, Testttttt.investig_ref, AC.action_name
FROM dbadba_work_actions AS AC INNER JOIN Testttttt ON AC.work_items_om_id = Testttttt.om_id
GROUP BY Testttttt.typ_cd, Testttttt.name, Testttttt.date_recvd, Testttttt.discov_date, Testttttt.acct_num, Testttttt.acct_num_combo, Testttttt.acct_num_conv, Testttttt.acct_num_ls, Testttttt.om_ch_name, Testttttt.om_ch_state_cd, Testttttt.om_ch_zip_cd, Testttttt.om_frd_src, Testttttt.start_csh_bal, Testttttt.start_csh_trans, Testttttt.start_rtl_trans, Testttttt.start_rtl_bal, Testttttt.card_used, Testttttt.prim_chg_state, Testttttt.prim_chg_ctry, Testttttt.prim_chg_region, Testttttt.fd_analyst_id, Testttttt.cycle, Testttttt.exception, Testttttt.frd_subtype, Testttttt.fraud_type, Testttttt.first_fraud_amt, Testttttt.first_fraud_date, Testttttt.initial_dept, Testttttt.posess_mc_prim, Testttttt.posess_mc_sec, Testttttt.posess_mc_auth, Testttttt.posess_vs_prim, Testttttt.posess_vs_sec, Testttttt.posess_vs_auth, Testttttt.service_abuse_desc, Testttttt.fraud_source_code, Testttttt.original_start_bal, Testttttt.start_date, Testttttt.om_ch_sts_cd, Testttttt.trans_type, Testttttt.affidavit_received, Testttttt.investig_ref, AC.action_name
HAVING (((Testttttt.typ_cd)<>&quot;5&quot;) AND ((AC.action_name)=&quot;REL TO CASE MGMT&quot;));
Hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top