oracle

Rails: rake db:migrate *very* slow on Oracle

I'm using rails with the oracleenhanced adaptor to create a new interface for a legacy application. Database migrations work successfully, but take an incredibly long amount of time before rake finishes. The database changes happen pretty quickly (1 or 2 seconds), but the db/schema.db dump takes over an hour to complete. (See example mi...

Why is this query doing a full table scan?

The query: SELECT tbl1.* FROM tbl1 JOIN tbl2 ON (tbl1.t1_pk = tbl2.t2_fk_t1_pk AND tbl2.t2_strt_dt <= sysdate AND tbl2.t2_end_dt >= sysdate) JOIN tbl3 on (tbl3.t3_pk = tbl2.t2_fk_t3_pk AND tbl3.t3_lkup_1 = 2577304 AND tbl3.t3_lkup_2 = 1220833) where tbl2.t2_lkup_1 = 1020000002981587; Facts: Oracle XE tbl1.t1_pk is a pri...

What is the default Precision and Scale for a Number in Oracle?

When creating a column of type NUMBER in Oracle, you have the option of not specifying a precision or scale. What do these default to if you don't specify them? ...

How to pass parameter values to a T-SQL query

I am using the following T-SQL query in SQL server 2005 (Management Studio IDE): DECLARE @id int; DECLARE @countVal int; DECLARE @sql nvarchar(max); SET @id = 1000; SET @sql = 'SELECT COUNT(*) FROM owner.myTable WHERE id = @id'; EXEC (@sql) AT oracleServer -- oracleServer is a lined server to Oracle I am not sure how to pass the input...

ORA-01830: date format picture ends before converting entire input string

The SQL works fine on most installations. However I'm having a problem with an Oracle installation in Canada (possible date localization issue?). http://www.google.com/search?q=ORA-01830 I'm feeding data to a proprietary processor that generates the SQL. I only provide data. I was hoping for information that may help me solve it wit...

EXEC(query) AT linkedServer With Oracle DB

I am using Microsoft SQL server 2005. I need to sync data between SQL server and an Oracle db. First thing I need is to find out if the count of data on Oracle side with certain filters(here I use ID as a simple example). SELECT COUNT(*) FROM oracleServer..owner.table1 WHERE id = @id; The problem I have is that the table on the lined ...

Oracle DB simple SELECT where column order matters

I am doing a simple SELECT statement in an Oracle DB and need to select the columns in a somewhat-specific order. Example: Table A has 100 attributes, one of which is "chapter" that occurs somewhere in the order of columns in the table. I need to select the data with "chapter" first and the remaining columns after in no particular order...

Confusion over class resolution in Oracle java stored procedures

I'm trying to use a third-party java library within oracle. The library seems compatible with the same 1.4 version of the jvm that our Oracle 10g server hosts, since it runs fine outside of Oracle, so I feel like I should be able to get this to work. This library ends up making SOAP-based http requests, and I get class resolution error...

how to use a procedure parameter in a query

Hi.. how do i access the procedure parameters inside the same procedure using a query for example: see this procedure procedure game(left in tab.left%type,right in tab.right%type,...) is --some local variables begin merge into tgt_table using subquery --(here is what i need to use the parameters) on some condition when mat...

What tool do you use for developing and administrating your database?

I have always used TOAD by Quest to do my development and administration work in Oracle and MS SQL Server. However, I am trying not to be myopic in my choices. Are there other tools that you would recommend that will allow me to connect to the database(s) and perform my development and administrative duties? ...

Oracle10 and JDBC: how to make CHAR ignore trailing spaces at comparision?

I have a query that has ... WHERE PRT_STATUS='ONT' ... The prt_status field is defined as CHAR(5) though. So it's always padded with spaces. The query matches nothing as the result. To make this query work I have to do ... WHERE rtrim(PRT_STATUS)='ONT' which does work. That's annoying. At the same time, a couple of pure-...

How do you convert SYS_GUID() to varchar?

In oracle 10g, how do you convert SYS_GUID() to varchar? I am trying something like: select USER_GUID from user where email = '[email protected]' Which returns the RAW byte[]. Is it possible to use a function to convert the RAW to VARCHAR2 in the SQL statement? ...

bitwise exclusive OR in Oracle

In SQL Server I have been using the ^ symbol however that doesn't seem to work in Oracle. How do I do a bitwise exclusive OR in Oracle?? Thanks ...

Always get exception when trying to Fill data to DataTable

The code below is just a test to connect to an Oracle database and fill data to a DataTable. After executing the statement da.Fill(dt);, I always get the exception "Exception of type 'System.OutOfMemoryException' was thrown.". Has anyone met this kind of error? My project is running on VS 2005, and my Oracle database version is 11g. My ...

Stopping Debugger

I am running oracle application it while opening the internet explorer it goes to debugger and is not running could anyone let me know how to stop the debugger ...

Does PHP's Oracle PDO hang on DELETE?

This hangs in Php (5.2.6-Win32 + Oracle10g) is it a bug, or I'm doing something fundamentally wrong? try { $conn = new PDO($DB,$USER,$PASSWORD); $conn->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION ); //connected try { $conn->exec("DELETE FROM MY_TABLE"); echo "done"; ... Note: I don't know if this ...

Is Oracle BC4J Still Supported?

We need to move from OAS 9.0.4 to JBoss and we want to take our BC4J application with us. I'm looking for information on the supportability of BC4J on our new platforma and what licenses would be required. ...

How to call a function with Rowtype parameter from a select statement in Oracle

I have an oracle function which has an in parameter which is of rowtype of a table, from a select statement i need to pass the current row to this fucntion so that it does some processing and returns a value. Is there a pseudo variable that can be used within the context of a select statement something equivalent to a old and new in trig...

How to have partial incremental synchronizations based on a GUID?

I need to synchronize an SQL Server database to Oracle through an Oracle Transparent Gateway. The synchronization is performed in batches, so I need to get the next set of data from the point where I left off. The problem I'm having is that the only field I have in the source, to help me, is a GUID. If it were a number I could just orde...

Select count(*) from multiple tables

Ho to all! How can I select count(*) fro two different tables (call them tab1 and tab2) having as resulta: Count_1 Count_2 123 456 ? I've tried this: select count(*) Count_1 from schema.tab1 union all select count(*) Count_2 from schema.tab2 but all i have is: Count_1 123 456 Thanx in advance ...