Omitting fields when inserting data
Omitting fields when inserting data
Hi,
is it possible to omit fields when inserting a new row into a table?
Background:
I have defined some default values for fields in the database table - and I do not want to
define this default in the code.
But when I do a "direct insert" like
editor.create(false).set('active', false).set('stepid', stepid).submit()
also the other fields are set to "null" - but I want to make just an insert as
"INSERT INTO tblstep (active, stepid) VALUES (0, stepid)"
which then takes the database table defaults for the other values.
Thanks!
PAscal
This discussion has been closed.
Answers
Hi @rheinertp ,
Editor would just pass that field as empty to the server, so it'll be the server script that's converting that to
null. You could create a default value on the client withfields.def, but if that's no good, you'll need to add some logic into that server-side.Hope that helps,
Cheers,
Colin