Basic Stored Procedure Help - Not Returning Data
721872Sep 10 2009 — edited Sep 11 2009Hello 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;