>
> Yea I though it was strange, because I have an oracle trigger that auto
> populates the software_id when it's null.
>
Gabriel replied to me off-list with the above. I hope it's okay that I
include it and post a reply to the list, because I think it will be helpful
for other readers to learn about this issue.
Zend_Db_Table has no way of know what your trigger is doing. The way to use
Oracle sequences in Zend_Db_Table is to declare your Table class with the
name of the sequence, so it can generate the value before including it in an
INSERT statement.
You should be able to do both: keep your trigger that replaces a NULL in
the primary key column witha value generated from the sequence; and also
declare the sequence to Zend_Db_Table, so it can use the sequence to
populate the primary key column before it performs the INSERT.
That way the trigger will be a no-op when the primary key has a value, but
if you perform an INSERT outside the context of your Table class, the
trigger ensures a value is generated.
Regards,
Bill Karwin
--
View this message in context: http://www.nabble.com/Zend-DB-Table-and-Oracle-tp19380170p19385057.html
Sent from the Zend DB mailing list archive at Nabble.com.
没有评论:
发表评论