Subject: | DBIx/Class/Storage/DBI/Oracle/Generic.pm |
Date: | Tue, 21 Dec 2010 14:05:34 +0000 |
To: | "bug-DBIx-Class [...] rt.cpan.org" <bug-DBIx-Class [...] rt.cpan.org> |
From: | Duncan Garland <Duncan.Garland [...] motortrak.com> |
Hi,
I've been bitten a couple of times recently by the following error:
"Unable to find a sequence %INSERT% trigger on table '$source_name'."
The code is looking for an insert trigger in which the sequence's next value is selected using a statement with the following structure:
SELECT s_mbfl2_services_bookedi.NEXTVAL INTO :new.id FROM dual;
It fails if you select into an intermediate variable:
SELECT s_mbfl2_services_booked.NEXTVAL INTO x FROM dual;
In most cases the former is tidier code and I suppose both statement could go in the same trigger if necessary:
SELECT s_mbfl2_services_booked.NEXTVAL INTO :new.id FROM dual;
SELECT s_mbfl2_services_booked.CURRVAL INTO x FROM dual;
However, would it be possible to have an error message which makes it clearer why the error has occurred? I had to read the source code to work it out.
All the best.
Duncan