Re: Forms30,Rec.not created(seq.no.genr.err)

From: Colin Fraser <cfraser_at_korma.chilli>
Date: 16 Dec 1994 14:08:23 GMT
Message-ID: <3cs70n$7s_at_pheidippides.axion.bt.co.uk>


In article 2923_at_ctsc.hkbc.hk, s11976_at_ctsc.hkbc.hk (PM Wong) writes:
>Our users running sqlforms30 got error FRM-40911: Record not created due
>to sequence number generation error, when trying to execute the forms
>they designed.
>THe Message in the Error Guide is:
>Cause: Internal error. Either the sequence numbder does not exist,or you
>do not have privileges for the number, or another fatal database occurred.
>
>Has anyone got a clue of what this means ? >
>--

I assume you're using sequences to generate unique indexes on insert?

The point to remember is that the sequences must be, in effect, the same as any tables to be used for identification and access, e.g.

  1. The user must be able to see them so, ensure

        CREATE [PUBLIC] SYNONYM ON ..... b) They must be able to use them so:

        GRANT SELECT ON <sequence> TO [PUBLIC|<user name>]

Check this out and, hopefully, you'll get things working.

A word of warning, 'tho. Sequences have one great shortcoming. You can't guarantee an unbroken sequence because, every time someone queries them, they are incremented whether or no you commit or rollback.

If this is a problem you should look at carrying your 'counts' in a single row table (we normally call them SYSTEM) and querying and updating this on a PRE-INSERT trigger. Something like:

	select LAST_ID + 1
	into   :BLOCK.ID_FIELD
        from   SYSTEM
        for update of LAST_ID;

        update SYSTEM
        set    LAST_ID = :BLOCK.ID_FIELD;

I hope this is useful and helps you clear your problems.

Yours

Colin

#include <disclaimer.std> Received on Fri Dec 16 1994 - 15:08:23 CET

Original text of this message