oracle11gr2

Fetch and bulk collect from a REF CURSOR returned by a procedure

旧巷老猫 提交于 2019-12-08 06:08:59
问题 I have a stored procedure that has a SYS_REFCURSOR as an OUT parameter. The signature is, for example, as follows: PROCEDURE myProc(p_someID IN INTEGER, p_cursor OUT SYS_REFCURSOR); I call this procedure from a function, where I have to copy a column named clientID from the p_cursor to a scalar nested table. I am doing as follows: CREATE OR REPLACE FUNCTION myFunction RETURN sys_refcursor IS someID INTEGER := 1234; myCursor SYS_REFCURSOR; TYPE t_clientID_nt IS TABLE OF NUMBER(16,0); clientID

Empty RELIES_ON for RESULT_CACHE

纵然是瞬间 提交于 2019-12-07 06:03:04
问题 I have a query inside the function with RESULT_CACHE. So when the table is changed - my cache is invalidated and function is executed again. What I want is to implement the function that depends only on input parameters, and doesn't depend on any implicit dependencies (like tables, etc). Is it possible (without dynamic sql)? 回答1: a function that depends only on its parameters can be declared DETERMINISTIC. The results of this function will be cached in some cases. This thread on the OTN

Error code 2 starting OracleDbConsole service

丶灬走出姿态 提交于 2019-12-07 04:16:53
问题 I installed Oracle DB 11g, everything was working well, but suddenly process OracleDbConsoleorcl didn't start anymore, I try manually but it always shows this message: Windows could not start OracleDbConsoleorcl on Local Computer. If this is a non-Microsoft service, contact the service vendor, and refer the service specific error code 2 What should I do?? 回答1: You can use the following command to check the issues/configuration status of OracleDBConsoleorcle: emctl status dbconsole You can

Fetch and bulk collect from a REF CURSOR returned by a procedure

两盒软妹~` 提交于 2019-12-07 00:17:25
I have a stored procedure that has a SYS_REFCURSOR as an OUT parameter. The signature is, for example, as follows: PROCEDURE myProc(p_someID IN INTEGER, p_cursor OUT SYS_REFCURSOR); I call this procedure from a function, where I have to copy a column named clientID from the p_cursor to a scalar nested table. I am doing as follows: CREATE OR REPLACE FUNCTION myFunction RETURN sys_refcursor IS someID INTEGER := 1234; myCursor SYS_REFCURSOR; TYPE t_clientID_nt IS TABLE OF NUMBER(16,0); clientID_nt t_clientID_nt; otherID SYS_REFCURSOR; BEGIN myProc (someID, myCursor); FOR i IN myCursor LOOP

Extract certain pattern with Oracle SQL

余生颓废 提交于 2019-12-06 13:15:32
问题 I have a string like with xx as ( select 'id9' idno,'untest X456789,W357987 and Q321089 cont group' test from dual) select * from xx There are some thosand rows like the following IDNO | TEST +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ id9 | untest X456789,W357987 and Q321089 cont group I want to extract words that begin with a letter followed by 6 digits. Also, there should be a comma between them (because later I will place them to multiple rows) Resulting Table: IDNO

Finding the datatype of a cursor or table column in a block

夙愿已清 提交于 2019-12-05 18:42:59
Is is possible to find out the datatype of a column of a cursor or variable within block without using system tables? While I understand that I can use the system tables to find out this information it would be a lot slower. Something like, declare my_column_data_type varchar2(30); begin my_column_data_type := all_tables.table_name%type; dbms_output.put_line(my_column_data_type); end; I can't find any way of doing it without resorting to dbms_sql , which would be overkill for my eventual purpose. But, Oracle already has all the information to hand. If I were to try to assign a varchar2 to a

Empty RELIES_ON for RESULT_CACHE

自古美人都是妖i 提交于 2019-12-05 09:40:41
I have a query inside the function with RESULT_CACHE. So when the table is changed - my cache is invalidated and function is executed again. What I want is to implement the function that depends only on input parameters, and doesn't depend on any implicit dependencies (like tables, etc). Is it possible (without dynamic sql)? a function that depends only on its parameters can be declared DETERMINISTIC. The results of this function will be cached in some cases. This thread on the OTN forums shows how deterministic function results get cached inside SQL statements. As of 10gR2, the function

How big is an Oracle XMLType when stored as BINARY XML

半世苍凉 提交于 2019-12-05 01:08:45
The Oracle documentation claims that it stores XMLType more compact as BINARY XML than as CLOB. But how do I find out how much space is taken by the binary xml? CREATE TABLE t (x XMLTYPE) XMLTYPE x STORE AS BINARY XML; SELECT vsize(x), dbms_lob.getlength(XMLTYPE.getclobval(x)) FROM t; 94 135254 94 63848 94 60188 So, vsize seems to be the size of some sort of pointer or LOB locator, and getclobval unpacks the binary XML into text. But what about the storage size of the binary XML itself? Please help, the table size is 340GB, so it's worth looking into storage options... ThinkJet Oracle Binary

Direct-Path INSERT Oracle

余生颓废 提交于 2019-12-04 17:54:50
I am reading about Direct-Path INSERT in oracle documentation Loading Tables It is written that : During direct-path INSERT operations, the database appends the inserted data after existing data in the table. Data is written directly into datafiles, bypassing the buffer cache. Free space in the table is not reused, and referential integrity constraints are ignored . Direct-path INSERT can perform significantly better than conventional insert. Can anyone explain me ,how referential integrity constraints is been ignored,According to my understanding it will load the data into the table ignoring

Oracle11gR2 数据库客户端PL/SQL中文乱码的问题

亡梦爱人 提交于 2019-12-04 15:22:03
在进行oracle数据库的数据操作时,发现中文出现了乱码。这真是件麻烦事情。其实解决乱码的问题很简单,需要我们的PL/SQL Oracle客户端的字符集编码和Oracle数据库的字符集编码保持一致。 1、 查看oracle数据库的字符集编码: select * from nls_database_parameters where parameter in ('NLS_LANGUAGE', 'NLS_TERRITORY','NLS_CHARACTERSET'); 那么就需要我们修改ALS_LANG=AMERICAN_AMERICA_AL32UTF8。 2、 修改Oracle客户端的ALS_LANG的设置: 变量名:NLS_LANG,变量值:ALS_LANG=AMERICAN_AMERICA_AL32UTF8。 3、 我的电脑--> 属性---> 高级系统设置 --> 环境变量 4、 新建:变量名:NLS_LANG,变量值:SIMPLIFIED CHINESE_CHINA.ZHS16GBK , 这样在PL/SQL 中就没有乱码,也支持中文的查询。 来源: oschina 链接: https://my.oschina.net/u/2625464/blog/743949