|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
How to execute query without save window??
Hi
I have simple forms application, there is 2 forms: Insert with button search Search witch button modify I want to pass id from search to insert form thru :GLOBAL.id. I solve this by on trigger in modify button I set global and call_form('insert') and exit_form. It switch to insert form. In insert form I use two triggers: 1. pre-form to pass global var to :insert.id(query criteria) 2. when-new-form-instance I use go_block('insert') and execute_query; After that it open window with text: "Save changes..", I ask yes and it fires full scan query, it retrive all records. How execute query and achive desired results - only one record and modify then and commit?? |
|
#2
|
|||
|
|||
|
Remove the line of code that set the :insert.id in the pre-form trigger. Create a pre-query trigger on the 'insert' block with the following:
--be sure to default the :global.insert_id in the when-new-form-instance or pre-form trigger. IF :global.insert_id IS NOT NULL THEN --or <> 'DEFAULT' etc :insert.id := to_number(:global.insert_id); END IF; This should return only the record you are looking for. To make subsequent queries, rmember to restore :global to it's default after that first query so this code does not fire on every query. If you are then making changes to the record returned programmatically, you may want to change your when-new-form-instance trigger as follows: go_block('insert'); execute_query; IF :insert.id = :global.insert_id THEN --manipulate data here commit_form; END IF; |
|
#3
|
|||
|
|||
|
Thank you for anwer it helps but form was commited automaticly. Is there a possibilities to fetch record and do nothing, only query. Now it's working
|
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > How to execute query without save window?? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|