Quack
asked on
SQL code commented out within Cold Fusion - Not sure if it is being executed while its w/in the <!--- ---> brackets.
I have a sql query w/in Cold Fusion I'm confused about. The colorization of the commented out code isn't showing correctly within dreamweaver:
[code][/<cfquery name="vp" datasource="casprod">
select c.org_id orgid, c.vendor_name vendor, c.address_line1 addr1, c.address_line2 addr2, c.address_line3 addr3,c.city city,c.state state, substr(c.zip,1,5) zip, c.country country, substr(d.attribute1,1,2) doctype, sum(d.amount) tot_amount, count(distinct c.check_id) count
from ap.ap_checks_all c, ap.ap_invoice_payments_all p, ap.ap_invoice_distribution s_all d, ap.ap_invoices_all i
where c.payment_method_lookup_co de='CHECK'
and c.amount <> 0
and c.check_id = p.check_id
and p.invoice_id= d.invoice_id
and d.invoice_id = i.invoice_id
and c.status_lookup_code = 'NEGOTIABLE'
and c.org_id =101
and i.source <> 'MILITARY PAY'
and c.check_date >= TRUNC(ADD_MONTHS(SYSDATE, -1),'MM')
and c.check_date <= LAST_DAY(ADD_MONTHS(SYSDAT E, -1))
group by c.org_id,c.attribute8,c.ve ndor_name, c.address_ line1,c.ad dress_line 2, c.address_line3,c.city,c.s tate,c.zip ,c.country ,substr(d. attribute1 ,1,2)
order by 3
<!---select c.org_id orgid, c.attribute8 attrib8, c.vendor_name vendor, c.address_line1 addr1, c.address_line2 addr2, c.address_line3 addr3,c.city city,c.state state, substr(c.zip,1,5) zip, c.country country, substr(d.attribute1,1,2) doctype, sum(d.amount) tot_amount, count(distinct c.check_id) count
from ap.ap_checks_all c, ap.ap_invoice_payments_all p, ap.ap_invoice_distribution s_all d
where c.payment_method_lookup_co de='CHECK'
and c.amount <> 0
and c.check_id = p.check_id
and p.invoice_id= d.invoice_id
and c.status_lookup_code = 'NEGOTIABLE'
and c.org_id =101
and c.check_date >= TRUNC(ADD_MONTHS(SYSDATE, -1),'MM')
and c.check_date <= LAST_DAY(ADD_MONTHS(SYSDAT E, -1))
group by c.org_id,c.attribute8,c.ve ndor_name, c.address_ line1,c.ad dress_line 2, c.address_line3,c.city,c.s tate,c.zip ,c.country ,substr(d. attribute1 ,1,2)
order by 3--->
</cfquery>code]
That's the full query but my question is regarding the commented section. If I pull that section out will that affect the other query? I'm getting better at sql but confused as to why this would be set up like this. Thanks for your help.
[code][/<cfquery name="vp" datasource="casprod">
select c.org_id orgid, c.vendor_name vendor, c.address_line1 addr1, c.address_line2 addr2, c.address_line3 addr3,c.city city,c.state state, substr(c.zip,1,5) zip, c.country country, substr(d.attribute1,1,2) doctype, sum(d.amount) tot_amount, count(distinct c.check_id) count
from ap.ap_checks_all c, ap.ap_invoice_payments_all
where c.payment_method_lookup_co
and c.amount <> 0
and c.check_id = p.check_id
and p.invoice_id= d.invoice_id
and d.invoice_id = i.invoice_id
and c.status_lookup_code = 'NEGOTIABLE'
and c.org_id =101
and i.source <> 'MILITARY PAY'
and c.check_date >= TRUNC(ADD_MONTHS(SYSDATE, -1),'MM')
and c.check_date <= LAST_DAY(ADD_MONTHS(SYSDAT
group by c.org_id,c.attribute8,c.ve
order by 3
<!---select c.org_id orgid, c.attribute8 attrib8, c.vendor_name vendor, c.address_line1 addr1, c.address_line2 addr2, c.address_line3 addr3,c.city city,c.state state, substr(c.zip,1,5) zip, c.country country, substr(d.attribute1,1,2) doctype, sum(d.amount) tot_amount, count(distinct c.check_id) count
from ap.ap_checks_all c, ap.ap_invoice_payments_all
where c.payment_method_lookup_co
and c.amount <> 0
and c.check_id = p.check_id
and p.invoice_id= d.invoice_id
and c.status_lookup_code = 'NEGOTIABLE'
and c.org_id =101
and c.check_date >= TRUNC(ADD_MONTHS(SYSDATE, -1),'MM')
and c.check_date <= LAST_DAY(ADD_MONTHS(SYSDAT
group by c.org_id,c.attribute8,c.ve
order by 3--->
</cfquery>code]
That's the full query but my question is regarding the commented section. If I pull that section out will that affect the other query? I'm getting better at sql but confused as to why this would be set up like this. Thanks for your help.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
These comments answer the question about the commented select-clause in the cfquery
query_1.jpg
query_2.jpg