oracle

Reverse in Oracle this path z/y/x to x/y/z

How would I do in a SELECT query to reverse this path : z/y/x for x/y/z where / is the delimiter and where there can be many delimiters in a single line ex: select (... z/y/x/w/v/u ...) reversed_path from ... ...

How can I retrieve an Oracle record when my key field contains a mu ('μ') character?

I have a small table of measurement units in Oracle (10.2.0.4). It's defined as CREATE TABLE Units ( UNIT_ID number, UNIT varchar2(12) ) It's populated with a few records, and one of those records has a unit value of 'μL'. When I try to query for that record using this query... select * from units where unit = 'μL' .. I g...

how do i store a File from Java web app in an oracle directory (not table)

Im looking por any kind of procedure that let me save a Java.io.file in an oracle directory, it may be a stored procedure or a java stored or somethig beyond... if somebody has any example of this, ill thank it forever. im in my web app and i need to store some uploaded files in a specific directory /home/oracle/oracle/.../mydirectory, a...

Collation problem with Oracle linked to SQL Server

Hello everyone, On SQL Server 2000 there is a linked server to an Oracle 9.2 server. I am able to select from the remote tables, but all not latin (Greek) characters, return incorrect. I tried specifying a collation on the SQL Server, but nothing changed. ...

How to get the differences between two dates in Oracle which were in same column?

I need the difference between two dates in Oracle in terms of days in which the dates were in the same column. That is, the difference between two dates after order by that column. That is, after doing the order by, I need the difference between first two dates. ...

difference of date in sql and php

how can calculate (now) - (date in database) ...

How can i introduce multiple conditions in LIKE operator

I want to write similar SQL below select * from tbl where col like ('ABC%','XYZ%','PQR%'); i know it can be done using OR. But i want to know is there any better solution. ...

ORA-01861: literal does not match format string

Hi everybody, cmd.CommandText = "SELECT alarm_id,definition_description,element_id, TO_CHAR (alarm_datetime, 'YYYY-MM-DD HH24:MI:SS'),severity, problem_text,status FROM aircom.alarms WHERE status = 1 and TO_DATE (alarm_datetime,'DD.MM.YYYY HH24:MI:SS') > TO_DATE ('07.09.2008 09:43:00', 'DD.MM.YYYY HH24:MI:SS') order by ALARM_DATETI...

[SQL] Getting the sum of several columns from two tables

I want to get the sum of several columns from 2 different tables (these tables share the same structure). If I only consider one table, I would write this kind of query: SELECT MONTH_REF, SUM(amount1), SUM(amount2) FROM T_FOO WHERE seller = XXX GROUP BY MONTH_REF; However, I would like to also work with the data from the ...

Oracle connection/query timeout

Is it possible to specify connection/query timeout for the Oracle database queries? Either on Oracle side or in Oracle's JDBC driver (10.2.0.4)? So, that Java client just got an error back after, let's say, 2 minutes instead of waiting until Oracle finishes executing the query? ...

Groovy domain mapping

Hi! I have a to save a pdf report into an Oracle DB. The report's dataType is a byteArray. The domain definition is as follows: static constraints = { report(nullable:false) company(nullable:false) month(nullable:false) } byte[] report Company company Date month } Unfortunately this defines in the Oracle DB a field whic...

Finding the difference between 2 specific rows...

Hi I need to find the difference between 2 specific rows but cannot hack the LAG/LEAD functions and not sure if these functions can help. The row where dest=OM-OM_225 needs to be subtracted from the row where dest=OM-OM_20. Using Oracle 9i. Table is created using: SELECT TRUNC(DATETIME,'HH') DATETIME,decode(OBJECT_ID,20,'OM-OM_20'...

Oracle: problem with constructing JMS message

After some struggle with Oracle Advanced Queuing and dbms_aq package I encountered another issue. I copied code from Oracle tutorials but when I compile this code: create or replace procedure jms_test(msg varchar2) is id pls_integer; message sys.aq$_jms_stream_message; enqueue_options dbms_aq.en...

Simulation of long-running Oracle DB query

What is the simplest (preferably without any new table creation) way of running a database query which takes long time (at least several minutes) in Oracle DB? ...

Convert MS SQL script to Mysql and Oracle

One of the applications I develop gets installed locally on the customers site. This means that we have to support MySQL,MSSQL and Oracle as not all the customers use the same database engine. I'm writing a patch for the application, part of which involves executing a 5000 line sql script to make modifications to the database. The scrip...

Calling a web service from Oracle (10g) stored procedure

Hi All. Can anybody point me out on working example of calling web service (e.g. CXF based) from Oracle 10g stored procedure. ...

What can cause a materialized view in Oracle 10g to stop fast refreshing?

If I have materialized view in Oracle which is defined as REFRESH FAST ON COMMIT every 15 minutes. It works when initially created and refreshes happily. What can cause it to stop fast refreshing? I can see that it has stopped refreshing based on this: select mview_name, last_refresh_date from all_mviews; ...

In Oracle performance monitoring why does Scheduler activity goes up

What does scheduler mean in Oracle? Is it connection scheduling or query scheduling or the query plan execution scheduling or something else? ...

Oracle10g database/table Tuning

I am using Oracle Datbase 10g Standard Edition for my ASP.NET website. There i have one table which is going to populate with data on daily basis (around 10000 rows daily). The growth rate of data in that table is 100% i.e. every year the number of rows will increase previous plus 10000 rows. This is main table for reports like graphica...

Oracle Sql Update with values using foreign key?

Table 1: Name, x1-X2, fk1, fk2. Table 2: K1(parent for table 1),X How to update table 1 whose second column x1-x2 depands on fk1,fk2 from Table 2 Table1: a,1.0,1,2 b,-3.0,2,3 Table 2 1,4.0 2,5.0 3,2.0 ...