PROCEDURE : PROCEDURE save_coded_data ( in_hash VARCHAR2, in_data VARCHAR2, in_masked VARCHAR2, out_result OUT INTEGER ) AS l_sk INTEGER; BEGIN SELECT COUNT INTO l_sk FROM coded_data WHERE hash = in_hash; IF l_sk = 0 THEN INSERT INTO coded_data ( hash, data, masked ) VALUES ( in_hash, in_data, in_masked ); ELSE raise_application_error(-20000, 'Such card already is registered!'); – UPDATE coded_data SET – data = in_data, – masked = in_masked – WHERE hash = in_hash; END IF; out_result := l_sk + 1; END save_coded_data; END CD_PAYM_PROCESING_PKG; |