Home » SQL & PL/SQL » SQL & PL/SQL » for loop
for loop [message #212166] Thu, 04 January 2007 01:40 Go to next message
ishika_20
Messages: 339
Registered: December 2006
Location: delhi
Senior Member
hello all

through for loop i want to get values by date.

my query is

begin
for i in to_number(to_char(to_date('&date1, 'dd/mm/yyyy), 'j'))..to_number(to_char(to_date('&date2, 'dd/mm/yyyy), 'j'))

loop
dbms_output.put_line(to_date(i,'j'));
end loop;
end;

but i m getting error which i unable to understand.
though i changed it to number.

begin
*
Error at line 1
ORA-01858: a non-numeric character waqs found where a numeric was expected
ORA-06512: at "SYS.Standard", line 220
ORA-06512 at line 2

please make me understand about my mistake.
what i had done wrong.

regards
ishika
Re: for loop [message #212170 is a reply to message #212166] Thu, 04 January 2007 02:15 Go to previous message
Frank
Messages: 7880
Registered: March 2000
Senior Member
to_date('&date1, 'dd/mm/yyyy), 'j'))

You miss a closing quote after &date1 and after yyyy
Previous Topic: External Tables
Next Topic: Shell script to submit program to change password (FNDCPASS)
Goto Forum:
  


Current Time: Sat Dec 03 20:25:57 CST 2016

Total time taken to generate the page: 0.24890 seconds