Home » Developer & Programmer » Reports & Discoverer » Understanding & Variables in sql for a report
Understanding & Variables in sql for a report [message #234502] Tue, 01 May 2007 16:29 Go to next message
Anne Simms
Messages: 163
Registered: May 2002
Location: San Francisco, CA
Senior Member
I've been away from reports for a while, so I am a little rusty. Can someone explain to me what the below data represnts at the end of a sql statement/query when building an Oracle report and how it relates to the report?

&CP_ORG_WHERE
&CP_BUILDING_WHERE
&CP_ROOM_WHERE
&CP_EXCLUDE_FED_WHERE

Thanks
Anne
Re: Understanding & Variables in sql for a report [message #234503 is a reply to message #234502] Tue, 01 May 2007 16:37 Go to previous message
Littlefoot
Messages: 20891
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
It looks like dynamically created WHERE clause. For example, if your query looks like
SELECT deptno, dname
FROM dept
&cp_org_where
you'd have to find where 'cp_org_where' is created. I presume it has something to do with user parameter(s) and could be defined in the AFTER-PARAMETER-FORM trigger (with possible use of a package/procedure/function).

It might look like this: if parameter's name is 'par_loc', then 'cpc_org_where' might look like
'WHERE loc = ' || :par_loc
which would then evaluate the whole query into
SELECT deptno, dname
FROM dept
WHERE loc = :par_loc
Previous Topic: using a .prt with oralce 10g
Next Topic: Print formula column onto the last page
Goto Forum:
  


Current Time: Sun Dec 04 16:58:46 CST 2016

Total time taken to generate the page: 0.27375 seconds