in reply to Re: 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 spaceWell, I didn't say it was always better, did I? I just said it was better.
WRT the update_unless_insrt: there isn't such an optionI think I may have been thinking of MySQL's REPLACE syntax. It might be well worth emulating REPLACE with if (UPDATE fails) { try INSERT } if it could be done portably. But I do not think it can be. One problem is that the UPDATE might fail for some other reason, and understanding whether it is safe to proceed with the INSERT seems difficult.
You also suggest that I ignore the issue of multiple unique keys, and concentrate on just the primary key. But this doesn't make the problem any easier, and it would make the behavior a lot more confusing for the user. I think doing that would do the wrong thing a lot of the time, and then people would be upset.
Still, I should look into making this easier than it presently is. Right now, you would have to write something like
Which seems rather bizarre.eval { UPDATE ... } or INSERT ...;
--
Mark Dominus
Perl Paraphernalia
|
---|
Replies are listed 'Best First'. | |
---|---|
INSERT or UPDATE
by Anonymous Monk on Oct 10, 2001 at 19:48 UTC | |
by Dominus (Parson) on Oct 10, 2001 at 20:15 UTC |