PLSQL Ref cursor
450866Aug 23 2005 — edited Aug 26 2005Hi,
I need a little help on Ref Cursors. I have a Stored Procedure that has 3 parameters 1 INPUT and 2 OUTPUT. Of these Output parameters one is a Ref Cursor. All the procedure does is select the required field from a table based on the Input parameter and returns the result as a Ref Cursor. The field in question is of type LONG.
The front end used is Dot Net and the developers face a problem while accepting the ref cursor as it gives an error :
ORA-01406 fetched column value was truncated
Cause: In a host language program, a FETCH operation was forced to truncate a character string. The program buffer area for this column was not large enough to contain the entire string. The cursor return code from the fetch was +3.
Action: Increase the column buffer area to hold the largest column value or perform other appropriate processing.
I have tried passing LONG instead of a Ref Cursor but the same error is encountered.
Sample Code for reference:
TYPE g_ref_cur IS REF CURSOR -- This has been already defined in the package body.
PROCEDURE pro_A (
p_In_Param VARCHAR2,
p_Cur_HT OUT g_ref_cur,
p_ErrMsg OUT Number)
IS
--Some declarations
BEGIN
--There are the some other checks prior to this.
OPEN p_Cur_HT
FOR
SELECT t_Col_2
FROM table_Text
WHERE UPPER(t_Col1) = UPPER(p_text);
p_ErrMSg:= 0;
--Exception Handling done here
END pro_A;
-- End of Sample Code
I can't understand the problem. Can some one kindly help me?
Thanks in advance,
Regards,
Swarna Dev