Posted By:
Mathew_Vipin
Posted On:
Monday, October 1, 2001 02:31 AM
The general escape syntax for standard SQL date columns is: {d 'yyyy-mm-dd'} For literals: String sSQL = "SELECT colName FROM aTable " + "WHERE colDate = {d '2001-10- 21'}" For variables ( note that toString() is implicitly called on the date variable ): java.sql.Date jsqlDate; ... // set date String sSQL = "SELECT colName FROM aTable " + "WHERE colDate = {d '" + jsqlDate + "'}" i am using oracle 8.0 and not 8i and i can't get records using this
More>>
The general escape syntax for
standard SQL date columns is:
{d 'yyyy-mm-dd'}
For literals:
String sSQL =
"SELECT colName FROM aTable " +
"WHERE colDate = {d '2001-10-
21'}"
For variables ( note that toString() is
implicitly called on the date
variable ):
java.sql.Date jsqlDate;
... // set date
String sSQL =
"SELECT colName FROM aTable " +
"WHERE colDate = {d '" + jsqlDate + "'}"
i am using oracle 8.0 and not 8i
and i can't get records using this
query.
i have inserted
java.sql.date and accessing record
is not possible now. i tried with
java.sql.date as well as string.
The query is executing but no
records r selected. In oracle, date
field is seen as :
31-JAN-01
.
I tried the above format also which gives an exception
as:
invalid character
.
Pls. help me find
out the records on a specified date.
<<Less