|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 10/10/2007 1:54:00 AM
Posts: 7,
Visits: 1
|
|
Hi
Iam unable to extract the CHAR value for the variable D_SYMP when used in the cursor but with a integer variable it works fine.
REPLACE PROCEDURE SP_SYMP(OUT V_SYMP VARCHAR(2000)) BEGIN DECLARE D_SYMP VARCHAR(2000) ; FOR SYMCUR AS C_SYM CURSOR FOR SELECT SEQ_ID, SYMP_CAT||'-'||SYMP_NM AS SYMP FROM SIDE_EFFS DO SET D_SYMP = D_SYMP || SYMCUR.SYMP; END FOR; SET V_SYMPTOM = D_SYMPTOM; END;
Please help me, if iam missing something.
Thnx Sony
|
|
|
|
|
Supreme Being
      
Group: Forum Members
Last Login: 8/24/2008 2:47:14 PM
Posts: 425,
Visits: 398
|
|
D_SYMP is initially NULL
and when you have NULL || "anything" it gives you NULL not "anything"
so you never get anything out !!
That's probably what happened in your case ...
you can declare the variable to have a default value of '' (empty string, not NULL)
DECLARE D_SYMP VARCHAR(2000) DEFAULT '' ;
|
|
|
|