473,657 Members | 2,690 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Clarify Me

ilikesuresh
47 New Member
Hi
i write a program in Pro *C to increase the salary of employees based on some constraints.
Its works fine and if i execute the program in the first time the salaries would be increased depending on the constraints.But if i execute immediately the second time, the updated values have been treated as a old value and again the salaries are incremented.Is there any specific way to ensure this if the update happens continuously on the second time the program or oracle through errors,exceptio ns?

Please clarify me
Oct 4 '07 #1
6 1252
amitpatel66
2,367 Recognized Expert Top Contributor
Hi
i write a program in Pro *C to increase the salary of employees based on some constraints.
Its works fine and if i execute the program in the first time the salaries would be increased depending on the constraints.But if i execute immediately the second time, the updated values have been treated as a old value and again the salaries are incremented.Is there any specific way to ensure this if the update happens continuously on the second time the program or oracle through errors,exceptio ns?

Please clarify me
Could you please POST the table structure, Constraints that you are talking about for my reference and any other related details!!
Oct 4 '07 #2
debasisdas
8,127 Recognized Expert Expert
If you are executing the command command 2 times it is bound to fire 2 times. If u want only once why are you executin that 2 times . The update command will fire every time you execute that and will reflect in the database table.
Oct 4 '07 #3
ilikesuresh
47 New Member
Could you please POST the table structure, Constraints that you are talking about for my reference and any other related details!!
LASTNAME Varchar2(20)
DEPTID Number(2)
SALARY Number
EMPID Number(3)
MGRID Number(3)
HIREDATE date

That is the table structure
and the constraints in the sense if the salary > 10000 and < 20000
salary = salary +1000
if >=20000 and <30000
salary = salry +2000

Thats all !!!
Oct 4 '07 #4
amitpatel66
2,367 Recognized Expert Top Contributor
LASTNAME Varchar2(20)
DEPTID Number(2)
SALARY Number
EMPID Number(3)
MGRID Number(3)
HIREDATE date

That is the table structure
and the constraints in the sense if the salary > 10000 and < 20000
salary = salary +1000
if >=20000 and <30000
salary = salry +2000

Thats all !!!
Every time you run the update, the salary will get incremented until it goes above 30,000. Once it reaches 30,000 the salary will not increment as per your constraints. Now if you want the update tp happen only once on each row, then you can have one more column as a flag which you can default to 'N'.

When updating salary, check for flag value. If 'N' then update the flag to 'Y' and the salary. If flag is 'Y' then dont update anything.
Oct 5 '07 #5
ilikesuresh
47 New Member
Every time you run the update, the salary will get incremented until it goes above 30,000. Once it reaches 30,000 the salary will not increment as per your constraints. Now if you want the update tp happen only once on each row, then you can have one more column as a flag which you can default to 'N'.

When updating salary, check for flag value. If 'N' then update the flag to 'Y' and the salary. If flag is 'Y' then dont update anything.
Thanks for Your valuable advice.But Is there any possiblities to hide the flag column from user view other than creating 'views'?
Oct 5 '07 #6
debasisdas
8,127 Recognized Expert Expert
Thanks for Your valuable advice.But Is there any possiblities to hide the flag column from user view other than creating 'views'?
No, you need to create views for that.
Oct 5 '07 #7

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

Similar topics

1
1521
by: wil smiths | last post by:
in applet, "jFrame" cannot be added into applet right? ( I tried it out , cannot work; so i'm using jPanel) in applet/application , there are 3 way program start to flow :: 1. void init() 2. void start() 3. create function inside constructor of class.
3
1214
by: Guhanath | last post by:
Dear All, Is dot.Net Framework processor based and mainly targetted at Pentium machines??Will it work in AMD Processor especially AMD Athlon 64 Processors. -- Guhan
2
1333
by: grahamo | last post by:
Hi, I have something that I'd like to clarify here.... there are two issues. I have simple dummy class called base which (everything is inlined just for readability) defines these methods... friend base operator+ (const base& lhs, const base& rhs) { base tmp;
7
2522
by: hugo.elias | last post by:
Hi all, I hope nobody minds me posting this question to this group, but I couldn't find any group closer to the Subject. Can anyone clear up where you draw the lines when dividing up an application into Model, View and Controller parts? For example: I have some classes: class FlatWorld;
2
1529
by: bissatch | last post by:
Hi, I am one of the many that get fed up with browser sniffing and cross platform issues. Is ECMAscript a new independant cross platform specification that can do loads of nice things that JavaScript can do? If so, is it well supported? If someone could give me brief overview of this that would be great, thanks
9
1341
by: javuchi | last post by:
I've been searching thru the library documentation, and this is the best code I can produce for this alogorithm: I'd like to return a dictionary which is a copy of 'another' dictionary whoes values are bigger than 'x' and has the keys 'keys': def my_search (another, keys, x): temp = another.fromkeys(keys) return dict( for k in temp.keys() for v in temp.values() if v>=x])
0
1045
by: Jean-Marc Blaise | last post by:
Hi, The following page http://www-1.ibm.com/support/docview.wss?uid=swg1IY63894 states at top of page that FP8a fixes the problem, and at the bottom "First fixed in v8.2 fp9". Could you clarify please ? Thanks a lot,
7
1967
ilikesuresh
by: ilikesuresh | last post by:
Hi i have written this program to find the file information using stat structure. When i try to display the mode it shows blank(nothing) where is the problem lies here.. clarify me... #include<stdio.h>
1
1520
ilikesuresh
by: ilikesuresh | last post by:
Hi, I am working as a ProC(solaris platform) developer in an reputed organization. I want to do some certificate courses that should increase my credentials. But i have no idea abt it. Please clarify me ,what kind of courses are there and which are them are suitable for my skill set.
0
8306
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8732
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7327
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4152
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1955
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1615
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.