Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Basic Stored Procedure Help - Not Returning Data

721872Sep 10 2009 — edited Sep 11 2009
Hello All:

To be fair, I come from a SQL Server environment and have never written anything for PL/SQL / Oracle before, this is my first attempt, so if anything is better or more efficient, please let me know. The immediate problem I am having is, I have the Stored Procedure below, and all I want to do is return the data in the table, so that I can fill my DataSet in code. But when I run the code against this stored procedure, it always brings back no data (if I simply do a standard "SELECT * FROM lkAllocation", I get the results, so I know data is there and the connection is good). If run the procedure in my window in Oracle SQL Developer (call PAYSOL.spallocationselectall();), my results window shows no data as well. What is wrong with this Store Procedure?


create or replace
PROCEDURE spAllocationSelectAll IS
AllocationID Integer;
AllocationName Varchar2(50);

BEGIN
AllocationID := 0;
AllocationName := '';

SELECT
AllocationID,
AllocationName
INTO
AllocationID,
AllocationName
FROM
lkAllocation
ORDER BY
AllocationName;
EXCEPTION
WHEN NO_DATA_FOUND THEN
NULL;
WHEN OTHERS THEN
-- Consider logging the error and then re-raise
RAISE;
END spAllocationSelectAll;
This post has been answered by Hoek on Sep 10 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 9 2009
Added on Sep 10 2009
7 comments
870 views