in reply to Re: EZDBI is an easier interface to SQL databases
in thread EZDBI is an easier interface to SQL databases
It's not always better to squander space: doing so may result in the program not working at all. Squandering time just makes it run slowly. But that's more of a philosophical point.
WRT the update_unless_insrt: there isn't such an option: PrincePawn's referring to the sort of situation where you've got enough information to create a record from scratch, or replace an existing one.
Thus (under Oracle) you get code similar to:
. id would presumably be limited to the primary key, rather than any unique key. Personally, I think I'd prefer to see it as inserting if the update fails (which avoids the problem of duplicating a different column).BEGIN INSERT INTO mytab (id, ...) VALUES (id_value, ...); EXCEPTION WHEN DUP_VAL THEN UPDATE mytab SET .. = ... WHERE id=id_value; END;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: EZDBI is an easier interface to SQL databases
by Dominus (Parson) on Oct 08, 2001 at 21:23 UTC | |
by Anonymous Monk on Oct 10, 2001 at 19:48 UTC | |
by Dominus (Parson) on Oct 10, 2001 at 20:15 UTC |