|Just another Perl shrine|
Re: Handling Null or Undef values in DBI (and things of those nature)...by rbc (Curate)
|on Jan 08, 2002 at 04:49 UTC||Need Help??|
I hope this info can help you with your 2nd
Off the top of my head there are aleast 3 ways
to check the table before you insert a new record.
way one) would be to define a unique constraint
on this table in the DBMS. This will prevent any
insertion of a record that is a duplicate.
way two) would be to define a before insert trigger
and have this trigger check for a duplicate.
way three) execute the query select count(*) into n from ...
and if n > 0 then the record exist.
Its like a dog that can sing and dance.
It's remarkable because it can do it.
Not that it can do it well.