Hello,
I executed sql file with parameters (anonymous block with many with clauses) in sqlplus:
@sqlFile.sql '11/06/2014' '11/07/2014'
sqlFile.sql :
var start_date varchar(11) := '&1';
var end_date varchar(11) := '&2';
BEGIN
dbms_output.put_line('start ' || '&1');
dbms_output.put_line('end' || :end_date);
with findDates as
(
select d.date
from dates d
where d.date > :start_date && d.date < :end_date
)
select * from findDates;
END;
/
In put_line for start_date value were changed - I saw old and new log in console.
For end_date I got error: Bind variable "end_date" not defined.
Is my syntax for variables in with clause correct? Why my variable are not visible for sql code?