Reputation: 1385
I have a table where an update is required in only column, it is just a flag to update.
But I have to show details from other table as well, that is only for display.
Table1:
emp_id
emp_name....
emp_status (will be updated via tabular forms)
Table2:
emp_bank_id
emp_bank_account
....
The records should be displayed in a report format and update the emp_status value to '1' (previously 0) where user has ticked the check-box, so multiple records will be updated
Can I create a view and then chose to update only this column using tabular form?
Upvotes: 0
Views: 367
Reputation: 1385
Solution that worked for me was, set the field as editable
, leaving the rest to be displayed as plain text in report.
Double click on the column under the tabular report region which you want to edit, set the field type as Simple Checkbox
for title Display as
under the section Column Attributes
Now, on same page under List of Values
, enter 1,0
1=> Checked
0=> Unchecked
And that is all one need.
Upvotes: 0
Reputation: 406
you can create the Tabular Form using the 2 tables without a view as long as only one of the tables is being updated.
Just create your Tabular Form choosing the table you need to update and then change the query to include the columns from the other table and change all the column from the included table to Plain Text.
If you prefer to use a view you should create an instead of trigger, like this:
CREATE OR REPLACE TRIGGER iof_MY_TRIGGER
INSTEAD OF UPDATE
ON v_tbls
FOR EACH ROW
BEGIN
UPDATE table1
SET emp_status = :NEW.EMP_STATUS
WHERE emp_id = :NEW.EMP_ID;
END iof_MY_TRIGGER;
/
To include a checkbox to your tabular form change your tabular form for something like this:
SELECT emp_id
, emp_name
, apex_item.checkbox2(5, emp_status, DECODE(emp_status, 1,'CHECKED',0))
FROM table1
You can read more about this in here
Upvotes: 1