473,386 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How do i avoid re-minising the value through a button when i click ?

Hello
I have problem with the following table
For example i have two tables Stock,Income

stock table columns
Date,itemid,itemName,ItemType,Tons.

Income table columns.
Date,ITemid,itemtype,tons.

Now i want minus income.tons from stock.tons
by when-button-press trigger.
------------------------
Declare
Begin
UPDATE Stock set stock.tons=:stock.tons-:income.tons
where itemid=:income.itemid;
commit_form;
go_block('Stock');
execute_query;
go_block('income');
execute_query;
end;
----------------------------
the problem is when i click the button it minus income.tons from stock.tons, But when i click the button again It minus The same value and so on.

So how to provent to minus the same Record value from the same Record again and again,it should minus it once per record.

Send me the proper and complete CODE,
I really need it.
Thanks in advance.
Nov 16 '10 #1
1 1258
amitpatel66
2,367 Expert 2GB
Thats as expectd. You have included the update statement in Button-press trigger and every time a button is pressed, the update happens and is COMMITED.

In order to handle multiple updates, you will need to flag the record by using an additional Flag column, and before doing an update, just check the flag, if it is unflagged then update else don't update the stock table.
Nov 16 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: simonc | last post by:
I've been programming in assembler and C/C++ for a number of years, but I'm only just starting down the road of PHP & MYSQL. I have a couple of questions: (1) Before I start writing my own...
21
by: Stefan Richter | last post by:
Hi, after coding for days on stupid form validations - Like: strings (min / max length), numbers(min / max value), money(min / max value), postcodes(min / max value), telefon numbers, email...
1
by: Chris | last post by:
I need to monitor a bunch of files to see what is being opened, read, and closed, with no modifications being made. This is being done first on Windows machines, and later on Solaris. Looking...
6
by: Gregory L. Hansen | last post by:
I'm sure I saw this mentioned somewhere, but I can't find it. How can I dynamically allocate a multi-dimensional array in C++? My next question, if this gets figured out, is if I should use the...
35
by: Ross M. Greenberg | last post by:
I want to have an onUnload that runs only when the site is left, not when the current page is unloaded. Any ideas? Thanks! Ross
2
by: Toby Inkster | last post by:
Of course I could generate a unique boundary, use the base64_encode() function and do all the MIME-stuff myself, but I am trying to avoid re-inventing the wheel. Anyone know of a *good* PHP...
3
by: Michael Glaesemann | last post by:
Hello all, Recently I've been thinking about different methods of managing users that log into a PostgreSQL-backed application. The users I'm thinking of are not necessarily DBAs: they're...
6
by: Bob Kochem | last post by:
I am looking for a way via code to access all the menu itmes on a given form. I am looking for something like the Forms or Controls collections, but for menu items. Is there such a thing or method?...
95
by: hstagni | last post by:
Where can I find a library to created text-based windows applications? Im looking for a library that can make windows and buttons inside console.. Many old apps were make like this, i guess ...
4
by: Steve Potter | last post by:
I'm working on a project where I would like to some information in a table (database entries) but I would like to have some of the commonly associated functionality like being able to sort by...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.