oracle

Oracle problems in Rails with rake, but not with site

Hi guys, I'm working on a Rails site that connects to an Oracle database, and though I didn't build the site from scratch, I'm doing maintenance work. The site uses the delayed_jobs plugin to handle some background tasks and I'd like to be able to run rake jobs:work on the development server to periodically process all jobs in the queu...

Hibernate with Oracle JDBC issue

I have a select query which takes 10 min to complete as it runs thru 10M records. When I run thru TOAD or program using normal JDBC connection I get the results back, but while running a Job which uses Hibernate as ORM does not return any results. It just hangs up ...even after 45 min? Please help ...

Troubleshooting ORA-00942

In the middle of an automated test run last night, one of my twenty worker threads blew out; the application was attempting an INSERT. Springframework reports ORA-00942: table or view does not exist. Connecting to the database (11.1.0.6.0) through the enterprise manager, I pull up a SQL worksheet and query the table, discovering (a) th...

Oracle Event Count Query

My SAMPLE table has the following five columns: sample_id (PK) (NUMBER) sampled_on (DATE) received_on (DATE) completed_on (DATE) authorized_on (DATE) I would like a query with one row per hour (constrained by a given date range) and five columns: The hour YYYY-MM-DD HH24 Number of samples sampled during that hour Number of samples r...

Outer join in classic Oracle join syntax

Hello, I need to convert my query to classic Oracle join syntax because I need to put it in a materialized view. However, I'm not quite sure how to do it: SELECT * FROM transactions t LEFT JOIN transac_detail td1 ON (t.id = t1.trans_id AND t.ttype = 'VOICE') LEFT JOIN transac_detail td2 ON (t.id = t2.trans_id AND t.ttype = 'BROADBAND')...

ORA-04091 on Create or Replace Trigger xxx Before Insert of Update on xxx

Can someone help me correct the Trigger below? I am assigned this problem but my technical skill is limited. My script hit the error below (ORA 4091): Processing STANDARD PO Number: 27179 ...................................... Updating PO Status.. Done Approval Processing. dist id 611294gl amount 10000.88 bill_del_amount 0 l_amoun...

Best Java data structure to store a 3 column oracle table? 3 column array? or double map?

Hello :) What is the best data structure to store an oracle table that's about 140 rows by 3 columns. I was thinking about a multi dimensional array. By best I do not necessarily mean most efficient (but i'd be curious to know your opinions) since the program will run as a job with plenty of time to run but I do have some restrictions...

Change Oracle JDBC Thin Client Identifier

When connecting to Oracle the JDBC driver identifies itself as "JDBC Thin Client" to Oracle (in v$session as the 'program'). There is also a 'ClientInfo' column in v$session that might be used for this, but it's always empty. We have a need to identify different applications connecting to Oracle (which are running on the same host, so t...

Oracle 10g EX / NCLOB - seems NLS_NCHAR_CHARACTERSET is ignored?

I am running Oracle Database 10g Express Edition Release 10.2.0.1.0 in a dev environment with the following NLS settings: NLS_CHARACTERSET WE8MSWIN1252 NLS_NCHAR_CHARACTERSET AL16UTF16 Used clients are either PHP with oci8 extension or the Oracle SQL Developer, using both ended up in this behaviour which I don't understand: I had rece...

Power failure and Oracle data recovery

Database is OracleXE and here is the problem: data gets entered in tables UPS does not survive power shock Oracle server reboots after power failure everything seems normal after some time we realize that some data is missing from few tables (this is ok, because all inserts happened in one transaction), and some data seems like half-c...

ANSI joins versus "where clause" joins

Hello, I develop against Oracle databases. When I need to manually write (not use an ORM like hibernate), I put join statements in the where clause sections. for example (this is simplistic just to illustrate the style): Select * from customers c, invoices i, shipment_info si where c.customer_id = i.customer_id and i.amount > 99...

Is use of DBMS_LOB necessary when returning CLOB from PL/SQL procedure?

I would like to create some PL/SQL procedures that return XML as CLOB parameters. I want to just do this (which works fine with simple tests): create or replace procedure p_xml_test_1( p_xml out nocopy clob ) is begin p_xml := '<?xml version="1.0" encoding="utf8" ?>' || '<test><something>some value</something></test>'; end p_xml...

Liquibase noob strikes again - Error on sqlFile tag.

Hi, Im using the sqlFile to include an sql script that creates tables using oracle specific commands (NOCACHE, NO PARALLEL, stuff like that). My master.xml file includes all sql scripts and executes them. However, when it detects a tag, it fails and prints this error message. C:\update.bat master.xml Migration Failed: cvc-complex-type....

Is there an automatic modification time stamp type for Oracle columns?

Is there a way to create a timestamp column in Oracle that automatically stores a timestamp of when the record has changed ? ...

how to use COALESCE in oracle to combine data from two rows

I have the following query which is inside a loop and is breaking SELECT COALESCE(v_user_grade || ', ', '') || user_grade INTO v_user_grade FROM EXPIRATION_HISTORY__2 WHERE hist_id = v_test; So basically in each iteration of the loop we get a new value for v_test. In some cases this query would return...

Query Oracle DB for timestamps when you know milliseconds

Hi, I'm currently getting the error: "java.sql.SQLException: ORA-01843: not a valid month" which I assume is to do with the way I am setting a timestamp... So I have a query like this : select * from A_TABLE where A_TIMESTAMP_COL < '1252944840000' But it doesn't work...and I don't want to have to convert it to a date ideally. Is the...

is there a way to do multiple left outer joins in oracle?

Why wont this work in oracle? is there a way to make this work? FROM table1 a, table2 b, table3 c WHERE a.some_id = '10' AND a.other_id (+)= b.other_id AND a.other_id (+)= c.other_id I want table1 to be left outer joined on multiple tables... If I try to change it to ANSI join I get compilation errors. I did the following:...

Modify PL/SQL statement strings in C++

Hello all, This is my use case: Input is a string representing an Oracle PL/SQL statement of arbitray complexity. We may assume it's a single statement (not a script). Now, several bits of this input string have to be rewritten. E.g. table names need to be prefixed, aggregate functions in the selection list that don't use a column ali...

Package Level Constants in Oracle to Postgres Conversion

I am looking at converting an application from Oracle to Postrges that has all the business logic in the database. Currently there is a very large package that has about 200 public constant variables. Postgres does not support package level variables so I am debating how to convert it. I see two possibilities but need some opinions about...

Read SQL File in Resources RESX and Create TAbles, Insert Rows with Oracle ODP.NET

Hi all, i need good sample code C# or VB.NET , frk 3.5 for this tasks: Read SQL (Oracle) File from Resources RESX and do: create TAbles, Insert Rows using Oracle ODP.NET Thanks in advance ...