Search code examples
xmloracleodp.net

How do I insert sysdate into a column using ODP and an XML dataset?


I'm using Oracle's ODP.Net to manipulate records.

When using the XML methods to insert and update records, I've run into a few problems. When I am inserting a new record, I'd like the value of one of the columns to come from a sequence (MySeq.nextval). I'd also like an UPDATE_DATE column to reflect sysdate.

I've only seen examples of OracleXmlCommand using completely formed Xml data sets to operate on. I'd like to have some process-time updates included.


Solution

  • DUH! A trigger is exactly what this situation calls for.

    • The key is using the index. An Insert trigger can do this.
    • Every time a record gets updated, the update date should be set. Gee... maybe an Update trigger????