On 13.Jul.2001 -- 08:43 AM, Berin Loritsch wrote:
> > trying to sensibly integrate Informix SERIAL columns into
> > DatabaseAddAction.... Probably a more modular approach to
> > DatabaseAddAction.
> 
> As to this issue, if SERIAL columns generate new id numbers, you might
> want to use the "automatic" mode:
> 
> <table name="ifxTable">
>   <keys>
>     <key param="id" dbcol="department_id" type="int" mode="automatic"/>
>   </keys>
>   <values>
>     <value param="name" dbcol="department_name" type="string"/>
>   </values>
> </table>
> 
> What this does is tell the Database Actions that the "department_id"
> key values will be automatically generated by the database--so it does
> not try to add the information itself.

True, but then I'd like to have the freshly generated ID available --
without an error prone query (think duplicate values, no candidate
keys). Informix requires to do a myStatement.getSerial() after
execution. Oracle needs a query "MYSEQUENCE.current", others need
"@@IDCOLUMN" &c. So I'm working on a module for this. But perhaps a
code generator performs better.

Ah, while we're at it. Did you have a chance to have a look at my
proposed patch for ESQL?

        Chris.

-- 
C h r i s t i a n       H a u l
[EMAIL PROTECTED]
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to