Page 1 of 1

TUniQuery: Turn an update into an insert.

Posted: Wed 06 Jun 2012 22:33
by kamiller42
I have a TUniQuery with SqlInsert and SqlUpdate properties specified. The update works fine. I want to execute the insert statement if a certain field is null. I figure it would involved the OnUpdateRecord event and a method call to apply a certain Sql statement, like TUpdateSQL.Apply method.

What's the best way to accomplish this?

Re: TUniQuery: Turn an update into an insert.

Posted: Thu 07 Jun 2012 18:26
by kamiller42
Never mind. Figured this out using SQL. I supposed using cached updates and a TUniUpdateSQL would have worked too. Figured UniQuery had all it needed to apply one of its DML if called to do so.