Problem in executing stored procedure.
Posted in 1996
Hi Everybody,
I have some problem with the stored procedures. I would like to know if any of
you have faced this kind of problem with the stored procedure.
I have problems in executing a stored procedure on the informix database on my
machine, whereas the same stored procedure works on some other informix
database on another machine. My informix version is 7.12.UC1 and the informix
version on the other machine is 7.10.UC2. My machine is AIX-OS ( RS-6000) where
as the other machine is sun-sparce 10.
The stored procedure, upon execution, gives an error "Resulting string length
must be less than or equal to 255". I've got a char variable of length 3000
which I am returning from the SP.
Extract from the SP :-
CREATE PROCEDURE "sstm".g_wo_sm006a(
p_wo_no LIKE work_order.wo_no
)
RETURNING
VARCHAR(9,0),
VARCHAR(8,0),
.
.
CHAR(3000), -----> This is the return variable which causes the problem
CHAR(1);
DEFINE lvc_wo_no VARCHAR(9,0);
DEFINE lvc_ins_claim VARCHAR(8,0);
.
.
DEFINE lc_prob_desc CHAR(3000);
The above is the definition of the return variable.
DEFINE lvc_prob_desc VARCHAR(255,0);
..
..
Following is the piece of code I use to populate the variable, before
returning it from the SP. I populate it by concatenating fields from a table=
..
LET lc_prob_desc =3D "";
FOREACH
SELECT wd_prob_desc,wd_seq_no
INTO lvc_prob_desc,li_seq_no
FROM wo_prob_desc
WHERE wo_prob_desc.wd_no =3D p_wo_no
ORDER BY wd_seq_no DESC
LET lc_prob_desc =3D lvc_prob_desc || lc_prob_desc;
END FOREACH;
---------------------------------------------------------
Get Your *Web-Based* Free Email at http://www.hotmail.com
---------------------------------------------------------