oracle

Oracle not distinguishing between nulls and empty strings?

Apparently oracle doesn't seem to distinguish between empty strings and nulls. E.g. Select name from TABLE_A where id=100; ID NAME 100 null Update TABLE_A set NAME='' where id=100; SELECT --> ID NAME 100 null SELECT length(NAME) FROM TABLE_A WHERE id=100; null I can't think of any good reason why Oracle would be bui...

Why is this unrelated table scanned?

I have a query which is crossing two tables select count(*) from ingenium.empevt, ingenium.evt where empevt_evtfk = evt_pk it takes quite a long time to run and in trying to figure out why I looked at the plan Operation Object Name Rows Bytes Cost Object Node In/Out PStart PStop SELECT STATEMENT Optimizer Mode=CHOOSE 634 K ...

Oracle Interface

I am building an interface between two Oracle databases (A and B) on separate pieces of hardware. I am soliciting advice on the following options (or looking for other ideas) for referencing columns from database B in code on database A (I am using the %ROWTYPE feature in Oracle for all of my variables) *Do it the hard way SCHEMA.TABLE...

Oracle SQL for continuous grouping.

I need to generate a report from a table with the structure and data as given below. Table Ticket has data as given below. ID Assigned_To 100 raju 101 raju 102 raju 103 anil 104 anil 105 sam 106 raju 107 raju 108 anil The Oracle SELECT should generate the below report Fro...

Insert Max Value of Column into Another Column

I have a table defined by: create table apple( A number, B number); Now, I need to get values in the table such as the following: A B ------------------ 1 4(max of A) 2 4(max of A) 3 4(max of A) 4 4(max of A) How can I insert these rows, making B the maximum value of A? ...

Calling an Oracle function from SQL Server Linked Server

I have setup a linked server pointing to an Oracle DB. I want to call a function ABC in a package XYZ passing parameter K. What will be the syntax to do this? ...

SQL - Query to return result

There is a table with Columns as below: Id : long autoincrement; timestamp:long; price:long Timestamp is given as a unix_time in ms. Question: what is the average time difference between the records ? ...

Non-trivial merge of two tables

There are two tables 1 and 2 with columns Id: unique ; timestamp:long; money:double SOME RECORDS are missing in Table 1 and table2. Question: try to merge both tables together with the timestamps of table1 , and if the records is only in table 2 adjust the timestamp with average time difference between table 1 and table2. Please help ...

C#, insert multiple records at once to a database

Hi, I'm writing a converter for my database from MSSQL Express Edition to Oracle. The amount of rows in the table is around 5 millions. On MSSQL side I use LINQ to SQL to select data. I'd use the same approach for Oracle, but unfortunately there's no LINQ to Oracle in .NET. I know there is open source LINQ to Oracle implementation, but I...

Oracle's puzzling behaviour with NLS_SORT and a simple regexp_like

I ran into a weird behavior from Oracle this morning... And I can't understand why it acts this way from the docs. I'm sorry for the long post, but I want to make sure I'm understood. Oh, and make sure to read the note at the end before answering :) The goal of the request is to return rows with 1 or more lowercase characters. For the s...

Connecting Oracle 11 G By ODP.NET

Hi, In .Net 2008,in server explorer when i want to connect to oracle by odp.net,i see datasources and select them but i cant connect them.My password and user name are true,i can connect to oracle by other providers.What can be problem?Error Message is Couldnt resolve service name ...

How do I View a Tree list of Schemas for a database in Oracle SQL Developer

How do I view the Schemas that belong to a database in SQL Developer. I am trying to get a view similar to Toad in that you have the database name at the parent level, all the schemas below it which are then expandable to view all the objects that belong to that particular schema ...

JDBC fundamental concepts, Pooling and Threading

I was always using JDBC in JavaSE on single-threaded environment. But now I need to use a connection pool and let many threads to have interaction with the database (MSSQL and Oracle) and I am having a hard time trying to make it as it seems that I am lacking some fundamental undestanding of the api. AFAIK after connect and logging a Co...

Recommendation for a book on "expressive" PL/SQL?

Let me be clear - I have more than enough "references" and "for beginners" books. What I want is something like "Exceptional PL/SQL" or "Agile PL/SQL" or "PL/SQL Design Patterns" or even just "PL/SQL For Developers Who Want To Write Pretty Code". Does such a thing exist? (I'm a C++/Ruby/etc. developer. I've been thrown into an Oracle ...

Help optimizing an Oracle query

I'll preface this question by stating that I'm using Oracle 10g Enterprise edition and I'm relatively new to Oracle. I've got a table with the following schema: ID integer (pk) -- unique index PERSON_ID integer (fk) -- b-tree index NAME_PART nvarchar -- b-tree index NAME_PART_ID integer (fk) -- bitmap index Th...

Do I Still Need To Install Oracle Client if Using Microsoft ODBC for Oracle to connect to an Oracle Database?

Using ActiveX Data Objects 2.8 Library as a Reference from Excel VBA, and the connection string is: "Driver={Microsoft ODBC for Oracle}......." And I also have the "Microsoft ODBC for Oracle" (MSORCL32.dll) entry in the Drivers tab of Windows XP's ODBC Manager. Now, will I be able to connect to an oracle databse, without any oracle cl...

Hibernate Oracle Tablespace Annotation

I'm annotating my DAOs and using hibernate3:hbm2ddl to generate the ddls. Is there a way to annotate the tablespace? ...

Is there a Microsoft SQL Profiler equivalent for Oracle

Hi, 99% of my time is in SQL Server land and so I'm not at all familiar with Oracle or its products...Is there a similar application to Microsoft SQL Profiler for use against Oracle databases? I'm helping debug/tune an ASP.Net application that connects to Oracle using ODAC etc thanks heaps! ...

Would it be hard to switch from MySQL to Oracle?

Below is some example code of how I run my mysql queries, I run them through a function which I think would maybe simpliy switching databases. Below is an example of a mysql query I run and below that is the actual function. Would it be difficult to change to a different database type like oracle or some other if I ever decided to usin...

Finding Duplicate Entries in a table

Hello Experts, I have a table with the following fields in Oracle 10g. TABLE_1 account_no | tracking_id | trans_amount Each account_no can have multiple tracking Id's and transaction amounts. How do i query out the duplicate entries of account_no where tracking lies between 1 and 1000, and the corresponding trans_amount ? Many than...