Oracle Database 11g - PL/SQL - Sequences Tweet
お〜。これは便利。
PL/SQL内から直接、シーケンスにアクセスできるようになるんですね。
これまでは、PL/SQL内でシーケンスにアクセスするには
select hoge_sequence.nextval into vSeq# from dual;
なんてクエリをPL/SQL内で発行する必要があった訳ですけど、これからはダイレクトに
vSeq# := hoge_sequence.nextval;
と書けるということなんでしょうね。便利です。
眠いので今日はこの辺りで。。。。。
Oracle Database 11g Application Development whitepaperより引用。
PL/SQL: Sequences
The sequence generator provides a sequential series of numbers to applications.
The sequence generator is especially useful in multiuser environments for
generating unique sequential numbers such as an employee id without the overhead
of disk I/O or transaction locking.
In the previous release of Oracle Database, when a PL/SQL program needed to get
a value from syntax, it used SQL. This is a usability irritation for PL/SQL
programmers. In Oracle Database 11g, it is now possible to simply use the
pseudocolumns CURRVAL and NEXTVAL in a PL/SQL expression.
Simplifies coding.
| 固定リンク | 0


コメント