Hello Peter, Frank

On 4/25/07, Frank Schönheit - Sun Microsystems Germany
<[EMAIL PROTECTED]> wrote:
Hi Peter,

> base forms have write access only if the underlying table has a primary key.
> Often this column has an autoincrement (HSQL and others).
>
> In Oracle db's this must be realized with a trigger and a sequence.
> It seems, that oo forms cannot handle this problem, because I get a
> warning that the field with the primary field has to be filled out.
>
> Any ideas how to handle this?

not really. Except you submit an issue requesting that Base does not do
those pre-checks, but relies on the DB server to return an error. The
Oracle case gives a good justification for this. I'd try to fix this for
2.3 then (but can't promise).

Perhaps you could do something like this as a work around.

Base has the option to include a default value for a table column. Now
this is a literal value and can be setup by opening the table editor
in Base for the table in question. Here is the tricky part - if an
integer column is set to ATUOVALUE = TRUE this option is not
available, but if the integer field is set to AUTOVALUE=FALSE it is. I
am betting that in your case the field will not be set to AUTOVALUE.

So, you could enter a literal of -1 in the Default Value setting for
the column. When a form attached a control to this field and the user
selects NEW RECORD on the form the string -1 is entered into the
control, it is converted to an integer -1 when the record is posted.
The Trigger in the oracle server, I am betting, could care less and
will toss the value suppled and replace it with the next sequence
value. Meanwhile Base will be happy because you supplied a value for
the ENTRY REQUIRED field.

Just a thought.

Drew Jensen

Reply via email to