Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Counting number of rows, sequences with no sequences

Re: Counting number of rows, sequences with no sequences

From: Tanel Põder <tanel.poder.003_at_mail.ee>
Date: Wed, 18 Feb 2004 13:58:49 +0200
Message-ID: <029001c3f616$927cc630$73f823d5@porgand>


Hi!

This implementation will definitely miss rows in multi-user environments and if your next recommendation would be to lock the row during the transaction, then we'd have a major serialization and possibly a deadlocking problem.

Good initiatives by the way, but you should think them through before recommending (or worse, implementing) somewhere.

Tanel.

> What you can do is to create a one record table, the if the transaction
> rollbacks it will rollback
>
> create table sequence( value number);
>
> function getnewsequence
> select value+1 into variable from sequence;
> update table sequence value=variable ;
> return variable ;
> end;
>
> ----- Original Message -----
> From: "Mladen Gogala" <mladen_at_wangtrading.com>
> To: <oracle-l_at_freelists.org>
> Sent: Tuesday, February 17, 2004 6:13 PM
> Subject: Re: Counting number of rows, sequences
>
>
> What happens if the transaction is rolled back?
>
> On 02/17/2004 05:03:14 PM, Juan Cachito Reyes Pacheco wrote:
> > The other choice if you have to frecuently do counts to that table is
> > a
> > sequence
> >
> > You create an addiatoinal field with a sequence
> >
> > CREATE SEQUENCE, etc.
> >
> > row sequence
> >
> > 1 1
> > 2 2
> > ....
> > 1234 1234
> >
> > Then you select from the sequence the currval, and this is immediate.
> >
> >
> > ----------------------------------------------------------------
> > Please see the official ORACLE-L FAQ: http://www.orafaq.com
> > ----------------------------------------------------------------
> > To unsubscribe send email to: oracle-l-request_at_freelists.org
> > put 'unsubscribe' in the subject line.
> > --
> > Archives are at http://www.freelists.org/archives/oracle-l/
> > FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
> > -----------------------------------------------------------------
> >
> ----------------------------------------------------------------
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> ----------------------------------------------------------------
> To unsubscribe send email to: oracle-l-request_at_freelists.org
> put 'unsubscribe' in the subject line.
> --
> Archives are at http://www.freelists.org/archives/oracle-l/
> FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
> -----------------------------------------------------------------
>
>
> ----------------------------------------------------------------
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> ----------------------------------------------------------------
> To unsubscribe send email to: oracle-l-request_at_freelists.org
> put 'unsubscribe' in the subject line.
> --
> Archives are at http://www.freelists.org/archives/oracle-l/
> FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
> -----------------------------------------------------------------
>



Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
Received on Wed Feb 18 2004 - 05:58:49 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US