oracle12c

Convert delimited string to rows in oracle [duplicate]

风流意气都作罢 提交于 2020-01-14 05:54:06
问题 This question already has answers here : How to convert comma separated values to rows in oracle? (4 answers) Closed 2 years ago . I used to use below query to convert comma delimited string to rows - select regexp_substr('A,B,C,D','[^,]+', 1, level) from dual connect by regexp_substr('A,B,C,D', '[^,]+', 1, level) is not null; But, now my delimiter is - '~^' I am not able to use same query for this delimiter. select regexp_substr('A~^B~^C~D^E','[^~^]+', 1, level) from dual connect by regexp

Oracle Database12c ORA 01918 and connection error

两盒软妹~` 提交于 2020-01-12 08:39:05
问题 I have installed the Oracle 12c and I have problems creating my first database and using it. I run SQL Developer and use "hr" user but it keeps telling me that the account is locked. I searched into stackoverflow answers and official doc and tried to unlock it with: ALTER USER HR IDENTIFIED BY password ACCOUNT UNLOCK; but with no success. I got error ORA01918, meaning that user does not exist. I tried then to use the user created at the installation (SYS as SYSDBA)but then it says that the

ORACLE SQL Status check trigger

倖福魔咒の 提交于 2020-01-07 05:32:34
问题 I wanted to create a trigger which when a new order is inserted in the ORDERS table the trigger updates the status level of a customer in the CUSTOMER table, depending on how many orders they have made. If a customer has 0 orders his status level is 'new' else if he has more than 1 he is a 'standard' customer. The trigger below works if I add the customer_no in manually: create or replace TRIGGER STATUS_CHECK AFTER INSERT ON ORDERS DECLARE n INT; BEGIN SELECT COUNT(ORDER_NO) INTO n FROM

Heavy swapping on oracle 12.1.0.2

落爺英雄遲暮 提交于 2020-01-07 03:16:05
问题 I am getting following error. My DB version is "Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production" and i have already gone through Doc ID 1919850.1. I want to know if there is any way to avoid swapping. WARNING: Heavy swapping observed on system in last 5 mins. pct of memory swapped in [1.80%] pct of memory swapped out [3.26%]. Please make sure there is no memory pressure and the SGA and PGA are configured correctly. Look at DBRM trace file for more details. Errors

How to parse json efficiently in Oracle 18c?

妖精的绣舞 提交于 2020-01-06 06:55:53
问题 I am trying to parse a large json using JSON_OBJECT_T , JSON_ARRAY_T APIs and its working fine but I want expert suggestions whether it is efficient or not? I am adding my json file and parsing code as below SampleJson Code SET SERVEROUTPUT ON; DECLARE l_clob clob; l_time timestamp; l_json json_object_t; l_stops_array json_array_t; l_stops_arr json_array_t; routeInfoObj json_object_t; routeStopArr json_array_t; BEGIN SELECT LOG_CLOB INTO l_clob FROM ITV_DEV_LOGS WHERE LOG_ID = 1435334; l_time

Returning multiple values from an Oracle 12c function

此生再无相见时 提交于 2020-01-05 09:36:12
问题 I am writing a function in Oracle 12c (and it has to be a function) that should return 3 values, order_line.o_id , a variable total that I create in the function, and a discounted_amount variable that I create in the function. I have gotten my function to create the discounted_amount variable and return it but I am not sure how to get it to return these other two values. CREATE OR replace FUNCTION DiscountsReport (input_o_id IN REAL) RETURN REAL IS output_o_id NUMBER; total REAL; discounted

convert %S to null in plsql

為{幸葍}努か 提交于 2020-01-05 05:32:06
问题 I observe a problem after migrating my oracle form 6i to 11g. In a form I am generating windows batch command. part of the command is as below: declare lv_content5c varchar2(300); begin lv_content5c:= '@Set sizeout2=%sizeout2:bytes=%'; CLIENT_TEXT_IO.PUTF(out_file,lv_content5c); CLIENT_TEXT_IO.PUTF(out_file, CHR(10)); CLIENT_TEXT_IO.FCLOSE(out_file); client_host('cmd /c start '|| lv_filename); end; it seems that when I store this text "'@Set sizeout2=%sizeout2:bytes=%'" in file oracleForm or

Oracle database 12c : ORACLE JSON QUERY SEARCH

社会主义新天地 提交于 2020-01-04 05:04:33
问题 Creating two types of table to store JSON values (BLOB and NCLOB) and my aim to search the required values from JSON table; Code Snippet 1: Creating table with one column as NCLOB. create table departments_json_nclob ( department_id integer not null primary key, department_data NCLOB not null ); Simple insert with multibyte character (that is value : məharaːʂʈrə ): insert into departments_json_nclob values ( 200,'{"department_list":[{"Deptname":"DEPT-A", "value" : "məharaːʂʈrə"}]}'); Code

Oracle 12c database connection using thin driver throws IO error

强颜欢笑 提交于 2020-01-04 04:46:08
问题 I'm following the JDBC Developer's Guide and trying to test the JDBC thin driver connection using a short java program. import java.sql.*; import oracle.jdbc.*; import oracle.jdbc.pool.OracleDataSource; class JDBCVersion { public static void main (String args[]) throws SQLException { OracleDataSource ods = new OracleDataSource(); ods.setURL("jdbc:oracle:thin:hr/hr@localhost:1522:orcl"); Connection conn = ods.getConnection(); // Create Oracle DatabaseMetaData object DatabaseMetaData meta =

SSIS not running in parallel with OraOLEDB.Oracle.1 Provider

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-04 04:44:09
问题 we had one SSIS package with Oracle 11 Client, we would run our daily query with 30min to 1 hour run time. we had to upgrade our oracle clients as one of our other oracle source got upgraded. post upgrade to Oracle 12c, our daily job run time increased. oracle DBA said, its not running in parallel, as its occupying only one processor. when we run the same query from SQL Developer or toad, its running in parallel. but if we run from SSIS OLEDB Source component its not running in parallel. I'm