can i use this in Report .... ? [message #505683] |
Wed, 04 May 2011 09:11 |
oralover2006
Messages: 144 Registered: January 2010 Location: India
|
Senior Member |
|
|
using Developer 10g Rel.2 on WinXP with SP3
i was searching for Parameterized Views, on Ask Tom website found the solution below:
CREATE OR REPLACE
type APPTDEPT_TY is object (appt_department varchar2(11));
CREATE OR REPLACE
type APPTDEPT_TBL_TY is table of apptdept_ty;
CREATE FUNCTION q_apptdept (p_appointment_id varchar2, p_date date)
RETURN apptdept_tbl_ty
IS
CURSOR cur (c_appt_id varchar2, c_date date)
IS
SELECT d.appt_department
FROM apptdept d
WHERE D.APPOINTMENT_ID = c_appt_id
AND D.DEPT_EFF_DATE <= c_date
AND (D.DEPT_END_DATE IS NULL
OR D.DEPT_END_DATE >= c_date);
ty apptdept_ty;
tbl apptdept_tbl_ty := apptdept_tbl_ty ();
BEGIN
FOR rec IN cur (p_appointment_id, p_date) LOOP
ty := apptdept_ty (rec.appt_department);
tbl.EXTEND;
tbl (tbl.LAST) := ty;
END LOOP;
RETURN tbl;
END;
Now, we can execute the query
SELECT *
FROM TABLE(Q_APPTDEPT('00123456',SYSDATE));
want to ask, can i use the last SQL statement ( Select * ... ) of the given solution in my Developer Report 10g ? like this
SELECT *
FROM TABLE(Q_APPTDEPT(:dept, :user_date));
thanks in advance.
.
|
|
|
|
Re: can i use this in Report .... ? [message #505789 is a reply to message #505741] |
Wed, 04 May 2011 23:22 |
oralover2006
Messages: 144 Registered: January 2010 Location: India
|
Senior Member |
|
|
ramoradba wrote on Wed, 04 May 2011 23:08why don`t you try it your self.
It gives you some experience right?
If any error, come back here with the error number and message, we will help you
Good luck
Sriram
tried, it works fine!!!
thanks very much Sriram for your reply.
because i have not installed, i given it to a friend, he make a report and gave me feedback.
[Updated on: Wed, 04 May 2011 23:22] Report message to a moderator
|
|
|