create or replace
PROCEDURE showb62rep(
	id_in IN polynomial.pn_key%TYPE
 )
IS
	value1     string(15);
	value2     string(15);
	linestr    string(20);
	lineno     integer;

	CURSOR cr_repeat_pn IS
		SELECT  to_char(pn_value,'S0.99999EEEE'),
			to_char(0,'S0.99999EEEE')
		FROM PN_Data
                WHERE key = id_in
                ORDER BY row_key;

BEGIN
	DBMS_OUTPUT.enable(1000000);

	IF NOT cr_repeat_pn%ISOPEN THEN
		OPEN cr_repeat_pn;
	END IF;

	FETCH cr_repeat_pn into value1, value2;
	lineno := -1;

	WHILE cr_repeat_pn%FOUND
	LOOP
		linestr := 'B062F15-16 ';
		if( lineno < 0 ) then
			DBMS_OUTPUT.PUT_LINE('#              Polynomial coefficients:');
			DBMS_OUTPUT.PUT_LINE('#              i, coefficient,  error');
		end if;
		lineno := lineno + 1;
		DBMS_OUTPUT.PUT_LINE(linestr || to_char(lineno,'9999') ||' '|| value1 || ' ' || value2);
		FETCH cr_repeat_pn into value1, value2;
	END LOOP;
	close cr_repeat_pn;
END;
