oracle

Connecting to Oracle 10g from .NET

I am trying to connect to oracle server located at some IP address but always get error as System.TypeInitializationException: The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception. ---> Oracle.DataAccess.Client.OracleException The provider is not compatible with the version of Oracle cl...

Optimize the sql query

UPDATE employees SET job_id = (SELECT job_id FROM employees WHERE employee_id = 205), salary = (SELECT salary FROM employees WHERE employee_id = 205) WHERE employee_id = 114; This is the query i have been using. Here i use 2 subqueries but they have th...

Why DB constraints are not added during table creation.

Hi All, What is the difference between these to ways of table creation. CREATE TABLE TABLENAME( field1.... field2... add constraint constraint1; add constraint constraint2; ) AND CREATE TABLE TABLENAME( field1.... field2... ) ALTER TABLE TABLENAME add constaint1 ALTER TABLE TABLENAME add constaint2 Moreover the first...

replace selfjoin with analytic functions

Hi Any ideas how i go about replacing the following self join using analytics SELECT t1.col1 col1, t1.col2 col2, SUM((extract(hour FROM (t1.times_stamp - t2.times_stamp)) * 3600 + extract(minute FROM ( t1.times_stamp - t2.times_stamp)) * 60 + extract(second FROM ( t1.times_stamp - t2.times_stamp)) ) ) div, COUNT(*) tot_count FROM tab1...

Java framework "suggestion" for persisting the results from an Oracle 9i stored procedure using Apache Tomcat

I am developing a Java servlet which calls an Oracle stored procedure. The stored procedure is likely to "grow" over time, and I have concerns the amount of time taken to "display the results on a web page". While I am at the implementation stage, I would like some suggestions of a Persistence framework which will work on Apache Tomcat...

how to combine the related version in group by

select count(a),b,c from APPLE join MANGO on (APPLE.link=MANGO.link) join ORANGE on (APPLE.link=ORANGE.link) where id='camel' group by b,c; the column b gives values like 1.0 1.0,R 1.0,B 2.0 2.0,B 2.0,R 3.0,C 3.0,R is there a way to modify the above quer so that all 1.0 and 1.0,R and 1.0,B are merged as 1.0 and 2.0,2.0,B are...

SecurityException when trying to export a java resource

I'm trying to get the source of a java resource stored in an oracle database using this code (connecting as SYSTEM for testing): DECLARE javalob CLOB; BEGIN DBMS_LOB.CREATETEMPORARY(javalob, false); DBMS_JAVA.EXPORT_RESOURCE('RESOURCENAME', 'SCHEMA', javalob); DBMS_OUTPUT.PUT_LINE(javalob); END; But when I try to run i...

What privileges do you need to access sys.$ tables?

What privileges do you need to be able to query the sys.obj$, sys.col$ etc system tables directly? ...

Oracle Professional Developer, Ver. 6.0.33 for MS-DOS

Hi, I'm trying to install this fossil in DOS 6.22, which is running in Microsoft Virtual PC 2007. I'm hoping that some of you veteran Oracle developers have any recollection of in what order do these diskette images need to be loaded, since I don't have any documentation available for 6.0.33. A friend emailed me the following 720K di...

Updating a table with the max date of another table

In Oracle 10g, I need to update Table A with data from Table B. Table A has LOCATION, TRANDATE, and STATUS. Table B has LOCATION, STATUSDATE, and STATUS I need to update the STATUS column in Table A with the STATUS column from Table B where the STATUSDATE is the max date upto and including the TRANDATE for that LOCATION (basically, I'...

Migrate from Oracle to MySQL

We ran into serious performance problems with our Oracle database and we would like to try to migrate to a MySQL-based database (either MySQL directly or, more preferrably, Infobright). The thing is, we need to let the old and the new system overlap for at least some weeks if not months, before we actually know, if all features of the n...

hadoop beginners question

I've read some documentation about hadoop and seen the impressive results. I get the bigger picture but am finding it hard whether it would fit our setup. Question isnt programming related but I'm eager to get opinion of people who currently work with hadoop and how it would fit our setup: We use Oracle for backend Java (Struts2/Servl...

Creating directory?

When I create a directory using sytem user (vin.txt is my file) create directory emp_dir1 AS "'C:\Documents and Settings\Administrator\Desktop\vin.txt'"; it creates it. When I do the same using user Scott it gives an error for path of file that "Identifier is too long" but when I put this file path in single quotes instead ...

I have a KVP Key value pair Table, Need sql to make it relational structure...!

I have a KVP Table and the structure is ID, Key, Value and below are the sample values.... Table with values ID , Key, Value 1 , STATUS, TRUE 1, AGE GROUP, 10 1, TRAVEL, Y 2 , STATUS, FALSE 2, AGE GROUP, 20 2, TRAVEL, N I want these date to transform as below (Output) ID , STATUS, AGE GROUP, TRAVEL 1, TRUE , 10, Y 2, FALSE, 20, N ...

Where can i find a EC2 Oracle database 11gR2 AMI?

Does anyone know where i can find such a AMI? Oracle database Enterprise Edition 11g release 2? Has oracle supplied it somewhere or has someone else created one i can use? ...

Oracle: how to "group by" over a range?

If I have a table like this: pkey age ---- --- 1 8 2 5 3 12 4 12 5 22 I can "group by" to get a count of each age. select age,count(*) n from tbl group by age; age n --- - 5 1 8 1 12 2 22 1 What query can I use to group by age ranges? age n ----- - 1-10 2 11-20 2 20+ 1 ...

LPX-00607 for ora:contains in java but not sqlplus

Hi I am trying to doing some SQL queries out of Oracle 11g and am having issues using ora:contains. I am using Spring's JDBC implementation and my code generates the sql statement: select * from view_name where column_a = ? and column_b = ? and existsNode(xmltype(clob_column), 'record/name [ora:contains...

Oracle 10g Express / APEX

I downloaded the free 10g Express. When I tried downloading the "free" Application Express development tool version 3.2.1 it gave me an error message saying it could not find that download. Anyone have any idea whats going on with this? ...

how to optimize this query?

hi! The query is: select employee_id , last_name , salary , round((salary+(salary*0.15)), 0) as "NewSalary" , (round((salary+(salary*0.15)), 0) - salary) as “IncreaseAmount” from employees; Can I optimize this round((salary+(salary*0.15)), 0) part in anyway, so that it doesn't appear twice? I tried givi...

Optimizing Oracle query

SELECT MAX(verification_id) FROM VERIFICATION_TABLE WHERE head = 687422 AND mbr = 23102 AND RTRIM(LTRIM(lname)) = '.iq bzw' AND TO_CHAR(dob,'MM/DD/YYYY')= '08/10/2004' AND system_code = 'M'; This query is taking 153 seconds to run. there are millions of rows in VERIFICATION_TABLE. I think query is taking long because ...