Hi,
I am suppose to generate a spool file, which takes two parameters
1. txt file the file where spooled data to be stroed
2. S or C where S=space C=Concate(Pipe symbol) this is the value/data separator i am passing at run time
the execution command is like this.
SQL> @spool.sql data.txt C
I have written spool.sql file like this.
--------------------------------------------------
set header off;
set feedback off; ect......
spool &1
variable v_input varchar2(2);
begin
if &2='S' then
:v_input:=' ';
else
:v_input:='|';
end if;
end;
/
select empno|| :v_input || ename || :v_input || sal ||:v_input || hiredate from emp;
spool off;
when i run the execution command, getting error like.
identifier 'S' must be declared.
please suggest me am i doing any thng wrong here.