Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1167
  • Last Modified:

Check Box event in Oracle forms

I am new to oracle forms
I am trying to add a check-box event in a from built using table X. And my check-box is a non-database item that is not present in table X.

Now when checked it should enter a record into a Y table. If that event is in table Y it should be checked on post-query trigger.
Similarly when unchecked it should delete a record from table Y

And also I need to check a variable x1='.....' in table x that has to check with variable y1='.......' from table Y.

If the question is not clear then let me know..
0
r211
Asked:
r211
  • 4
  • 2
1 Solution
 
flow01Commented:
What is your question ?

What do you want to happen when  the check in the post-query is false ?
0
 
r211Author Commented:
Post-Query trigger to check if the event is in the table when check box is checked

I wanted to know how to write those requirements in when-checkbox changes trigger. How to write it when it is using a table Y apart from using table X as object.
0
 
flow01Commented:

a hint how it might look

when checkbox changed

begin
  if  :yourblock.checked = 'Y'
    insert into Y
      (col1, col2, ....)
    values
      (:yourblock.keyvalue1,  'fixedvalue2', ...);
  else
   delete from Y where col1 = :yourblock.keyvalue1;
end;


post_query

   begin
      select 'Y' into :yourblock.checked
      from Y where col1 = :yourblock.keyvalue1;
  exception when no_data_found then
      :yourblock.checked := 'N';
  end;
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
r211Author Commented:
Thank you...
0
 
r211Author Commented:
Thank you so much for your help...it worked...
0
 
r211Author Commented:
I have few more questions related to this question...

In X table on which the form was built contains 15 rows in which evt_name is the primary key

In Y table on which the check-box created has only 2 rows in which evt_name is the foreign key to this table.

Now I can insert or delete only one row that is present in both the tables. How can I insert other events that are not in table Y but present in table X
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now