Re: Improved sequence management

From: Mladen Gogala <no_at_email.here.invalid>
Date: Tue, 9 Nov 2010 21:37:55 +0000 (UTC)
Message-ID: <pan.2010.11.09.21.37.55_at_email.here.invalid>



On Tue, 09 Nov 2010 14:41:14 -0500, paddy_nyr wrote:

> What does this mean?
>
> How would I use a sequence value?
>
> A new features of Oracle 11g will bypass DML (sequence.nextval) and
> allow normal assignments on sequence values.

This is what it means:

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> create sequence test_seq start with 1 cache 2048;

Sequence created.

Elapsed: 00:00:00.09
SQL> declare
  2 a number(10,0);
  3 begin
  4 a:=test_seq.nextval;
  5 dbms_output.put_line('A is:'||a);
  6 end;
  7 /
A is:1

PL/SQL procedure successfully completed.

Elapsed: 00:00:00.07
SQL> /
A is:2

SQL> save /tmp/1
Created file /tmp/1.sql
SQL> connect scott/tiger_at_stag3
Connected.
SQL> create sequence test_seq start with 1 cache 2048;

Sequence created.

Elapsed: 00:00:00.15
SQL> _at_/tmp/1
a:=test_seq.nextval;

            *
ERROR at line 4:
ORA-06550: line 4, column 13:
PLS-00357: Table,View Or Sequence reference 'TEST_SEQ.NEXTVAL' not allowed in
this context
ORA-06550: line 4, column 1:
PL/SQL: Statement ignored

Elapsed: 00:00:00.10
SQL> select * from v$version;

BANNER



Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi PL/SQL Release 10.2.0.5.0 - Production
CORE 10.2.0.5.0 Production
TNS for Linux: Version 10.2.0.5.0 - Production NLSRTL Version 10.2.0.5.0 - Production

Elapsed: 00:00:00.13

-- 
http://mgogala.byethost5.com
Received on Tue Nov 09 2010 - 15:37:55 CST

Original text of this message