建立“共享”序列【CREATE SEQUENCE OF THE SHARED】
2007-11-12 21:53
274 查看
在一次系统实施的时候碰到一个问题,学到一个建立“共享”序列的方法。
在数据库中有三个用户,A用户下有一个序列,而B和C用户需要使用A的这个序列。但是程序当时已经写好(分别取各自用户下的序列)。照以前如果使用
select a.seq_name.nextval from dual;的方法就不适应了。
解决方法:
通过建立同义词来解决:
create synonym seq_name for a.seq_name;
-----
synonym is an alternative name for a
table, view, sequence, procedure, stored function, package,
materialized view, Java class schema object, user-defined object type,
or another synonym.
原来是没有很好的阅读手册关于synonym的定义。SYNONYM可以解决多种数据库对象的重命名。
惭愧呀,还是要好好熟读手册。 -:)
在数据库中有三个用户,A用户下有一个序列,而B和C用户需要使用A的这个序列。但是程序当时已经写好(分别取各自用户下的序列)。照以前如果使用
select a.seq_name.nextval from dual;的方法就不适应了。
解决方法:
通过建立同义词来解决:
create synonym seq_name for a.seq_name;
-----
synonym is an alternative name for a
table, view, sequence, procedure, stored function, package,
materialized view, Java class schema object, user-defined object type,
or another synonym.
原来是没有很好的阅读手册关于synonym的定义。SYNONYM可以解决多种数据库对象的重命名。
惭愧呀,还是要好好熟读手册。 -:)
相关文章推荐
- Finding the Longest Nondecreasing Subsequence of A Given Sequence:An analysis of dynamic programming
- 关于ADF JDeveloper 11g 的 Unable to create an instance of the Java Virtual Machine
- 解决MFC对话框类不能建立new class contain the remnants of that class
- The driver was unable to create a connection due to an inability to establish the client portion of
- the basic operation of sequence in python
- "Your computer could not be joined to the domain. You have exceeded the maximum number of computer accounts you are allowed to create in this domain. Contact your system administrator to have this limit reset or increased."
- the application is not licensed to create or modify schema for this type of data
- xml中1字节的UTF-8序列的字节1无效([字符编码]Invalid byte 1 of 1-byte UTF-8 sequence终极解决方案)
- Recipe 5.10. Selecting the nth Smallest Element of a Sequence
- The usage of the Javascript method call and apply(what is the new and object.create difference.)(What does call(null) mean?)
- UVa 694 The Collatz Sequence(序列)
- The solution of Websphere create profiles failed on Linux
- the running sequence of try-catch-finally
- 关于解决 请求被中止:无法建立SSL / TLS安全通道(The request was aborted: Could not create SSL/TLS secure channel)的问题
- 使用文件映射的方式进行共享数据中CreateFileMapping、MapViewOfFile函数参数说明
- phoenix create table Order of columns in primary key constraint must match the order in which they'r
- the create feature task could not be completed,the coordinates or measures are out of bounds
- UVA 437 The Tower of Babylon (dp + DAG最长序列)
- Study Android, Step by Step(三) The sequence of reading Android Document
- xml中1字节的UTF-8序列的字节1无效([字符编码]Invalid byte 1 of 1-byte UTF-8 sequence)