oracle

Why does a query with a sub-select cost less than query with a constant in Oracle

I've got an SQL-table with some million entries and I tried to query how much entries are older than 60 days (Oracle 11.2.0.1.0). For this experiment I used 3 different versions of the select-statement: (The cost-value is given by TOAD for Oracle V. 9.7.2.5) select count(*) from fman_file where dateadded >= (select sysdate - 60 from d...

How to know when to stop filling an OracleDataAdapter

I'm using the OPD.NET dll in a project that is accessing oracle. Users can type in any SQL into a text box, that is then executed against the db. I've been trying to use the OracleDataAdapter to populate a datatable with the resultset, but I want to be able to return the resultset in stages (for large select queries). An example of my...

A better way to return '1' if a left join returns any rows?

I have three tables, 'A', 'B' and 'C'. I have query on 'A' and 'B', but I want to add a field that tells me whether or not there is one or more (I dont' care how many) 'C' that are foreign keyed to 'A'. Here's what I have: SELECT A.A_id, A.col_2, col_3, B.col_2, A.col_4 count(C.id) as C_count FROM A JOIN B ON (A...

What does +0 mean after an ORDER BY in Oracle

I am trying to understand what the +0 at the end of this Oracle 9i query means: SELECT /*+ INDEX (a CODE_ZIP_CODE_IX) */ a.city, a.state, LPAD(a.code,5,0) ZipCode, b.County_Name CoName, c.Description RegDesc, d.Description RegTypeDesc FROM TBL_CODE_ZIP a, TBL_CODE_COUN...

Oracle Browser Issues

Are there any browser issues with Oracle, specifically IE7, IE8 and Firefox? I.T. has told me that I have to build all my sites to support IE6 because IE6 works with their version of Oracle. They've said that some of their apps break on newer browsers. Can someone let me know if this is true or provide me with a link to verify this. Tha...

How to implement an Enterprise Search

We are searching disparate data sources in our company. We have information in multiple databases that need to be searched from our Intranet. Initial experiments with Full Text Search (FTS) proved disappointing. We've implemented a custom search engine that works very well for our purposes. However, we want to make sure we are doing ...

How can I learn to make realistic assumptions about database performance?

I'm primarily a Java developer who works with Hibernate, and in some of my use cases I have queries which perform very slowly compared to what I expect. I've talked to the local DBAs and in many cases they claim the performance can't be improved because of the nature of the query. However, I'm somewhat hesitant to take them at their ...

Does SQL Server support the Oracle-like WITH clause?

I've seen mention of the Oracle WITH clause a few times around here for aliasing a subquery like this: WITH myData AS (SELECT id, text FROM SomeTable) SELECT myData from SomeOtherTable Does any version of SQL Server support this? If not, is there a particular reason they don't? Performance? Potential for incorrect usage? ...

Trigger is invalid in Oracle

Some of the triggers in my database become invalid after certain changes on the tables. But it seems that they are still working. The only problem I have is if I use SQL Developer there are red crosses on the left hand side of the triggers indicating they are invalid. Is it a big issue? I know I can recompile the trigger to fix that but...

oracle 10 performance issue with Select * from ...

sql : select * from user_info where userid='1100907' and status='1' userid is indexed, the table has less than 10000 rows and has a LOB column. The sql takes 1 second (I got this by using "set timing on" in sqlplus). I tried to use all columns names to replace *,but still 1 second. After I removed the LOB column ,the sql takes 0.99 s...

How to get first element by XPath in Oracle

In my Oracle db I have records like this one: <ROOT> <Event> <Type>sldkfvjhkljh</Type> <ID>591252</ID> </Event> <Data> <File> <Name>1418688.pdf</Name> <URL>/591252/1418688.pdf</URL> </File> <File> <Name>1418688.xml</Name> <URL>/591252/1418688.xml</URL> </File> </Data> </ROOT> I n...

Regarding Oracle Error

Hi, I am getting the below oracle error. I checked the test scheme for any constraint name CMF_CMP using toad. But i am unable to find it. How do i detect the reason for failure and how to resolve it. ERROR at line 1: ORA-20001: -2298: ORA-02298: cannot validate (TEST.FMF_CMP) - parent keys not found ORA-06512: at test.test_SYN", ...

how to append values to a oracle type

how can I append (insert) 3 or 4 different values to an oracle type and then later open it up for a cursor. For example (pseudo): insert into mytype select 1 from dual; insert into mytype select 3 from dual; insert into mytype select 5 from dual; open cursor_1 for select * from table(mytype); Is this possible to do in pl/sql? I kn...

Long waiting time between PHP and Oracle OCI

Hi ! I installed XAMPP on Windows server. There are 2 application on my server: First Application: PHP and MySQL application. This application runs quickly without and waiting time between links/pages. Second Appilcation: PHP and Oracle application. I use “Oracle Instant Client (OCI) for Windows (32 bit)” to connect Oracle Server (on ...

jdbc programming through oracle

what is the service name of oracle10g xe database ...

Why Oracle Sql*Plus print many unneeded heading ?

When I run a sql statement which supposed to return exact one row, sqlplus print column names many many times ? why ? ...

Oracle .NET Provider Not Found on Production Server

Hi, In Visual Studio running on an XP 64 bit everything runs fine. I have the web.config with an entry: ( to look for the 'bin' folder of the project where two .DLLs are (Oracle.DataAccess.dll, System.Data.OracleClient.dll) But, in the Production environment (Windows 2003, 32 bit), I get an error t...

Check that the values in all the columns are different in sql - Oracle

I have a table with 14 columns in Oracle. All the columns are of integer type. i need to check no two columns in one row have same integer value in them. How can i do this using SQL. Or is it only possible to do using PL/SQL? ...

Oracle: select into variable being used in where clause

Can I change the value of a variable by using a select into with the variable's original value as part of the where clause in the select statement? EI would the following code work as expected: declare v_id number; v_table number; --set elsewhere in code to either 1 or 2 begin select id into v_id from table_1 where name = 'John Smith...

Entity framework: How can I use more then one context?

Hi, I'm new with EntityFramework. My application has a pool of context object instances (Each context has 1 connection to the DB). The problem is that when I update an object (and calling SaveChanges), the data is updated in the DB and in the updating context but when I select from other instance, it gets the old data of the selected ...