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
6 1252
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!!
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.
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 !!!
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.
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'?
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.
Sign in to post your reply or Sign up for a free account.
Similar topics |
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.
|
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
|
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;
|
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;
|
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
| |
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])
|
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,
|
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>
|
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.
|
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,...
|
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...
| |
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,...
|
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |