Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Form 4.5 and cursor

Re: Form 4.5 and cursor

From: Lando <MarkL_at_quebim.com>
Date: 1997/12/17
Message-ID: <3498337E.2DE9045@quebim.com>#1/1

What you are doing will not work. To do something like this you need to use dynamic sql. Check out package forms_ddl. Even then you may have problems since you will be trying to do dynamic sql in an explicit cursor declaration. You may find is easier to use an implicit cursor, that is, just do the select (using forms_ddl) without declaring a
cursor. You will also encounter problems when you try to do the select...into using forms_ddl. Basically, no value is ends up being stored in the variable being selected into even though the statement will execute successfully. I have not worked this part out yet, so let me know if you come up with a solution.

khw_at_earthlink.net wrote:

> Hi everyone
>
> I am trying to pass the parameters to the Oracle form for the cursor
> variable, but I have not been able to so
>
> For example, for simplicity
>
> A table, table_1 with 3 fields (field1,field2, field3).
>
> In PL/SQL,
>
> It will be "select field1 from table_1 where field_2 = 'abc'"
>
> However if I have a procedure, test
>
> procedure test(table_name char, f_1 char,f_2) is
> CURSOR DATA_CURSOR(table_name char,f_l char, f_2 char) IS
> SELECT DISTINCT f_1
> FROM table_name
> where f_2 = 'abc';
> begin
> open data_cursor(table_1,f_1,f_2);
> ....
> end;
>
> --call test
>
> test('table_1','field_1','field_2');
>
> I know test does not work because I can not get the result what I
> want, but what do I have to do to modify test procedure so I will be
> able to pass the parameters into the cursor
>
> Thank you
Received on Wed Dec 17 1997 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US