Subject | Re: [IBO] Default Values |
---|---|
Author | Jason Wharton |
Post date | 2003-12-05T18:32:54Z |
Also, PreparedEdits property.
I'll just say real quick. Having them prepare or not makes a difference in
the nature of the SQL sent to the server. If they are prepared then all
columns are prepared and waiting with parameters. Thus, when executed server
defaults are not applied. Server defaults are not applied unless the column
is NOT in the insert statement at all.
Setting PreparedInserts to false makes it so that a fresh new insert
statement is generated for each record inserted. If a column is null/blank
then I just omit it from the statement which allows the server default to be
applied.
What annoys me quit a bit is when application developers somehow think that
the server defined default values are somehow supposed to be efficiently and
automatically known by the client. It is especially rediculous when you are
removing the end user through yet another layer going to client datasets.
I would like to advise against trying to make the server defined default
values, which have SQL rules associated to them, and make them into
something they are not. If you are going to design a middle tier, then
please be prepared to add in your layer of logic there.
Jason Wharton
www.ibobjects.com
I'll just say real quick. Having them prepare or not makes a difference in
the nature of the SQL sent to the server. If they are prepared then all
columns are prepared and waiting with parameters. Thus, when executed server
defaults are not applied. Server defaults are not applied unless the column
is NOT in the insert statement at all.
Setting PreparedInserts to false makes it so that a fresh new insert
statement is generated for each record inserted. If a column is null/blank
then I just omit it from the statement which allows the server default to be
applied.
What annoys me quit a bit is when application developers somehow think that
the server defined default values are somehow supposed to be efficiently and
automatically known by the client. It is especially rediculous when you are
removing the end user through yet another layer going to client datasets.
I would like to advise against trying to make the server defined default
values, which have SQL rules associated to them, and make them into
something they are not. If you are going to design a middle tier, then
please be prepared to add in your layer of logic there.
Jason Wharton
www.ibobjects.com