Hi
I have written a script .The script runs properly if i write sql queries .But if i use PLSQL commands of BEGIN if end if , end ,then on running the script the comamds are getting printed on the prompt .
Ex :temp.sql
[define emp_no = &empno
select * from emp where empno = &emp_no;
ACCEPT i_sum PROMPT 'Do you want the total sal of all emp? (y;n): ';
BEGIN
IF UPPER('&i_sum') = 'Y' THEN
select sum(sal) from emp ;
END IF;
END ;
]
After connecting to the databse at the sql prompt i type @temp.sql .
The fisrt query runs properly .
But the code from BEGIN to END doesnt run it just dispalys on sql prompt .
Please suggest what am i missing .