last day (18 days later) » 

6:07 PM
2
Q: Preparred Statement error : ORA-00936: missing expression

CsiI have a little problem with my prepared statement. I got error ORA-00936: missing expression when doing executeQuery(). Can you tell me what i missed ? In my class constructor. private PreparedStatement reachOperation; reachOperation = connection.prepareStatement("SELECT * FROM operations WHER...

 
where r u assinging value for number variable?
 
Csi
You mean the line reachOperation.setInt(1,number); or the call operations = manager.getOperations(1, minDate, maxDate); ?
 
sorry its oracle use "date"
 
Csi
i didn't understand what you meant ^^'
 
date between ? And ? where date is a keyword to mention date datetype..so inorder to use it in query it should enclosed in " "
 
Csi
6:07 PM
Ah, you were right, in the query, i use the wrong column name it's mydate and not date. No errors now. However, my list is empty while there should be stuff inside :S
 
@Csi so its working now
 
6:17 PM
@Csi is ur mydate column is date datatype??
 
Csi
hello
 
hi
 
Csi
yes. "CREATE TABLE operations ( operation_id INTEGER, account_id INTEGER, amount DOUBLE PRECISION, mydate DATE NOT NULL)"
 
can u run this query at oracle using the values
u r passing
 
Csi
ok, i'll test with passing this query in command line in oracle
 
6:21 PM
ya..i doubt regarding the date variables
it may contain time stamp
 
Csi
Ah, i used the date as i read them in the table (DD:MMM:YY format) and it failed. The MMM is invalid identifier (MAY in this case)
 
hmm
so u should convert the date parameter to ur type
 
Csi
Ah, the school gate keeper is closing the labs ^^' I've to go :S
 
then need to pass to query
oh ok then
ping me if u need help
else u can also mail me
 
Csi
Ok, it will take me more than an hour to come home but i'll keep on working on this at home.
Cya :)
 
6:27 PM
ok no issue
ping me or mail me
i will ping back if im free
cya
 

  last day (18 days later) »