Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Need assist w/ BEFORE INSERT trigger
On Sat, 15 May 2004 16:05:24 +1000, "Howard J. Rogers"
<hjr_at_dizwell.com> wrote:
>Martin Burbridge wrote:
>
>> Ed Stevens <nospam_at_noway.nohow> wrote in message news:<oq0aa0hgbrsdhido89vo6p0i85igk31mu7_at_4ax.com>...
>>
>>>Here's what I have:
>>>
>>>CREATE OR REPLACE TRIGGER TRG_MSGRTR_FORCE_PK
>>>BEFORE INSERT
>>>ON MESSAGE_ROUTER
>>>REFERENCING OLD AS OLD NEW AS NEW
>>>FOR EACH ROW
>>>begin
>>>:NEW.MSGRTE_MSG_SEQNBR := SQ_MSG_SLNO.NEXTVAL;
>>>END;
>>>/
>>>
>>>which yeilds this error
>>>
>>>PLS-00357: Table, view or sequence reference 'SQ_MSG_SLNO.NEXTVAL' not
>>>allowed in this context.
>>>
>>
>>
>> Good idea, you just need to wrap the sequence in a select e.g.
>>
>> select sq_msg_slno.nextval
>> into :new.msgrte_msg_seqnbr
>> from dual;
>>
>> On a side note why is the redundant line referencing old as old
>> ... etc so common, is it from the docs?
>
>I didn't see the original post, but if this is about how you get
>automatically-assigned incrementing sequence numbers, see posts passim
>in the reuse of index blocks thread here, or visit www.dizwell.com and
>check out the Basic Admin FAQ's first few questions.
>
>Sorry if it's not relevant, either. Feel free to ignore.
>
>Regards
>HJR
Howard,
Seems to be a problem with the web site. I get to the "Autonumbering -- Introduction" page ok, but after that, whenever I click a pointer/link to any one of the subsections ("Creating the Sequence, Part 1", "Creating the Sequence, Part 2") all I get is Creating the Sequence, Part 1. Using my browser to view the source code for the Introduction page shows that all of these links point to the same page.
Using the "forward" buttons on each page worked to get me through the series.
And thanks to all for the pointers. Received on Mon May 17 2004 - 10:08:33 CDT