Re: Initializing a new record where field is NULL by default

2015-02-01 Thread Dyre Tjeldvoll
On 31. jan. 2015, at 20.22, Bob M rgmatth...@orcon.net.nz wrote: Hi Dyre I am still not grasping this. I have psInsert = conn.prepareStatement(INSERT INTO TABLE VALUES(?, ?.., ?) [27 of them] psInsert.setString(1, date); psInsert.setString(25,

Re: Initializing a new record where field is NULL by default

2015-02-01 Thread Bryan Pendleton
You have to spell out the columns you are inserting into, unless the columns with default values are the last columns in the table. In that case you can just omit them in the insert I'm pretty sure it's a bit more flexible than that. I believe that if you don't say NOT NULL, and you don't

Re: Initializing a new record where field is NULL by default

2015-02-01 Thread Bob M
Thank's Bryan for that information... I have sorted it out now The profit field is a dec(5,2) field and so I am using DEFAULT 999.99 Then when I wish to update the latest record with the profit I use a WHERE profit=999.99 All good :) Thanks Bob M -- View this message in

Re: Initializing a new record where field is NULL by default

2015-02-01 Thread Dyre Tjeldvoll
On 02/01/2015 05:42 PM, Bryan Pendleton wrote: You have to spell out the columns you are inserting into, unless the columns with default values are the last columns in the table. In that case you can just omit them in the insert I'm pretty sure it's a bit more flexible than that. I