oracle11g

How to do conditional processing in a bulk collect loop?

爱⌒轻易说出口 提交于 2019-12-23 04:02:40
问题 we have Oracle 11G and i'm trying to move data from one table to another using bulk collect . Problem is when I tried to evaluate if one field from origin is empty my package got invalidated. What I have: Declaration: CREATE OR REPLACE PACKAGE MYSCHEMA.MYPKG AS CURSOR CUR_MYDATA IS SELECT o.name, o.last_name, o.id, o.socnum FROM origin o WHERE 1=1 AND o.name like upper ('a%'); TYPE t_name IS TABLE OF origin.name%TYPE; TYPE t_lastname IS TABLE OF origin.last_name%TYPE; TYPE t_id IS TABLE OF

ORA-29024: Certificate validation failure

被刻印的时光 ゝ 提交于 2019-12-23 04:02:30
问题 I've followed the following tutorials : Create wallet,Create ACL And I am still getting ORA-29024: Certificate validation failure error. I'm trying this query : UTL_HTTP.set_wallet('file:/home/oracle/wallet', 'password'); l_http_request := UTL_HTTP.begin_request('https://somedomain.co.il'); l_http_response := UTL_HTTP.get_response(l_http_request); Now i've added to the ACL : *.somedomain.co.il,somedomain.co.il And I've downloaded the certificate as DER encoded, as I've read somewhere that

ORA-29024: Certificate validation failure

旧城冷巷雨未停 提交于 2019-12-23 04:02:14
问题 I've followed the following tutorials : Create wallet,Create ACL And I am still getting ORA-29024: Certificate validation failure error. I'm trying this query : UTL_HTTP.set_wallet('file:/home/oracle/wallet', 'password'); l_http_request := UTL_HTTP.begin_request('https://somedomain.co.il'); l_http_response := UTL_HTTP.get_response(l_http_request); Now i've added to the ACL : *.somedomain.co.il,somedomain.co.il And I've downloaded the certificate as DER encoded, as I've read somewhere that

SELECT FOR UPDATE with Subquery results in Deadlock

浪子不回头ぞ 提交于 2019-12-23 03:41:11
问题 I have query when executed from different session is resulting in deadlock. TAB1 (ID, TARGET, STATE, NEXT) AND ID is primary key Column ID is the primary key. SELECT * FROM TAB1 WHERE NEXT = (SELECT MIN(NEXT) FROM TAB1 WHERE TARGET=? AND STATE=?) AND TARGET=? AND STATE=? FOR UPDATE In the Oracle trace file, I see the statement: DEADLOCK DETECTED Current SQL statement for this session: SELECT ID, TARGET, NEXT, STATE FROM TAB1 WHERE NEXT=(SELECT MIN(NEXT) FROM TAB1 WHERE (TARGET='$any') AND (

Determine Oracle query execution time and proposed datasize without actually executing query

笑着哭i 提交于 2019-12-23 03:13:55
问题 In oracle Is there any way to determine howlong the sql query will take to fetch the entire records and what will be the size of it, Without actually executing and waiting for entire result. I am getting repeatedly to download and provide the data to the users using normal oracle SQL select (not datapump/import etc) . Some times rows will be in millions. 回答1: Actual run time will not known unless you run it, but you can try to estimate it.. first you can do explain plan explain only, this

How does one find out how a DBF file or any file is formatted?

扶醉桌前 提交于 2019-12-23 03:12:18
问题 I am attempting to pick apart a DBF file using the code in THIS AskTom post however I have no clue where I would even go to figure out how the files I'm wanting to pick apart are formatted? How was the original AskTom answer even produced? How do I figure out the dbf Header. How do I know where within the dbf file the data is stored or even how to pull out that data? My goal is to work with the code provided and come up with a solution as others have done but I'm stuck at the very first part.

How does one find out how a DBF file or any file is formatted?

寵の児 提交于 2019-12-23 03:12:06
问题 I am attempting to pick apart a DBF file using the code in THIS AskTom post however I have no clue where I would even go to figure out how the files I'm wanting to pick apart are formatted? How was the original AskTom answer even produced? How do I figure out the dbf Header. How do I know where within the dbf file the data is stored or even how to pull out that data? My goal is to work with the code provided and come up with a solution as others have done but I'm stuck at the very first part.

Oracle SQL - dynamic case statement

只愿长相守 提交于 2019-12-23 02:25:21
问题 Is it possible to turn the below Oracle SQL query into a dynamic query? What I mean is, I have hard coded the values for the case statement as 'INTERNET', 'SALES' ETC... Is it possible to avoid hard coding? My source column is dynamic. I was thinking a for loop and array, but is that available in SQL? If someone could get me going on this, that would be great. Thank you. SELECT NVL(status, 'Grand Total') AS "ROW LABELS", COUNT(case when source = 'INTERNET' THEN 1 end) AS "INTERNET", COUNT

How do I write a stored procedure which adds a column to a ref cursor from another stored procedure?

一笑奈何 提交于 2019-12-23 02:08:42
问题 I have a stored procedure, GetRegions , which fetches some columns into a cursor like so: OPEN out_cur FOR SELECT id, name, ... FROM regions, ... WHERE ... This SP is used all over the place - in places where it will return tens of regions and in places where it will return tens of thousands. I also have a function, GetRegionPath which gets the "path" of a region. It's a moderately expensive function - there's no problem running it on tens of regions, but on tens of thousands would be

Oracle DBMS_LOB: Using DBMS_LOB.convertToBlob multiple times in PLSQL block

心已入冬 提交于 2019-12-23 01:29:45
问题 When I try to use DBMS_LOB.convertToBlob procedure multiple times in the same PLSQL block only the first execution works as expected. All additional executions produce empty blobs. Here is an example: DECLARE v_temp1 varchar2(32767) := 'absd'; V_temp1_blob BLOB; V_temp2 varchar2(32767) := 'efghi'; V_temp2_blob BLOB; v_in integer := 1; v_out integer := 1; v_lang integer := 0; v_warning integer := 0; BEGIN DBMS_LOB.createTemporary (V_temp1_blob, TRUE); DBMS_LOB.convertToBlob(V_temp1_blob, V