Home » Developer & Programmer » Forms » no of rows in a block (oracle)
no of rows in a block [message #305787] Wed, 12 March 2008 00:57 Go to next message
daniesh.shaikh@gmail.com
Messages: 62
Registered: February 2008
Location: india
Member
Hi Experts,
How to find how many rows are there in a particular block???


Thanks,
Daniesh
Re: no of rows in a block [message #307435 is a reply to message #305787] Tue, 18 March 2008 20:33 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Search this forum for 'count_query'.

David
Re: no of rows in a block [message #307513 is a reply to message #305787] Wed, 19 March 2008 01:07 Go to previous messageGo to next message
thomasscaria
Messages: 21
Registered: July 2007
Location: Kuwait
Junior Member
FUNCTION query_count (p_block_name VARCHAR2) RETURN NUMBER
IS
cnt NUMBER;
BEGIN
GO_BLOCK(p_block_name);
COUNT_QUERY;
cnt := GET_BLOCK_PROPERTY(p_block_name, QUERY_HITS);
IF FORM_SUCCESS THEN
RETURN (cnt);
ELSE
MESSAGE('Error in getting Query Hits for block '||:SYSTEM.CURRENT_BLOCK);
RAISE FORM_TRIGGER_FAILURE;
END IF;
END;



WHEN-BUTTON-PRESSED trigger of 'Details'button

DECLARE
v_cnt NUMBER;
BEGIN
v_cnt := query_count(<detail block name>);
IF (v_cnt = 0) THEN
p_show_alert('No Details exist.');
ELSE
GO_BLOCK(<detail block name>);
EXECUTE_QUERY;
END IF;
END;
Re: no of rows in a block [message #307518 is a reply to message #307513] Wed, 19 March 2008 01:12 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
@Thomas,

Please use the 'code' tags!!

David
Previous Topic: Close Web.show_document Automatically
Next Topic: Logical error
Goto Forum:
  


Current Time: Tue Dec 06 15:44:12 CST 2016

Total time taken to generate the page: 0.10857 seconds