oracle

What makes Oracle programming different from normal DB programming?

I'm seeing a lot of job posts that specifically mention Oracle and PL/SQL. What's unique about programming for this database? How different is it from programming for any other database, especially from Java? Isn't it the same normal SQL? Can't one just use JDBC? I've worked in the past with MySQL, DB2, and MSSQL, but haven't seen Or...

How can I practice my SQL Server, Sybase, and Oracle skills on a linux box?

I have a linux box. When I had a Windows box, I was able to download the free non-commericial use MS SQL Server. How can I run free personal copies of SQL Server, Sybase, or Oracle on my linux box? I don't need to to have any permanent databases or any great amount of storage. I just want to (re-)familiarize myself with these differen...

Oracle 10g - optimize WHERE IS NOT NULL

Hi - We have Oracle 10g and we need to query 1 table (no joins) and filter out rows where 1 of the columns is null. When we do this - WHERE OurColumn IS NOT NULL - we get a full table scan on a very large table - BAD BAD BAD. The column has an index on it but it gets ignored in this instance. Are there any solutions to this? Thanks ...

What's an OCCI context and environment?

Hello, I'm exploring a piece of software making use of Oracle API and as far as I can see often object methods expect as an argument a "OCCI context" or a "OCCI environment" values. An example is a constructor of an Account object: Account( oracle::occi::Environment* env ); later overloaded with Account( void* oraCtx ); I can un...

Developer tools to directly access databases

I work with several different databases and find myself trying connecting to these quite often to test a query. I use the database specific tools to connect to the DB and run the query. I find these DB specific tools like SQL Query Analyzer (SQL-Server), Oracle Enterprise Manager, MySQL Query Browser to be quite clunky and slow when it ...

select * returns CLOB

I have not used oracle before and I was to modify the clob data as it has my home phone number. But when I do select * from table shows CLOB and I cannot see the data. How can I see the data and how to I Update? I need the query. Thanks Jen ...

SQL group by "date" question

Hello. I'm trying to make a report but I'm having problems with my archi nemesis SQL. I have a table where the close date of a transaction is stored. I want to know how many transaction per month there was so I did: SELECT trunct( closedate, 'MONTH' ) FROM MY_TRANSACTIONS I'm using oracle. I'm getting a list like this: 2002-0...

jdbc connection using thin driver

i am connecting orace 10g xe with java but getting the exception java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver even i have included the classpath of driver i.e ojdbc14.jar if i have set wrong classpath plz tell me the correct way to set the classpath ...

Which table structure is better

We have to create few tables for the sole purpose of reporting in Oracle. Option 1 Receivable Table RefNo Date TrnType eg:Tax, Fee, Premium Amount Option 2 Receivable Table RefNo Date Tax Fee Premium Note: For a given RefNo all types Tax, Fee and Premium or a sub set of them can exist. What would be the optimal structure(Tabl...

How can I open a file using java stored procedure

Hello all, I am using oracle database 10g. I have to write a java stroed procedure through which i can call a file at the server and store it locally at the users machine. Im using oracle Apex 3.1.1. ...

Is there a way to make Oracle recalculate a query plan for each query invocation?

I have a parameterized query. Depending on parameter values optimal query plan varies significantly. Here is the trouble: Oracle uses the plan from the first query invocation for subsequent invocations resulting in bad performance. I deal with it by dynamic SQL but this way is far from elegant. So the question is: is there a way to tell ...

Finding correlated values from second table without resorting to PL/SQL

I have the following two tables in my database: a) A table containing values acquired at a certain date (you may think of these as, say, temperature readings): sensor_id | acquired | value ----------+---------------------+-------- 1 | 2009-04-01 10:00:00 | 20 1 | 2009-04-01 10:01:00 | 21 1 | 20...

plsql custom numeric format

I'm trying to format a numeric value always in the format "9 999,99" (notice the space). The problem is that oracle does not provide me a a numeric mask for getting this format. The closest I get is with to_char(value,'99990,99'), But no way of putting that space after the third digit. some examples of what I would like to get 1345....

Efficiently searching a 3-level hierarchy

Lets say I have a FirstName > MiddleName > LastName hierarchy (~10k rows, for sake of the question). This means you could have "John > Mary-Anne > Eddy" or "Eddy > John > Jacob" row. The point being that the hierarchy makes little sense and is very foreign to the user (unlike, say, a Country > State > City structure). Because its so u...

SQL: Counting number of occurances over multiple columns in Oracle

Cannot get my head around the SQL that will return the number of times a user has accessed a particular service. Think it might require a nested count and select, but cannot get my head around it. The data looks like this: UserID Service --------------- 1 Map1 1 Map2 1 Map1 2 Map1 2 Map2 3 Map4 3 ...

Oracle DataGuard

Oracle DataGuard is a technique to replicate data stored in an Oracle RDBMS across several Oracle engine instances. I'm wondering whether DataGuard really provides a linear scalability for a RDBMS. Do you have any experiences with the DataGuard? How does it behave under heavy load conditions? ...

Do DDL statements always give you an implicit commit, or can you get an implicit rollback?

If you're halfway through a transaction and perform a DDL statement, such as truncating a table, then the transaction commits. I was wondering whether this was always the case and by definition, or is there a setting hidden somewhere that would rollback the transaction instead of committing. Thanks. Edit to clarify... I'm not looking...

Oracle Throwing SQL Error when creating a View

Hi all, I'm trying to create a view in an Oracle database, but keep getting an ORA-00907 error (missing right parenthesis). My SQL is as below: CREATE VIEW my_view AS ( SELECT metadata.ID,metadata.Field1,metadata.Field2,metadata.Field3,metadata.Field4,attribute1.StrValue AS Attr1, attribute2.StrValue AS Attr2 FROM metadata,data AS at...

How to get all tables that have FKs to another table?

Is there any way to get all tables that have foreign keys to another table in oracle with a query? ...

select a random sample of results from an oracle query

This question asks about getting a random(ish) sample of records on sqlserver and the answer was to use "TABLESAMPLE", is there an equivalent in Oracle 10? If there isn't is there a standard way to get a random sample of results from a query set. For example to get 1000 random rows from a query that will return Millions normally. ...