pl/sql program to copy [message #322090] |
Thu, 22 May 2008 08:27 |
|
amritaseema
Messages: 47 Registered: January 2008
|
Member |
|
|
Hi All...
i need some help....
here i tried to write a pl/sql program to copy all emp table records whose salary is greater than 2000 to another table
can you please check the code...
its showing error...
ORA-01422: exact fetch returns more than requested number of rows
actually i knew this error is showing beacue of the into
but i am unable to resolve it....
can you please help me out...
DECLARE
v_sal employees.salary%TYPE;
v_emprec employees%ROWTYPE;
BEGIN
SELECT *
INTO v_emprec
FROM employees;
IF v_sal > 2000
THEN
INSERT INTO employees_copy
SELECT *
FROM employees
WHERE salary > 2000;
END IF;
END;
thanks in advance
Seema
[Updated on: Thu, 22 May 2008 08:27] Report message to a moderator
|
|
|
|
|
|