Home » Developer & Programmer » Forms » Open REF CURSOR ==> "this feature is not supported in client side programs" (Oracle Forms 9i)
Open REF CURSOR ==> "this feature is not supported in client side programs" [message #392496] Wed, 18 March 2009 03:54 Go to next message
ramyazhary
Messages: 7
Registered: March 2009
Junior Member
Hello All,

am builing a form where the user chooses the fields from a certain table which he wishes to print on a file on his computer

so i construct the sql statement ex. "select field1,field2
from my_table"

then i want to use a ref cursor inoder to run this query and then while looping print the output on a file

while doing so i get an error message on this line
OPEN l_cursor FOR TRIM(v_query);
<==this feature is not supported in client side programs

so can anyone help how to overcome this problem .. i stored my pl/sql in a botton and in a function and i always get the same message

below is the script i made:

DECLARE
myCSV text_io.file_type;
v_name char(30);
v_name2 char(30);
v_query varchar2(300);
TYPE ref_cursor IS REF CURSOR;
l_cursor ref_cursor;

BEGIN
myCSV := text_io.fopen('C:\test.xls','w');
select command into v_query
from credit_reports
where rep_id=:REP_id ("Value from forms");

OPEN l_cursor FOR v_query;
LOOP
EXIT WHEN l_cursor%NOTFOUND;
FETCH l_cursor INTO v_name,v_name2;
text_io.put_line(myCSV,v_name||' '||v_name2);

END LOOP;
CLOSE l_cursor;
text_io.fclose(myCSV);
END;
Re: Open REF CURSOR ==> "this feature is not supported in client side programs" [message #392498 is a reply to message #392496] Wed, 18 March 2009 03:59 Go to previous messageGo to next message
babuknb
Messages: 1736
Registered: December 2005
Location: NJ
Senior Member


Welcome to OraFaq !!!

Please read the OraFAQ Forum Guide before posting.
http://www.orafaq.com/forum/t/88153/0/

Please post your database version (4 digit)

Post your forms version

Please copy and paste your code from session.

Babu
Re: Open REF CURSOR ==> "this feature is not supported in client side programs" [message #392510 is a reply to message #392496] Wed, 18 March 2009 04:26 Go to previous messageGo to next message
ramyazhary
Messages: 7
Registered: March 2009
Junior Member
DB Version 10.2.0.4.0
Form Version 9.0.2.9.0
Re: Open REF CURSOR ==> "this feature is not supported in client side programs" [message #392744 is a reply to message #392496] Thu, 19 March 2009 02:52 Go to previous messageGo to next message
ramyazhary
Messages: 7
Registered: March 2009
Junior Member
Any Answer anyone ?

just want to know where to put this code
in a botton or should i create a function or a procedure or a package and how to use it ??

any one ??
Re: Open REF CURSOR ==> "this feature is not supported in client side programs" [message #394913 is a reply to message #392744] Mon, 30 March 2009 17:43 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Have you solved your problem?

Did you consider just putting a flag on each field to be output and then testing whether it has been set when you do the output? I know it is much more primitive but it would save having to use a ref_cursor. Have you considered passing the flags into a database procedure and doing it all in there?

David
Re: Open REF CURSOR ==> "this feature is not supported in client side programs" [message #395215 is a reply to message #392496] Tue, 31 March 2009 13:43 Go to previous messageGo to next message
ramyazhary
Messages: 7
Registered: March 2009
Junior Member
Hey David thanks for replying.

if i made a procedure on the database
i won't be able to generate the file on the user's computer.
putting the flag thing won't do me any good
cuz i'll make the user chooose the fields and any conditions he wants to make and if he can't to sum or count or do any math operations, so i guess it won't work..
it would be goood if only if it was just a straight select statement.
the other guy in the other post
Using native dynamic Sql [message #392781]
he made a function, its for any 1 row query only.
any guesses ??
Re: Open REF CURSOR ==> "this feature is not supported in client side programs" [message #395571 is a reply to message #395215] Wed, 01 April 2009 22:43 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
I think his solution will work for Forms 10g and up. The sys_refcursor came in the PL/SQL in Oracle 9 and it seems to work for that person in Forms 10g.

David
Re: Open REF CURSOR ==> "this feature is not supported in client side programs" [message #395663 is a reply to message #392496] Thu, 02 April 2009 03:15 Go to previous messageGo to next message
ramyazhary
Messages: 7
Registered: March 2009
Junior Member
am using 10g now, but i can't use the code i mentioned before, i have the same error.
i made it to work as a function on the database and then call it from the froms, yet the output file is created on the server.

any ideas ?
Re: Open REF CURSOR ==> "this feature is not supported in client side programs" [message #395677 is a reply to message #392496] Thu, 02 April 2009 04:03 Go to previous messageGo to next message
cookiemonster
Messages: 13963
Registered: September 2008
Location: Rainy Manchester
Senior Member
Presumably your database function is using utl_file rather than text_io?
In which case it will put the file on the db server as that's what utl_file does.
If you need this file created on the client machine then you have to use text_io in forms.
Perhaps you'd be better off looking for an alternative to dynamic ref_cursors.
Does your ref cursor always contain the same number/type of columns?
Re: Open REF CURSOR ==> "this feature is not supported in client side programs" [message #395788 is a reply to message #392496] Thu, 02 April 2009 10:23 Go to previous messageGo to next message
ramyazhary
Messages: 7
Registered: March 2009
Junior Member
no, it will always change according to the user's needs
as the user will select the columns that he wants and if he want to do any operations like count or sum
Re: Open REF CURSOR ==> "this feature is not supported in client side programs" [message #395944 is a reply to message #395788] Fri, 03 April 2009 04:21 Go to previous message
cookiemonster
Messages: 13963
Registered: September 2008
Location: Rainy Manchester
Senior Member
ramyazhary wrote on Thu, 02 April 2009 16:23
no, it will always change according to the user's needs
as the user will select the columns that he wants and if he want to do any operations like count or sum


/forum/fa/450/0/

Are you trying to write an ad-hoc query tool?

If they want that level of flexibility you need to give them oracle discoverer or something similar.

Trying to do this through forms is wildly impractical.
Previous Topic: how to show message 'do you want to save changes ?? '
Next Topic: populate_list
Goto Forum:
  


Current Time: Mon Feb 03 20:59:49 CST 2025