Jú, td well?
I tested all cases here again and OK, as below:
Select all
variable v_planta varchar2(50);
-- sem aspas simples no &1
execute select &1 into :v_planta from dual;
-- valor passado para &1: to_date('01/01/2000','dd/mm/rrrr')
select :v_planta from dual;
-- segundo caso
SQL> variable vdatainicio varchar2(20);
SQL> execute select '01-' || to_char( add_months(sysdate,-1),'MON-YYYY') into :vdatainicio from dual
;
PL/SQL procedure successfully completed.
SQL> select :vdatainicio from dual;
:VDATAINICIO
--------------------------------
01-JAN-2009
SQL>
-- terceiro caso
SQL> variable vdatafim varchar2(20);
SQL>
SQL> execute select to_char(last_day(add_months(sysdate,-1)),'DD-MON-YYYY') into :vdatafim from dua
l;
PL/SQL procedure successfully completed.
SQL> select :vdatafim from dual;
:VDATAFIM
--------------------------------
31-JAN-2009
SQL>
SQL>
Can you test there again in this way?
If it does not matter, we would have to check maybe something in your environment there.
later, if it does not work, go to us your environment to test in the same scheme, can it be?
Bjaum,