oracle10g

Best way to bulk insert data into Oracle database

我是研究僧i 提交于 2019-12-04 08:24:58
I am going to create a lot of data scripts such as INSERT INTO and UPDATE There will be 100,000 plus records if not 1,000,000 What is the best way to get this data into Oracle quickly? I have already found that SQL Loader is not good for this as it does not update individual rows. Thanks UPDATE: I will be writing an application to do this in C# Vincent Malgrat Load the records in a stage table via SQL*Loader . Then use bulk operations: INSERT INTO SELECT (for example "Bulk Insert into Oracle database" ) mass UPDATE ( "Oracle - Update statement with inner join" ) or a single MERGE statement To

How can I keep Oracle SQL Developer from closing the DB connection?

我们两清 提交于 2019-12-04 08:13:49
问题 Is there any way to keep Oracle SQL Developer from closing my DB connections, or to increase the timeout? Sometimes during a long-running query SQL Dev will just close the connection, leaving my query running on the server but me with no results. If I RDP into the server and run SQL Dev locally it never seems to have this problem. 回答1: This doesn't sound like an issue with SQL developer, cetainly I've never come across it. Are you sure it's not something else, like your network? What happens

how to display data in descending order without using ORDER BY CLAUSE in Oracle

旧时模样 提交于 2019-12-04 07:13:28
问题 I am new in oracle and I have one question i.e.: how to display data in descending order without using ORDER BY CLAUSE in Oracle. whether it is in sql or pl/sql. 回答1: It is not possible to reliably retrieve sorted results without explicitly using ORDER BY... if you cannot use ORDER BY, you would need to organize the code in whichever programming language you're using to pull the data with which is ridiculous. 回答2: Avoid ORDER BY, use a hierarchical query with flat results, and ORDER SIBLINGS!

Using dbms_output.get_line in VB.NET

六眼飞鱼酱① 提交于 2019-12-04 07:09:45
问题 I have some stored procedures to execute that use dbms_output.put_line() to put data into the output buffer. I know I need to use dbms_output.get_line(:line, :status) to retrieve that output. I'm using System.Data.OracleClient to avoid headaches with Oracle deployment. So what am I doing wrong with the code below? Dim cmdSproc As OracleCommand = cnOracle.CreateCommand() Dim strOracle As New OracleString() Dim opaLine As New OracleParameter("lineOut", OracleType.VarChar, 255) opaLine.Direction

Error on ORACLE trigger

℡╲_俬逩灬. 提交于 2019-12-04 06:32:19
问题 I have this sexy trigger, that takes a value from a field REFERENT, parses it, finds a row in some view and fills some data to original row that needs to be inserted. I also then re-write the REFERENT field and eliminate the extra data. The REFERENT field looks like this: "-XXX-123", where 123 is the key that i search data in the view. Hope it makes sense. CREATE OR REPLACE TRIGGER TRI_UPDATE BEFORE INSERT ON TBLASCENTOUTPUT_X REFERENCING NEW AS NEW OLD AS OLD FOR EACH ROW WHEN ( new.STEVILKA

How do you write arrays to an Oracle 10g XE db using iBatis?

末鹿安然 提交于 2019-12-04 05:33:49
问题 I have looked for the answer to this high and low but cannot get the answer. Basically I have an object I am writing to my db using iBatis. This works fine with primitive types like strings, int's etc but one of the attributes of my object is an array of other objects. I would like to be able to persist this and then later call the 'selectById' statement and retrieve the full object including the array. Here is the code I have so far: Mapper.xml <insert id="insertTrade" parameterClass=

Use gv$session to tell if a query is hanging

旧城冷巷雨未停 提交于 2019-12-04 05:30:46
I have a query running in Oracle, which may or may not be hung. It's been running for ~10 hours now, but based on the amount of data I'm loading that may not be unreasonable. I was looking at the session in gv$session and was wondering if there's a way to translate that information to see if there's actually any activity going on, or if the query is stuck waiting for a lock or otherwise hung. I've already read the documentation for this view here . I'm mostly looking for tips from anyone whose had experience debugging these types of issues in Oracle. Thanks! In gv$session , the event column

Ordering the strings while concatenating in oracle

∥☆過路亽.° 提交于 2019-12-04 05:07:00
问题 I am using the collect function to concatenate strings for a sql query. select id, tab_to_string(CAST(COLLECT(a.level||' '||d.Number||': '||to_char(nvl(de.eventDate,SYSDATE - 365 * 100))) AS t_varchar2_tab)) AS MyVar from Mytable groupby id The output of this query is like: Id Myvar 1 level : 27-Jan-09,level : 27-Mar-08, level : 2-Apr-10 2 level : 7-Jun-06,level : 27-Dec-08, level : 2-Nov-08 3 level : 27-July-10,level : 27-Mar-06, level : 2-Apr-10 But i want the "Myvar" value to be ordered by

Multi-Schema Privileges for a Table Trigger in an Oracle Database

烂漫一生 提交于 2019-12-04 04:10:03
问题 I'm trying to write a table trigger which queries another table that is outside the schema where the trigger will reside. Is this possible? It seems like I have no problem querying tables in my schema but I get: Error: ORA-00942: table or view does not exist when trying trying to query tables outside my schema. EDIT My apologies for not providing as much information as possible the first time around. I was under the impression this question was more simple. I'm trying create a trigger on a

How to convert column into rows in oracle 10g

…衆ロ難τιáo~ 提交于 2019-12-04 04:09:37
问题 Suppose I have the result of an Oracle sql query: Month Date ----- ----- Jan 10 Jan 15 Jan 20 Feb 11 Feb 16 Feb 25 I want to display this data in the following format: Jan Jan Jan Feb Feb Feb 10 15 20 11 16 25 How to write the query? 回答1: Using PIVOT : SQL> WITH sample_data AS( 2 SELECT 'Jan' mnth, 10 dt FROM dual UNION ALL 3 SELECT 'Jan' mnth, 15 dt FROM dual UNION ALL 4 SELECT 'Jan' mnth, 20 dt FROM dual UNION ALL 5 SELECT 'Feb' mnth, 11 dt FROM dual UNION ALL 6 SELECT 'Feb' mnth, 16 dt