Home » Developer & Programmer » Forms » catch all/* the records (merged 3) (Windows XP2)
catch all/* the records (merged 3) [message #441316] Sat, 30 January 2010 12:21 Go to next message
kalpataru
Messages: 72
Registered: January 2010
Location: INDIA
Member
please tellme how to catch all/* the records in oracle 10g forms(D2K) by writting a oracle 10g database procedure, displaying all the records in a oracle forms block grid

i am waiting for your response.....
Re: catch all/* the records (merged 3) [message #441322 is a reply to message #441316] Sat, 30 January 2010 13:38 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
If I understood the question, you want to create a form whose data block is based on a stored procedure. If so, check this thread.
Re: catch all/* the records (merged 3) [message #441391 is a reply to message #441322] Sun, 31 January 2010 05:17 Go to previous messageGo to next message
kalpataru
Messages: 72
Registered: January 2010
Location: INDIA
Member
i don't want the block level procedure i want just calling the procedure from froms by pressing a button and in that button i want to call that oracle 10g database procedure(without using the packages)

pls tell me.............
Re: catch all/* the records (merged 3) [message #441392 is a reply to message #441391] Sun, 31 January 2010 05:27 Go to previous messageGo to next message
tamzidulamin
Messages: 132
Registered: October 2009
Location: Dhaka
Senior Member
Write the follwing code in
WHEN-BUTTON-PRESSED trigger as
  Begin
   Database_procedure_name;
  End; 
  


Tamzid.
Re: catch all/* the records (merged 3) [message #441394 is a reply to message #441392] Sun, 31 January 2010 05:44 Go to previous messageGo to next message
kalpataru
Messages: 72
Registered: January 2010
Location: INDIA
Member
yes i know

but how can i see the records
in a grid, how oracle forms show me all the records from that procedure.
how can i assign all records into the text_items.

WHEN-BUTTON-PRESSED trigger as

Begin
Database_procedure_name;
End;
Re: catch all/* the records (merged 3) [message #441397 is a reply to message #441316] Sun, 31 January 2010 06:37 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
The simplest way is to have the procedure return a ref cursor or pl/sql block that cintains the results of the query. Then in the form loop over the results and display the records using next_record to go to the next one each time.
This is basically what forms does when you base a block on a procedure, so why not make life simple for yourself and just do that.

Re: catch all/* the records (merged 3) [message #441404 is a reply to message #441397] Sun, 31 January 2010 11:19 Go to previous messageGo to next message
kalpataru
Messages: 72
Registered: January 2010
Location: INDIA
Member
hi friend,
thanking you for quick replay.
i have already done this but when i am trying to catch the record in the for loop in the forms declaration section it is showing error that's why i am asking you.

this is th procedure

CREATE OR REPLACE
PROCEDURE TESTPROC(c_test out sys_refcursor) AS
BEGIN
open c_test for
select * from emp;
END TESTPROC;

you just tell me what i write in oracle 10g forms to retrieve
all the records.

you give me a written document...

i am waiting for your response.
Re: catch all/* the records (merged 3) [message #441406 is a reply to message #441316] Sun, 31 January 2010 13:18 Go to previous message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Why not just tell us what the error you're getting is along with the code you're using?
We would probably have sorted this out already.
Something like this:
DECLARE
c_test sys_refcursor;
r_test emp%rowtype;
BEGIN

testproc(c_test);
LOOP
  FETCH c_test INTO r_test;
  EXIT WHEN c_test%NOTFOUND;
  <code to populate your datablock here>
END LOOP;
CLOSE c_test;
END;


Previous Topic: shortcut key for oracle 10g
Next Topic: How to Use UP-Key in a tabular Form
Goto Forum:
  


Current Time: Fri Sep 20 03:38:39 CDT 2024