Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Searching All the Tables for a Value

Status
Not open for further replies.

ksr

MIS
Jul 3, 2001
11
IN
I have a number of tables in the Salary Database. I want to modify the Salary of some employees. Is is possible through SQL, to search each table for the existence of Employee, say, ECode= 453. Incase the Employee exists, disable the constraints applicable on the table, modify his Basic Salary, DA & HRA and then enable the constraints. Can you help me out in accomplishing the above task.
 
KSR,

Yes, it is certainly possible to write code that searches multiple tables for specific values, but before I randomly suggest such code, please help me understand a few things:

1) Why might you need to look in multiple tables for the "Basic Salary, DA & HRA" for a specific employee? Shouldn't "Basic Salary, DA & HRA" appear in one table for all employees?

2) Why would you need to "disable the constraints applicable on the table"? Is modifying "Basic Salary, DA & HRA" something that breaks the business rules that you enforce in your table constraints?

3) What do "DA & HRA" stand for?

[santa]Mufasa
(aka Dave of Sandy, Utah, USA @ 15:38 (26Sep04) UTC (aka "GMT" and "Zulu"), 08:38 (26Sep04) Mountain Time)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top