can any one help me please

CREATE OR REPLACE PROCEDURE SelectProc
IS
DECLARE
ID PRODUCT.Emp_NO%TYPE;
Name PRODUCT.Full_Name%TYPE;
BEGIN
select Emp_NO,Full_Name into ID,Name from empTest;
END SelectProc;
|
Newbie Member
|
|
| 1Mar2009,13:56 | #1 |
|
I wrote this Procedure and I couldn't figers what is the problem
can any one help me please ![]() CREATE OR REPLACE PROCEDURE SelectProc IS DECLARE ID PRODUCT.Emp_NO%TYPE; Name PRODUCT.Full_Name%TYPE; BEGIN select Emp_NO,Full_Name into ID,Name from empTest; END SelectProc; |
|
Go4Expert Founder
|
![]() |
| 1Mar2009,18:40 | #2 |
|
Nor we can figure out unless you try to explain what you are trying to do.
|
|
Go4Expert Member
|
|
| 1Mar2009,18:55 | #3 |
|
hi, you cannot have DECLARE in your create procedure statement. Also it's not a good idea to use ID, NAME for variables because they are oracle reserved keywords. Here's the corrected code, it will work
Code:
CREATE OR REPLACE PROCEDURE selectproc
AS
l_ID product.emp_no%TYPE;
l_NAME product.full_name%TYPE;
BEGIN
SELECT emp_no, full_name
INTO l_ID, l_NAME
FROM emptest;
END selectproc;
/
|