db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David G.P." <vivant.studi...@gmail.com>
Subject Re: Problem updating a record
Date Tue, 03 Dec 2013 08:14:26 GMT
I would rather use '?' for the dates instead of concatenating them...


2013/12/3 Bob M <rgmatthews@orcon.net.nz>

> Thanks Myrna
>
> I can't tell you want happens as I have not run the code with a commit yet!
>
> Adding the one line psUpdate.executeUpdate(); is OK - thank you
>
> You are spot on with what I was assuming............I did think that the
> update would only apply to the  last record in my table
>
> What I am trying to do is to update only the newest record in the table
> That record has the highest primary key which is made up of the first two
> fields in each record
> Field 1 = Date and Field 2 = Time (which has values 0, 6, 12, and 18)
>
> Are you suggesting that the following would suffice?
>
> psUpdate = conn.prepareStatement("Update USD_JPY SET Return_predicted=?,
> Class_predicted=? where Date=" +Date1 +"and Time=" + Time1)
>
> A final question....................
>
> If one was inserting a new record using psInsert what code do you use to
> execute the Insert?
>
> Bob M
>
>
>
> --
> View this message in context:
> http://apache-database.10148.n7.nabble.com/Problem-updating-a-record-tp135856p135873.html
> Sent from the Apache Derby Users mailing list archive at Nabble.com.
>

Mime
View raw message