SunQuest
           Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old May 26th, 2004, 08:13 AM
Tomasz Morus Tomasz Morus is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 20 Tomasz Morus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m 28 sec
Reputation Power: 0
Send a message via ICQ to Tomasz Morus
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??

Reply With Quote
  #2  
Old May 26th, 2004, 10:09 AM
Kraeg Kraeg is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Location: Schaumburg, IL
Posts: 20 Kraeg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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;

Reply With Quote
  #3  
Old May 26th, 2004, 10:24 AM
Tomasz Morus Tomasz Morus is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 20 Tomasz Morus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m 28 sec
Reputation Power: 0
Send a message via ICQ to Tomasz Morus
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > How to execute query without save window??


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway