HELP with SP !!
Posted in 1995
I am receiving error -229: Could not open or create a temporary file
on the "where" clause for a SP that follows:
*******************************************************************************
drop procedure chk_usid;--
create procedure chk_usid
(IN_SBM_PROC_CNTR smallint,
IN_YEAR_NUMBER smallint,
IN_SCN_JULIAN_DT smallint,
IN_CAP_CMP_CD smallint,
IN_CONTAINER_NUM int,
IN_SEQUENCE_NUM smallint)
--
define p_cnt int; define sql_err_num int;
define sql_err_txt int;
--
on exception in (-691)
set sql_err_num,sql_err_txt
end exception
--
select count(*)
into p_cnt
from submission
where SBM_PROC_CNTR_num = IN_SBM_PROC_CNTR;
if p_cnt > 0 then
raise exception -691,0,
'related_tin insert: no matching record found in submission; RI violation.';
end if
end procedure
document
'Usage: sbm_proc_cntr_num, year_number, scanned_julian_dt, capture_comp_cd, con
tainer_seq_num, sequence_number'
with listing in '/tmp/SPL/chk_usid.warnings';
*******************************************************************************
If I change the where clause to "where SBM_PROC_CNTR_num = 1", the procedure
is created. But that's not what I want, I want to have a insert trigger calls
this procedure to verify the value of IN_SBM_PROC_CNTR exists in table
submission (RI stuff).
Please response and thanks in advance !
Diana Li (li@lfs.loral.com)