Subject Stored Procedure
Author Ajay
I am New to stored procedure . I tried Compiling this Procedure in IBConsole it Compiles properly but returns Null when i pass any parameter, there are records with the first name .

set term ^ ;
alter PROCEDURE ORDER_LIST
(DRID Char(1000))
RETURNS (Contacts VarCHAR(1000))
AS
Declare Variable Contact Varchar(1000) ;
BEGIN
FOR SELECT First_Name FROM Cust_Contacts,DR_Contacts
Where Cust_Contacts.Cont_ID = DR_Contacts.Cont_ID
and DR_Contacts.DR_ID = : DRID
INTO :Contact
DO
Begin
If (Contacts = '') then
begin
Contacts = :Contact ;
end
else
begin
Contacts = : Contacts || ',' || : Contact ;
end
end
END ^
set term ; ^


[Non-text portions of this message have been removed]