how to display result of execute immediate on sql prompt
I wish to create a dynamic select statement where i will give table name and where condition as input parameters at runtime. for this i created following procedure:
CREATE or replace PROCEDURE select_rows (
table_name IN VARCHAR2,
condition IN VARCHAR2 DEFAULT NULL)
AS
where_clause VARCHAR2(100) := ' WHERE ' || condition;
BEGIN
IF condition IS NULL THEN where_clause := NULL; END IF;
EXECUTE IMMEDIATE 'select * FROM ' || table_name || where_clause;
END;
my procedure is successfully created.
my problem is how to get select stmt output at screen (sql prompt)
or how to spool the output in a file.
plz. help me. I am learning oracle .
thanx in adv.
Mani