Answer Posted / shaik jeelan basha
By using Ref cursor we can change the select statement
dynamically at runtime which is available in the cursor
definition based on some validation.For this we need to
define ref cursor type by using following syntax.
type <type_name> is ref cursor return <return_type>;
here <type_name> is the name of the ref cursor and
<return_type> will be the return type of ref cursor it may
be %type/%rowtype/record type/plsql table type/nested table
type/varray type.
if <return_type> is mentioned we will called it as strong
ref cursor.
if <return_type> is not mentioned we will called it as weak
ref cursor.
after this we need to define ref cursor variable by using
the following syntax.
v_variable_name ref_cursor_type_name;
then based on validations we can change the ref cursor
dynamically.
for example
------------------
declare
type ref_cur is ref cursor;
v_ref_cur ref_cur;
v_deptno emp.deptno%type;
begin
select deptno into v_deptno from emp where empno=7788;
if v_deptno=20 then
open v_ref_cur for select * from emp;
elsif v_deptno=30 then
open v_ref_cur for select * from dept;
else
open v_ref_cur for select * from salgrade;
end if;
end;
| Is This Answer Correct ? | 11 Yes | 0 No |
Post New Answer View All Answers
Which oracle apps version you are very confident in?
CAN YOU CUSTOMISE THE COUTOMISE CUS_TOP
where to define interorganization transaction charges and what are the different options?
A program must be written which accepts date parameter. The date parameter will accept data in the format DD/MM/YYYY. This data has to be validated and post validation, the following details have to be displayed for this date parameter 1. Input date must be defaulted to sysdate, It can be overridden by any other date. 2. Financial year should be displayed for this date parameter. Eg: If the input date is 30/11/2010, the financial year must be displayed as 1. From Date : 01-Aprr-2010 To Date: 31-Mar-2011 3. Calendar year and Calendar month must also be displayed. 4. The next payment cycle (say for EB), must be displayed based on this date parameter. 5. The previous payment must also be displayed based on this date.
how can i print random rows in plsql table
do you know is it possible to run the interface without using oracle apps?
Explain what are the tables of auto invoice?
What are the different components you should consider while defining a responsibility in oracle apps?
What is a flexfield? List out its types.
Do you know what is applysys in oracle application database schema, what is apps?
Pls tel me the best text book for Oracle Apps 11i Tech? & I want D2K Text book also?
In oracle application how do you debug or trace errors?
please any one provide the oracle erp technical interview questions on modules(PO,AP,AR,INV,GL,OM)wise to my mail id..narendra_609@yahoo.co.in
Tell me how to debug the report?
what is pay run id ?