Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle Stored Proc returning null

Re: Oracle Stored Proc returning null

From: Maxim Demenko <mdemenko_at_arcor.de>
Date: Tue, 04 Jul 2006 11:11:24 +0200
Message-ID: <44aa3227$0$26266$9b4e6d93@newsread2.arcor-online.net>


Terren schrieb:
> I am a total noob when it comes to stored proces in oracle. I created
> this stored proc but it is returning null. It is just supposed to join
> all the records into one string. And I cannot use a function
>
>
> Procedure SPECIFIEDMOTORVALUE
> (V_POLICY_KEY IN VARCHAR2,
> V_SECTION_KEY IN NUMBER,
> V_SUBSECTION_KEY IN NUMBER,
> V_ITEM_SEQ IN NUMBER,
> V_EQUIPMENTDESC OUT VARCHAR2) IS
>
> V_TEMPDESC VARCHAR2(2000);
>
> CURSOR CUR_SPECMOTOR IS
> SELECT MTS_DESCRIPTION
> FROM MOTORSPECIFIED
> WHERE MTS_POLICY_CDE= V_POLICY_KEY AND
> MTS_SECTION_CDE = V_SECTION_KEY AND
> MTS_SUBSECTION_CDE = V_SUBSECTION_KEY AND
> MTS_ITEM_SEQ = V_ITEM_SEQ;
>
> BEGIN
> FOR REC_SPECMOTOR in CUR_SPECMOTOR LOOP
> V_TEMPDESC :=V_TEMPDESC + ', ' +
> REC_SPECMOTOR.MTS_DESCRIPTION;
> END LOOP;
>
> V_EQUIPMENTDESC := V_TEMPDESC;
>
> EXCEPTION
> WHEN OTHERS THEN
> V_EQUIPMENTDESC :='';
> END;
>

In the first step of debugging i would cut the exception block, to see actual errors if they occur.
In the second step the first step could have me hinted, that in SQL/PL SQL the string concatenation operator is probably not "+", but "||".

Best regards

Maxim Received on Tue Jul 04 2006 - 04:11:24 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US