In DemoGrid demo, how to commit into Database in datasource ('EMPLOYEES1')? Add commitEmployee, but failed to commit into DB. procedure commitEmployee is begin api_datasource.doCommit('EMPLOYEES1'); adjustPaging; end; Please help. Tks/Ron Lee
asked 31 Oct '12, 18:32
The "EMPLOYEES" datasource definition that is used in this demo is based on query(since departments and employees needs to be joined in this example) , it's not possible to perform insert/update/delete on datasources which is created from query based datasource definitions. In order to perform insert/update/delete on a datasource, it should be created from a datasource definition based on a table or view.
Therefore, to achieve your request;
1- Define a view named "EMP". This view will be used by the "EMPLOYEES" datasource definition
2- Open "EMPLOYEES" datasource definition, select "View" from "Based On" section and select "EMP" from the combobox. Tick "Delete", "Insert" and "Update" checkBoxes to grant necessary DML permissions.
3- Expand "Columns" node from the tree and select DEPARTMENT_NAME column. Uncheck checkBoxes labeled "Updatable" and "Required".
Hope this helps, Ibrahim
Ensure that in your datasource there is a primary key defined, all three checkboxes (insert, update, delete) are checked. There is nothing more to do to post changes. The call to doCommit is enough.
answered 01 Nov '12, 01:59