/* Formatted on 2013/08/11 18:46 (Formatter Plus v4.8.8) */ CREATE PROCEDURE p_get_name ( p_empno IN OUT NUMBER, p_name OUT VARCHAR2, p_err OUT NUMBER [code].......
Note:- I want to print ename and salary of emp using empno as a input but i dont want to declare extra variable for salary , i want to print salary using empno but when i execute this procedure. It gives value of empno in salary. Don't Know Why , how can i print salary of emp using empno as input without declaring extra variable for salary.
want to create a PL/SQL procedure, update_id(id_emp in number), that gives a new id_emp (id_emp=y) to an existing employee (id_emp=x).So before updating the EMP table, we have to :
1- create a new row on EMP(with id_emp=y) that has the same informations of the employee (id_emp=x), 2- update all tables that contains the id_emp column (update <TAB> set id_emp=y where id_emp=x), 3- delete employee (id_emp=x).
The problem is in step 2 : it creates a lot of locks and makes the DB unusable.To deal with this problem, I thought for many solutions, but the problem is how to implement them correctly and efficiently.
Before executing step 2, we have to ensure (through a marker I guess) that all the tables that have the id_emp column, are managed by our session, and any other acces (through SELECT, UPDATE, DELETE, INSERT statment) from another session will be rejected since we have a marker on that table.
When step 2 ends, we release all the tables from the markers.
I'm trying to get employee hire anniversary between 2 days ago and within 7 days from today..It's working fine until I get to January system month (then mm=01, which is less then mm=12)
select employee_id, first_name, last_name, job_id, hire_date, case when (to_number(to_char(hire_date,'mmdd'),'9999')) = (to_number(to_char((sysdate-2), 'mmdd'), '9999')) then 'Day before yesterday' when (to_number(to_char(hire_date,'mmdd'),'9999')) = (to_number(to_char((sysdate-1), 'mmdd'), '9999')) then 'Yesterday' when (to_number(to_char(hire_date,'mmdd'),'9999')) = (to_number(to_char((sysdate), 'mmdd'), '9999')) then 'Today' when (to_number(to_char(hire_date,'mmdd'),'9999')) = (to_number(to_char((sysdate+1), 'mmdd'), '9999')) then 'Tomorrow' [code]....
i have an employee table where there is a column called join date. Now i have to select the employee according to the days. Means how many employee joined on Monday/Tuesday etc.
I have to implement a functionality in my application. I have an employee table and each employee does a transaction which is stored in a transaction table.
The functionality that I have to implement is that if an employee does not perform any transaction for a period of 2 years then updated the employee and set him inactive.
first table employees emp_no pk emp_name emp_salary emp_hiredate emp_birthdate ------------------- second table sanctions sanc_id sanc_name emp_no fk
i need the following
if employees take sanctions and his salary 1000 and sanctions value 50 then the net salary is 950 . I need if the same employee take another sanctions values 50 the result will be the old net salary is 950 and the new old salary is 900
Employee Table ============== create table empoyee ( empno number, sal number) insert into employee(empno,sal) values (1, 200);
[code]...
If we make any update in Employee table for his/her salary, before update, that record should be inserted into EmployeeHist table and history will continue to build. Employee Table should have only current salary.If we change sal for emplyee # 1 from 200 to 800 then original current record in employee table will be inserted into employeehist table like
We need some transformation rules on Source employee table which comes from SAP and want to load in Target table.Basic idea is we need to calculate time when position was not held by sub owner so . . . Etc
I have four employee types such as 'C' for consultants, 'S' for staffs, 'W' for workers ,, ('E','S','W') for all types of employees. i have write four queries for showing four types of employees. can it is possible in a single query.
I have written this in oracle forms . I have taken a list item for workers i have taken 'W' , for staffs i have taken 'S' , for consultants i have taken 'C' and for all i have taken 'A'. my column name is emp_type in( :block.list_item ) but it is not taking the value from the list item when the value is emp_type in('C') etc etc..
like this for workers ,staffs . when it is 'A' it will take emp_type in ('E','S','W')
I would like to update the particular employee name by using the cursor ..For that I would like to show the steps which I did . as in the below screen it updated John but it removed the other ename ...I like to update John only and remaining ename should be as it ..
The code which I have written on KEY-COMMIT is below.
I am having one table Employee. Employee table having 50 records. I want to fetch 5 records every timeone the query is executed. But it should be like below.
1-5 records 6-10 records 11-15 records 16-20 records 46-50 records
I have employee interface table something like this.
emp_idemp_name Job_title supervisor_name 1AJ Engineer BJ 2CK Analyst ND 3BJ Manager TR 5TR VP IT JD 6ND S Manager MD 7MD VP Telecom SK 8SK VP Eng JR
I want to idenitfy the VP for each employee. The logic I have to apply is check for hte supervisor of each employee to see if the supervisor has designation starting with 'VP'. If no, I have check the supervisor of the supervisor and so on. I tried using a recursive query using connect_by_root but in the above example for employee ND it lists the VP as both MD and SK. I need it to show on MD who is the lower in the hierarchy.
I am a Java person but since my app uses the Oracle DB I am to do this task.
I have a requirement that I need to create a report for absent employee, we have "Hand Punch" scanning system for attendance, when a employee scan his hand it put a record with the employee id, date, shift, & time.
Now I need to create a report for absent employees in date range
EMP_ID EMP_NAME MANAGER_ID 1 KING 2 STEVE 1 3 FRANK 2
What I want is when I query for any EMP_ID, I want to get all his manager first, and the last record is the employee in leaf of the hierarchy in the query.
For example, when I query for EMP_ID=2 ,I want to get this result
EMP_ID EMP_NAME MANAGER_ID 1 KING 2 STEVE 1
and when I query for EMP_ID=3 ,I want to get this result:
EMP_ID EMP_NAME MANAGER_ID 1 KING 2 STEVE 1 3 FRANK 2
EMPLOYEEIDNUMBER(12,0) PUNCHDTM DATE TIMEZONEIDNUMBER(12,0)
I want to return any results where any employee id that has 2 different timezoneid's on the same date. I would actually like, if its possible, to select these entries to display on one row per employee per day. So for example
I'm trying to create a trigger so that whenever a record in the Employee table is deleted, a trigger will automatically delete corresponding records in the Job History table, then the Employee record is archived to EmployeeArchive before it is deleted. It compiles but with warnings. Here's what I've got.