Subject | Re: [ib-support] Stored Procedure |
---|---|
Author | Svein Erling Tysvaer |
Post date | 2002-11-29T15:14:56Z |
Ajay,
a guess from a fellow inexperienced SP programmer. My guess is that
Contacts initally contains NULL and since unknown || string still is
unknown, nothing ever get assigned. Try adding Contacts = '' before your
FOR SELECT.
Set
At 20:09 29.11.2002 +0530, you wrote:
a guess from a fellow inexperienced SP programmer. My guess is that
Contacts initally contains NULL and since unknown || string still is
unknown, nothing ever get assigned. Try adding Contacts = '' before your
FOR SELECT.
Set
At 20:09 29.11.2002 +0530, you wrote:
> 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 ; ^