Answer the question
In order to leave comments, you need to log in
Why doesn't a function returning data from a table work (PL/SQL: numeric or value error: character string buffer too small)?
Hello! Please help me understand this situation:
In general, a package is written with a function that returns data from a table:
1. Package specification:
CREATE OR REPLACE PACKAGE z_026_TEST_blk AS
TYPE MEASURE_RECORD IS RECORD(l_CODE varchar(10), T_ID number, T_CODE varchar(10), T_NAME varchar(10), B_NFIRE number, B_LONGNAME varchar(10), B_EXEC_COND varchar(10));
TYPE z_026_blkoper IS TABLE OF MEASURE_RECORD;
FUNCTION GET_blk(l_operblk varchar2) RETURN z_026_blkoper
PIPELINED;
END z_026_TEST_blk;
CREATE OR REPLACE PACKAGE BODY z_026_TEST_blk AS
FUNCTION GET_blk(l_operblk varchar2) RETURN z_026_blkoper PIPELINED IS
rec measure_record;
BEGIN
select S.CODE, T.ID, T.CODE, T.NAME, B.NFIRE, B.LONGNAME, B.EXEC_COND
COLLECT INTO rec
from SCEN T, SC_BLK B, BDSCR S
WHERE T.ID = B.ID
AND T.NORD = B.NORD
AND T.ID = S.ID
AND t.ARCFL = '0'
AND s.CODE = l_operblk
ORDER BY T.NAME, B.NFIRE;
RETURN;
END GET_blk;
END z_026_TEST_blk;
SELECT z_026_TEST_blk.GET_blk('ACC_GL') FROM DUAL
SELECT * FROM table(z_026_TEST_blk.GET_blk('ACC_GL'));
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
Answer the question
In order to leave comments, you need to log in
Well, it looks like the field in the record is not enough to receive the value passed to it. And it seems that there is a transfer of a non-string value to a string.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question