Home » Developer & Programmer » Forms » Count Query
Count Query [message #165690] Fri, 31 March 2006 08:51 Go to next message
lailakhalid
Messages: 7
Registered: March 2006
Location: LUTON
Junior Member
Can someone please tell me how to qwrite pl/sql code to count number of records an return the value on the customised alert message.


Re: Count Query [message #165846 is a reply to message #165690] Mon, 03 April 2006 01:24 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Search this forum for 'count query'.

David
Re: Count Query [message #166403 is a reply to message #165690] Thu, 06 April 2006 03:06 Go to previous messageGo to next message
hidayatk
Messages: 25
Registered: November 2005
Junior Member
-- copy&paste this code in 'when_button_press'....(not n post query)
-- code'll display all records in data table
-- to display records retrived to block, u can use other query built-ins
declare
a number;
num_records number;
begin
select count(*) into num_records from schema.table;
go_block('desired_block');
-- if forms is multi-blocks, set blocks' navigation style property to 'change data block'
execute_query;
set_alert_property('desired_alert', alert_message_text, 'Total Reords in table:'||to char(num_records));
a:=show_alert('desired_alert');
end;
-- ----------------------- or ----------------------------------
-- count_query
-- any where u use 'execute_query', write simply 'count_query'
-- get message text that results from,
-- include it in alert (set_alert_property)
-- display alert

[Updated on: Thu, 06 April 2006 23:13]

Report message to a moderator

Re: Count Query [message #166416 is a reply to message #166403] Thu, 06 April 2006 03:56 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Yuck! A count query in Forms...it's probably not your own idea but I hate them. I really do. What end user cares about the number of records?

MHE
Re: Count Query [message #166422 is a reply to message #166416] Thu, 06 April 2006 04:38 Go to previous messageGo to next message
hidayatk
Messages: 25
Registered: November 2005
Junior Member
write good/nice code, that's not hated by u Sir!
Re: Count Query [message #166429 is a reply to message #166422] Thu, 06 April 2006 05:00 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
hidayatk wrote on Thu, 06 April 2006 11:38

write good/nice code, that's not hated by u Sir!


Wink Chill, I didn't mean it personally (there's nothing wrong with your code - although I would consider NOT to put it in the post query as it is fired again and again and again...) but I think the entire idea behind it is flawed. It means that you have to scan through the entire table for information that is (in most cases) not relevant to the end user. I stand my ground: requirement from hell.

MHE
Re: Count Query [message #166439 is a reply to message #166429] Thu, 06 April 2006 05:27 Go to previous message
hidayatk
Messages: 25
Registered: November 2005
Junior Member
i did correct...thank u mentioning it,
but i like 'select into'..
Previous Topic: Could not reserve record (2 tries) keep trying ?
Next Topic: Chek in table if "number" found show alert - ???
Goto Forum:
  


Current Time: Fri Sep 20 08:41:14 CDT 2024