|Subject||Re: [firebird-support] REPLACE command|
> > You know - I bet I know why MySQL has a REPLACE... As it doesn't havemaster
> > FKs, it doesn't have cascading delete FKs and you can easily delete a
> > row. With Firebird, however, you would "replace" the row, but you wouldrun
> > into problems with FKs.Oh yes - I fully agree.
> > Another - I think better - command would be:
> > INSERT_OR_UPDATE :-)
> I would rather see UPDATE_OR_INSERT command.
> If you try to update the record that doesn't exists (no PK), the db
> would create new one (using entered PK value and defaults for all other
> columns). I have come to need something like this every now and then,
> but some SP or few lines of code do the job well.
> IMHO, there are other, *much* more important things for FB development
> team to "waste" their time with.
btw, Database Workbench let's you (automatically) create an INSERTUPDATE
procedure that tries to insert with the specified PK and updates if a PK
happens... No need to write any code :-)
Database Workbench - the developer tool for InterBase & Firebird