oracle11gr2

Equivalent of PostgreSQL's array_agg in Oracle XE 11.2 [duplicate]

有些话、适合烂在心里 提交于 2020-01-11 05:31:30
问题 This question already has answers here : SQL Query to concatenate column values from multiple rows in Oracle (11 answers) Closed 2 years ago . I have a Oracle 11g XE database and I have a query the result set: ID Category 1 Cat1 1 Cat2 2 Cat3 2 Cat4 I want to get distinct id's with all related categories in same row as comma separated like this ID Categories 1 Cat1,Cat2 2 Cat3,Cat4 I was using Postgres before and array_agg helped me there. How can I get same result in Oracle 11g XE? 回答1:

Oracle Update Batching Models - Using both batching models in same application

邮差的信 提交于 2020-01-04 09:15:23
问题 Oracle JDBC supports two distinct models for update batching: Standard Batching and Oracle Specific Batching. According to oracle 11g JDBC Developer Guide, in any single application, you can use one model or the other, but not both. Oracle JDBC driver will throw exceptions when you mix these . In my standalone application, the above statement does not hold true. I want to know if I am missing something. In my application I create a OracleDataSource and do the following connection = datasource

Why does using REPLACE function on CLOB cause increase in CACHE_LOBS…?

北战南征 提交于 2020-01-03 14:18:15
问题 I have a requirement to use the built in REPLACE function on a CLOB variable as part of a larger PL/SQL process. I'm using Oracle 11g R2 and the function works OK, in that it does the replace as required, but as the procedure runs (there are around 2.5 millions records to process), it slows down badly - as in: first 20,000 records: ~12 minutes second 20,000 records: ~24 minutes third 20,000 records: ~37 minutes fourth 20,000 records: ~52 minutes etc... Checking V$TEMPORARY_LOBS during

Was daylight savings time handling broken in Oracle JDBC driver version 11.2.0.2.0?

独自空忆成欢 提交于 2020-01-02 08:44:12
问题 I suddenly noticed that Oracle JDBC driver that I was using With Oracle 11g R2 was thinking that daylight savings time in US started after 2:59:59 am on March 13th this year. Actually, it started after 1:59:59 am. I did some additional testing and noticed that the buggy behavior of that driver did not depend on whether it talks to Oracle 11g R2 or Oracle 10g. Also, all available previous versions of that driver handle daylight savings time change correctly. Is this a known bug? Is there a fix

Selecting both MIN and MAX From the Table is slower than expected

杀马特。学长 韩版系。学妹 提交于 2019-12-31 11:33:51
问题 I have a table MYTABLE with a date column SDATE which is the primary key of the table and has a unique index on it. When I run this query: SELECT MIN(SDATE) FROM MYTABLE it gives answer instantly. The same happens for: SELECT MAX(SDATE) FROM MYTABLE But, if I query both together: SELECT MIN(SDATE), MAX(SDATE) FROM MYTABLE it takes much more time to execute. I analyzed the plans and found when one of min or max is queried, it uses INDEX FULL SCAN(MIN/MAX) but when both are queried at the same

Selecting both MIN and MAX From the Table is slower than expected

社会主义新天地 提交于 2019-12-31 11:33:33
问题 I have a table MYTABLE with a date column SDATE which is the primary key of the table and has a unique index on it. When I run this query: SELECT MIN(SDATE) FROM MYTABLE it gives answer instantly. The same happens for: SELECT MAX(SDATE) FROM MYTABLE But, if I query both together: SELECT MIN(SDATE), MAX(SDATE) FROM MYTABLE it takes much more time to execute. I analyzed the plans and found when one of min or max is queried, it uses INDEX FULL SCAN(MIN/MAX) but when both are queried at the same

Selecting both MIN and MAX From the Table is slower than expected

为君一笑 提交于 2019-12-31 11:33:06
问题 I have a table MYTABLE with a date column SDATE which is the primary key of the table and has a unique index on it. When I run this query: SELECT MIN(SDATE) FROM MYTABLE it gives answer instantly. The same happens for: SELECT MAX(SDATE) FROM MYTABLE But, if I query both together: SELECT MIN(SDATE), MAX(SDATE) FROM MYTABLE it takes much more time to execute. I analyzed the plans and found when one of min or max is queried, it uses INDEX FULL SCAN(MIN/MAX) but when both are queried at the same

How to create an oracle.sql.ARRAY object?

大兔子大兔子 提交于 2019-12-29 00:07:51
问题 This question is related to my original issue How to return an array from Java to PL/SQL ?, but is a more specific. I have been reading Oracle Database JDBC Developer's Guide and Creating ARRAY objects Server-Side Internal Driver oracle.jdbc.OracleConnection oracle.jdbc.OracleDriver but I still fail to write a minimum code where I can create ARRAY using ARRAY array = oracle.jdbc.OracleConnection.createARRAY(sql_type_name, elements); as instructed in Creating ARRAY objects. I'm using Oracle

Oracle cursor with variable columns/tables/criteria

我的未来我决定 提交于 2019-12-25 07:12:24
问题 I need to open a cursor while table name, columns and where clause are varying. The table name etc will be passed as parameter. For example CURSOR batch_cur IS SELECT a.col_1, b.col_1 FROM table_1 a inner join table_2 b ON a.col_2 = b.col_2 WHERE a.col_3 = 123 Here, projected columns, table names, join criteria and where clause will be passed as parameters. Once opened, i need to loop through and process each fetched record. 回答1: You need to use dynamic SQL something like this: procedure

Is PostgreSQL and Oracle Object-Relational storage the same as an ORM?

允我心安 提交于 2019-12-25 04:22:36
问题 Is the built in ability of PostgreSQL and Oracle Object-Relational mapping the same as an ORM like Hibernate, SQLAlchemy, or Doctrine? Are these databases queried and used just like objects you'd get back from ORMs? EDIT: Do I misunderstand what an ORDBMS is? Stil learning. http://www.postgresql.org/docs/8.2/static/intro-whatis.html http://docs.oracle.com/cd/E11882_01/appdev.112/e11822/toc.htm EDIT: I found it here also. http://en.wikipedia.org/wiki/Comparison_of_object-relational_database