oracle11g

Converting columns to rows in Oracle [duplicate]

无人久伴 提交于 2019-12-13 23:48:18
问题 This question already has answers here : Oracle Combine several columns into one (2 answers) Closed 2 years ago . I have a table with two columns first_name, last_name, with one row as john mathew. I want result as john in one row and mathew in next row. FNAME LNAME ------------- JOHN METHEW Result as Name ----- JOHN METHEW In short want to convert column to rows. 回答1: SELECT name FROM pivot_test UNPIVOT ( name FOR origin IN (fname, lname) ) SQL Fiddle 回答2: SELECT fname FROM tb UNPIVOT (

Expecting exact results when using contains clause in Oracle

风格不统一 提交于 2019-12-13 23:45:01
问题 I have a below contains clause query to get the best match queries. I have below two values in the table: 1. TRUSTS ACT 1973 and 2. TRUST ACCOUNTS ACT 1973. When I am searching using the below query with the string "TRUST ACT 1973" , for this search the actual result comes as TRUST ACCOUNTS ACT 1973 . But I am expecting the exact result as *TRUSTS ACT 1973* . Query: SELECT /*+first_rows(11) index(a fuzzy_leg_nm_idx)*/ a.unique_legislation_id, a.legislation_name, a.jurisdiction, score(1) sc

JOIN TABLE IN ORACLE

混江龙づ霸主 提交于 2019-12-13 22:14:31
问题 I have a table with 100000 records and I get 97000 records as part of this below query how to get the remaining 30000 records. I tried not equal to 'H.RESOURCE_ID <> SQ.CPNT_OG_ID' but not getting correct data? SELECT H.pernr AS "STUD_ID", SQ.CPNT_TYP_ID, SQ.CPNT_ID, TO_CHAR (SQ.REV_DTE, 'MON-DD-YYYY HH24:MI:SS') AS REV_DTE, CASE --WAIVED WHEN sq.CPNT_TYP_ID = 'VIDEO' AND enrollment_status = 'Complete' THEN 'VIDEO-COMPLETE' WHEN sq.CPNT_TYP_ID = 'VIDEO' AND enrollment_status <> 'Complete'

I don't see my Oracle OLE Driver in SSIS. Shouldn't it be available?

ε祈祈猫儿з 提交于 2019-12-13 21:01:04
问题 I don't see my Oracle OLE Driver in SSIS. Shouldn't it be available? I'd like to use the Oracle OLE Provider that the 32 bit Oracle Configuration Utility says is installed on my laptop: In SSIS, I when I go to create an OLE Database COnnection and choose the provder, I don't see the Oracle OLE Provider. Shouldn't it be here to select? What am I missing? 来源: https://stackoverflow.com/questions/23331209/i-dont-see-my-oracle-ole-driver-in-ssis-shouldnt-it-be-available

Oracle Stored Procedure and Cursor

只愿长相守 提交于 2019-12-13 20:40:24
问题 I'm trying to write a stored procedure to transform this: |----------|----------|----------|----------|----------| | ID | ESD | TD | IS_DB | TEST_SET | |----------|----------|----------|----------|----------| | 1 | 10 | 20 | 1 | 2 | | 2 | 30 | (null) | 1 | 2 | | 3 | 40 | (null) | 1 | 2 | | 4 | 50 | 60 | 0 | 2 | | 5 | (null) | 70 | 1 | 2 | | 6 | 75 | 100 | 1 | 2 | | 7 | (null) | 80 | 1 | 2 | |----------|----------|----------|----------|----------| to this: |----------|----------| | DT | FLAG |

Need to Add Oracle Listener for Second NIC

荒凉一梦 提交于 2019-12-13 20:15:38
问题 I am currently running Oracle 11g on a Windows 2012 Environment. I recently added another NIC to allow for failover, however I am not sure as to what to do with my listener.ora file and my tnsnames.ora file. Could someone offer guidance? For reference, the current IP I am using is 192.168.0.52 and the IP of the second NIC that I would like to add has the IP of 192.168.0.53. Below is my listener.ora file: # listener.ora Network Configuration File: D:\app\Administrator\product\11.2.0\dbhome_1

Does JDBC adjust the Date before it inserts it into Oracle DB? How do I prevent this?

好久不见. 提交于 2019-12-13 18:52:43
问题 Say we have the following code that creates date: SimpleDateFormat sdf = new SimpleDateFormat( "dd/MM/yyyy" ); sdf.setTimeZone( TimeZone.getTimeZone( "UTC" ) ); // we know the date being parsed is UTC Date bizDate = sdf.parse( "12/12/2015" ); // milliseconds: 1449878400000 log.info( "ms: {}", bizDate.getTime() ); log.info( "date: {}", bizDate ); ... // save to db If that code runs on a JVM in UTC on an Oracle DB in UTC, I'm getting: JVM params: -Duser.timezone=UTC millisecond: 1449878400000

How to upgrade from Oracle Express to Standard using the export / import dump method?

拥有回忆 提交于 2019-12-13 18:07:30
问题 I am trying to upgrade the Oracle DB from Express 11g to Standard 11g. I know how to export and import between two machines that run Express, but when i need to import the dump on Standard, i have no idea where to put the .dmp file or how to import it. For the export i am using this command: expdp Test/Pc DIRECTORY=DATA_PUMP_DIR DUMPFILE=EX2.dmp Which creates a dump file in this location: C:\oracle\app\oracle\admin\xe\dpdump\EX2.dmp Now, if i wanted to just import the dump into an Express

(oracle) insert in stored procedure very slow compared to insert run manually

主宰稳场 提交于 2019-12-13 16:46:20
问题 I run an insert from Oracle sql tool that selects about 100.000 rows from various tables and inserts them in another table at different databsae and this ends in 3 mins. I try the same query inside a stored procedure or PLSQL in oracle and we run for about 2 hours. For information i use Source Oracle 11g and the destination Oracle 10g Stored Procedure (takes about 2 hour per store): CREATE OR REPLACE PROCEDURE MGS.TRANSFER_DATA(a_date in varchar2) -- yyyymmdd BEGIN BEGIN FOR xx IN( SELECT STR

Oracle sql query to group consecutive records by date

北城余情 提交于 2019-12-13 16:40:53
问题 With the below sample data, I am trying to group record with same rate. id start_date end_date rate ----------------------------------------------------------------- 1 01/01/2017 12:00:00 am 01/01/2017 12:00:00 am 300 1 02/01/2017 12:00:00 am 02/01/2017 12:00:00 am 300 1 03/01/2017 12:00:00 am 03/01/2017 12:00:00 am 300 1 04/01/2017 12:00:00 am 04/01/2017 12:00:00 am 1000 1 05/01/2017 12:00:00 am 05/01/2017 12:00:00 am 500 1 06/01/2017 12:00:00 am 06/01/2017 12:00:00 am 500 1 07/01/2017 12:00