<?xml version="1.0" encoding="utf-8" ?> 
<TemplateProc>

<Script>
  <![CDATA[
BEGIN 
EXECUTE IMMEDIATE '
CREATE OR REPLACE PROCEDURE %%ProcName%%
(
	Cur OUT		WFPORTAL.Cursor
)
AS
StoO_selcnt	INTEGER;
StoO_error 	INTEGER;
StoO_rowcnt	INTEGER;
StoO_crowcnt	INTEGER := 0;
StoO_fetchstatus	INTEGER := 0;
StoO_errmsg	VARCHAR2(255);
StoO_sqlstatus	INTEGER;
	BEGIN
	OPEN Cur FOR
	SELECT %%Campos%%
	FROM %%TableName%%;
	StoO_rowcnt := SQL%ROWCOUNT;
	EXCEPTION
		WHEN NO_DATA_FOUND THEN
			NULL;
		WHEN OTHERS THEN
			StoO_error := SQLCODE;
			StoO_errmsg := SQLERRM;
			RAISE_APPLICATION_ERROR(SQLCODE, SQLERRM,TRUE);
	END;
';
END;
]]></Script>

</TemplateProc>