CheckBox [message #619211] |
Sat, 19 July 2014 15:28 |
|
jsanquintin
Messages: 20 Registered: July 2014 Location: Santo Domingo Republica D...
|
Junior Member |
|
|
I have a dynamic condition where the cursor within a cursor receives some parameters checkbox.
the problem is that when the cursor plus a receive parameter data does not bring me.
any suggestions ???
Juan Sanquintin
Dominican Republic.
|
|
|
|
|
|
|
Re: CheckBox [message #619325 is a reply to message #619324] |
Mon, 21 July 2014 08:48 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
That link shows multiple solutions, Use the 9i and above solution if your version of forms will allow it.
|
|
|
|
Re: CheckBox [message #619340 is a reply to message #619329] |
Mon, 21 July 2014 13:43 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Here's one option. My P_TEST procedure is like your PRC_RESULTADO; it accepts a comma-separated values list (list of departments in Scott's DEPT table) and displays employees that work in those departments.
SQL> create or replace procedure p_test (par_depts in varchar2)
2 is
3 cursor cur_emp is
4 select deptno, ename, job
5 from emp
6 where deptno in (select regexp_substr(par_depts, '[^,]+', 1, level)
7 from dual
8 connect by regexp_substr(par_depts, '[^,]+', 1, level) is not null
9 )
10 order by deptno, ename;
11 begin
12 for cur_r in cur_emp loop
13 dbms_output.put_line(cur_r.deptno ||': '|| cur_r.ename ||', '|| cur_r.job);
14 end loop;
15 end;
16 /
Procedure created.
SQL>
Lines 6 - 9 are used to convert columns to rows.
For example:SQL> with test as (select '10,30,3' col from dual)
2 select regexp_substr(col, '[^,]+', 1, level)
3 from test
4 connect by regexp_substr(col, '[^,]+', 1, level) is not null;
REGEXP_
-------
10
30
3
SQL> See?
10,30,3 --> 10
30
3
OK, let's invoke the procedure:SQL> declare
2 l_depts varchar2(20) := '10,30';
3 begin
4 p_test (l_depts);
5 end;
6 /
10: CLARK, MANAGER
10: KING, PRESIDENT
10: MILLER, CLERK
30: ALLEN, SALESMAN
30: BLAKE, MANAGER
30: JAMES, CLERK
30: MARTIN, SALESMAN
30: TURNER, SALESMAN
30: WARD, SALESMAN
PL/SQL procedure successfully completed.
SQL>
Review that code and adjust it so that fulfills your needs. I hope you'll make it work. If not, post what you've tried (don't forget to properly format code and maintain formatting using the [code] tags), say what went wrong and someone will assist.
|
|
|
Re: CheckBox [message #619569 is a reply to message #619340] |
Wed, 23 July 2014 07:38 |
|
jsanquintin
Messages: 20 Registered: July 2014 Location: Santo Domingo Republica D...
|
Junior Member |
|
|
Littlefoot, thank you very much, everything worked perfectly. and to everyone who helped me also thank you
|
|
|