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,exceptions?
Please clarify me
6 1248
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,exceptions?
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()
...
|
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...
...
|
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...
|
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...
|
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...
|
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...
|
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...
...
|
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...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
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
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
| |