Home » Developer & Programmer » Forms » display result calculation in non database item (xp)
display result calculation in non database item [message #355444] Fri, 24 October 2008 01:59 Go to next message
echidnaa
Messages: 4
Registered: October 2008
Location: Malaysia
Junior Member

Hi,
I'm new in this forum and new in oracle form builder.

I really need help.

I have,

table1 associate with block1
table2 associate with block2
table3 associate with block3

block1 join with block2 with 1 item named code
block2 join with block3 with 2 items named code & ref_no


I put formula in post query trigger. The formulation is involving items in block2 and block3. The result will in display item(non database)

I managed get result (in value) when there is/are record or records in table3 that associate with block3 which match both conditions with block2.

select sum(unit) into unit_sell
from table3
where code = block2.code and
:block2.ref_no = :block3.ref_no

But when there is no record in table3 (which condition only match with 1 item named code in table block2)
it did not calculate & display the value.

How do I do, to make it result appear if the condition match with
this below condition :
(This is successful result when there is/are record/s)

where code = block2.code and
:block2.ref_no = :block3.ref_no

and it match this below condition:
(This is not successful result when there is no record) )

where code = block2.code and
:block2.ref_no = :block3.ref_no


What should I do. Please help. Thanks in advance.






Re: display result calculation in non database item [message #355694 is a reply to message #355444] Mon, 27 October 2008 02:02 Go to previous messageGo to next message
xpact83
Messages: 225
Registered: October 2008
Location: philippines
Senior Member
use this exception

EXCEPTION
WHEN no_data_found THEN
Re: display result calculation in non database item [message #355861 is a reply to message #355444] Tue, 28 October 2008 02:45 Go to previous messageGo to next message
rajy_salim
Messages: 204
Registered: January 2008
Location: Beirut - Lebanon
Senior Member
First, try to use the NVL function to avoid adding null values to your calculation.

Second, why are you using this
:block2.ref_no = :block3.ref_no

:block2.ref_no should be replaced by the field ref_no of table3

Third, which datablock post-query trigger are you using?

Rajy
Re: display result calculation in non database item [message #355980 is a reply to message #355694] Tue, 28 October 2008 20:48 Go to previous messageGo to next message
echidnaa
Messages: 4
Registered: October 2008
Location: Malaysia
Junior Member

hi xpact83

did try the exception but failed too
Re: display result calculation in non database item [message #355981 is a reply to message #355861] Tue, 28 October 2008 21:11 Go to previous messageGo to next message
echidnaa
Messages: 4
Registered: October 2008
Location: Malaysia
Junior Member

Hi Rajy,

1.
"First, try to use the NVL function to avoid adding null values to your calculation."

- I'm not good about NVL fuction & never try it before.
- Can you give me some example of it select statement.


2.
Second, why are you using this

:block2.ref_no = :block3.ref_no

:block2.ref_no should be replaced by the field ref_no of table3

- I have change it to field_ref of table 3 but no avail

3.
Third, which datablock post-query trigger are you using?

- I used datablock 1 (master). I also tried at form level.


Please assist. Thank and thank in advance for your help. Appreciate it very much.
Re: display result calculation in non database item [message #356048 is a reply to message #355444] Wed, 29 October 2008 03:27 Go to previous messageGo to next message
rajy_salim
Messages: 204
Registered: January 2008
Location: Beirut - Lebanon
Senior Member
Check the NVL Function.

Rajy
Re: display result calculation in non database item [message #356238 is a reply to message #355981] Thu, 30 October 2008 01:12 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Is your form working?

David
Re: display result calculation in non database item [message #359353 is a reply to message #356238] Sat, 15 November 2008 02:39 Go to previous message
echidnaa
Messages: 4
Registered: October 2008
Location: Malaysia
Junior Member

hi david
It didn't work.
I have put the formula at the property instead of using it at post query. That work fine.

Thanks to all of you who help me.
Special thanks to Rajy for your help.
Previous Topic: Call a form from a dummy form
Next Topic: open form in 10g
Goto Forum:
  


Current Time: Sat Feb 15 12:14:11 CST 2025