How to create a procedure in oracle 10g to fetch an entire row
posted 2 years ago
I am new to Pl/SQL. I want to create a procedure which will take employe id as parameter and fetch entire row with 7 columns. I tried using the below code but it gives error "Invalid Identifier" when i try to execute it. please tel me how to go about it.
In PL/SQL, you cannot just select from a table. You need to somehow process the result of the select. In your case, you'll probably want to store it in a variable that can hold the entire row of the MYADMIN table.
Furthermore, there's no need to use dynamic SQL (the execute immediate) in this case. And if you do, you need to process bind variables correctly. The 'Invalid identifier' error is probably caused by including the empid variable in the command text.
So the procedure with the above suggestions incorporated would probably look like this: