which Trigger?? [message #641100] |
Mon, 10 August 2015 09:43  |
 |
palpali
Messages: 138 Registered: December 2014 Location: India
|
Senior Member |
|
|
Hallo
Once again, i would like to share my Problem here in the Forum, which help me really very good to improve my skill
well, I have one master, and 2 Detail blocks.
and, i do have following query:
select * from T1
where exists ( select 1
from T2
where exists (select 1
from T3, T2 where T2.id = T3.id and T2.text = T3.text ))
and T1.kateg = 'TPD'
;
Now, when this condition match then, the block1.text should display text automatically in the block1.text and user just Need to give Input for other fields in the same block.
So, how could i can do this? or which Trigger and where should i use this?
please help.
thank you.
regards
|
|
|
Re: which Trigger?? [message #641102 is a reply to message #641100] |
Mon, 10 August 2015 10:13   |
John Watson
Messages: 8976 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
You have an unecessary clause in your query that may degrade performance. This will be better:
select * from T1
where exists ( select 1 from T3, T2 where T2.id = T3.id and T2.text = T3.text )
and T1.kateg = 'TPD'
; I know that this is not the question you have asked (I cannot answer that) but it is something you should fix.
|
|
|
Re: which Trigger?? [message #641103 is a reply to message #641100] |
Mon, 10 August 2015 10:13   |
cookiemonster
Messages: 13966 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
That's actually really vague. Triggers are linked to actions performed in the screen. Your description doesn't really make clear what actions should cause this check to happen.
|
|
|
Re: which Trigger?? [message #641138 is a reply to message #641103] |
Tue, 11 August 2015 02:48   |
 |
palpali
Messages: 138 Registered: December 2014 Location: India
|
Senior Member |
|
|
Hallo JW Thank you very much for your Feedback. I followed as per your comment
Hallo CM,
Sry, for my unclear question. Actually, I do have master and 2 Detail blocks, and these detail blocks are activate and deactivate (for insert/update) as per if condition in WNRI in master block.
But, now, when both condition matched then, are both blocks are activate for insert/update, but in above block i can not display the respected data, that need to be display automatically and user are allowed to Input value for just one field.
I mean to say is: even if, the both condition matched but there are no value in the respective table fot that matched condition record then it should display other fields from the third table and user are allowed just to Input last value in the block.
As per attached fig1.: the case is, where the both blocks matched the condition and displayed data just in below block not in above blocks bcoz'there is no data for above block and in this case, the 4 fields should be display from Table3 and in the 5th field, user will insert new value and will saved in the respective table, i.e. table2.
Any idea or Suggestion please? 
Thanking you in advance.
regards,
-
Attachment: 2.JPG
(Size: 42.68KB, Downloaded 1031 times)
|
|
|
Re: which Trigger?? [message #641148 is a reply to message #641138] |
Tue, 11 August 2015 04:04   |
 |
palpali
Messages: 138 Registered: December 2014 Location: India
|
Senior Member |
|
|
I have rewritten my query, which Returns those values which i do want to display in the block above when the condition matched.
SO, how and which Trigger should i apply to do this work?
declare
var1 number;
begin
select Count(*) into var1 from T1
where T1.id not in ( select 1 from T2, T3
where T2.id = T3.id and T2.cid = T3.cid )
and T1.text ='TPD'
and id = :control_blk.id;
if var1 = 1 then
select max(id), max(desp), max(Sub), max(det)
into :blk1.id, blk1.desp, blk1.sub, blk1.det
from T3 where exists (select 1 from T1
where T1.id = T3.id
and T1.cid = T3.cid
and T1.text in ('TPD')
and id = :control_blk.id
end if;
end;
please any Suggestion or help?
thank you all
|
|
|
|
|
Re: which Trigger?? [message #641152 is a reply to message #641151] |
Tue, 11 August 2015 04:41   |
cookiemonster
Messages: 13966 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
You need to think about this.
You want an operation to happen at a certain point. You know what that point is, we don't as your explanation is still vague on that point.
If it's when the user clicks into a particular record then use the appropriate WNRI
If it's when the user clicks into a particular record then use the appropriate WNBI
etc
|
|
|
|
|
|
|
Re: which Trigger?? [message #641174 is a reply to message #641172] |
Tue, 11 August 2015 08:31   |
cookiemonster
Messages: 13966 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Switch your brain on please.
A view is not a procedure.
Telling oracle that view is a procedure is guaranteed to give an error.
You need to actually write a procedure.
Examples can be found online.
|
|
|
|