oracle10g

Oracle 10g: MIN/MAX column value estimation

Hello all, is it possible to retrieve statistics about the minimal or maximal value of a numeric column in Oracle 10g? I have found the table USER_TAB_COL_STATISTICS having a LOW_VALUE and HIGH_VALUE column, but I am not sure whether those are the values I am looking for. I need to find an efficient way to ask the DBS for those statist...

fetch from function returning a ref cursor to record

I have a function in a package that returns a REF CURSOR to a RECORD. I am trying to call this function from a code block. The calling code looks like this: declare a_record package_name.record_name; cursor c_symbols is select package_name.function_name('argument') from dual; begin open c_symbols; loop ...

Oracle - connection Pooling with spring framework

Hi, We are trying to implement Oracle connection pooling with the help of Spring Framework. We are using DBCP connection pooling method. However the integration between DBCP and spring doesn't go down that well. Problem that we face is that DBCP returns PoolableConnections Object while Oracle expects OracleConnection Objects. (Thorws C...

execute immediate over databse link

Is it possible to execute dynamic PL/SQL on a remote database via a databse link? I'm looking for something like: l_stmt := 'begin null; end;'; execute immediate l_stmt@dblink; The syntax above is obviously wrong, I get PLS-00201: identifier 'L_STMT@DBLINK' must be declared. It is possible to create a procedure remotely and then exe...

calling a stored proc over a dblink

I am trying to call a stored procedure over a database link. The code looks something like this: declare symbol_cursor package_name.record_cursor; symbol_record package_name.record_name; begin symbol_cursor := package_name.function_name('argument'); loop fetch symbol_cursor into symbol_record; exit w...

How to increase Oracle CBO cost estimation for hash joins, group by's and order by's without hints

It seems that on some of the servers that we have, the cost of hash joins, group by's and order by's is too low compared to the actual cost. I.e. often execution plans with index range scans outperform the former, but on explain plan the cost shows up as higher. Some further notes: I already set *optimizer_index_cost_adj* to 20 and it...

Problem with Date in Oracle using JDBC

I've the following scenario: Two computer: First computer running under Windows Vista, second computer running under Linux, connecting both to Oracle 10g. Oracle 10g is running in the second computer. I've have done one test program in Java that conecting to Oracle using ojdbc14.jar This test program is only connecting to database, re...

Does Oracle 10g automatically escape double quotes in recordsets?

I am encountering an interesting issue with an application that was migrated from Oracle 9i to 10g. Previously, we had a problem when a field contained double quotes since Oracle recordsets encapsulated fields in double quotes. Example: "field1"||"field2"||"field "Y" 3"||"field4" Since the move to 10g, I believe that the Oracle client-...

How do I find all code, triggers from an oracle database that relate to specific tables?

I have a problem where I need to remove all code and triggers from a database that relate to certain tables in order for a Solaris package to install. Long complicated story but I need to start with a clean slate. I've managed to remove all the existing tables/synonyms, but how to locate the code/triggers from sqlplus that is related? ...

Is it safe/possible to delete code from the table dba_source in Oracle 10g?

Having located some code that needs to be removed from a database that relates to a specific module. Is it safe to remove it from dba_source directly? i.e. delete from dba_source where name = 'MODULE_NAME'; Or do I have to grab all the procedure and package names and drop those specifically? ...

What causes a JDBC Type 91 error

This seems like a simple question but if you Google it there isn't much help. I have a web app being hosted on BEA Weblogic 10.x with an Oracle 10g database back end. It works perfectly with one database, but when we make a clone of it and try to use a different WebLogic and Oracle instance we are getting this JDBC Type 91 error every t...

Returning multiple ref cursors from Oracle Procedure using DAAB & C#

I want to return data from an Oracle procedure to populate some Label controls. The procedure accepts 26 input parameters (search variable) and returns 3 output cursors. I have been successful returning data from a procedure which returns a single ref cursor using OracleCommand, a DataAdapter, and a DataSet, but have been having all kin...

Oracle - return newly inserted key value.

We have a table with a Primary Key that gets populated on insert by a trigger on the table - the trigger gets the next sequence number from a sequence we created for the table and uses that for the value of the key on insert. Now we would like to be able to return that value in our insert procedure (PL\SQL), similar to select @@scope_ide...

Connection for Oracle database with C# form

Hi, I making a Oracle 10g express edition database in my fedora which is running on virtual machine.I want to create a shipping form in windows Xp which will access that Oracle database running on vmware.I tried using SQLCLient.I have no idea which Connection string i should use. Please help... ...

Track changes on a database

I am not sure whether this has been asked before; I did a few searches but nothing appropriate showed up. OK, now my problem: I want to migrate an old application to a different programming language. The only requirement we have is to keep the database structure stable. So no changes in my database schema. For the rest of the applicatio...

Oracle query fired off, then never returns

I have this problem in my ASP.NET application where I'm seeing some of my Oracle queries fired off to the server then not returning. Ever. It happens in several places in my app and I can't explain it. Here's one specific scenario where I'm seeing this behavior: During application start-up I am pre-fetching data asynchronously into the ...

Computing percentage change between tables

Hi, I'm a novice to SQL scripting. I am trying to figure out a design problem, involving some arithmetic computation. I have two tables temp1 and temp2 with two columns account no., ( Common in both tables ) balance ( float data type ). I want to compare the balance columns in temp1 and temp2. print out the no. of accounts and percen...

I want to set the query result as minvalue

Lets consider Result of this query may 22 Ie., (Select max(screen_id)+1 from table_screen) = 22 create sequence SEQ_TEST minvalue SELECT MAX(SCREEN_ID)+1 FROM TABLE_SCREEN start with 25 maxvalue 999999999999999999999999999 increment by 1 nocache; How to set the result of a query to a minvalue in sequence?? ...

How to rollback OracleBulkCopy() inserted rows?

Hello, I have tried to roll back external transaction and also tried to abort OracleBulkCopy() but it still inserted all rows. Anyone knows how to do this? Case 1: Didn't work. All row inserted anyway. OracleConnection connection = new OracleConnection(ConnectionString); connection.Open(); OracleTransaction trans = connection.BeginTra...

Creating tables with fields from 2 different tables

I want to create a table that stores values from two different tables; From table 1: cust_id (varchar2), invoice_amt (float) From table 2: cust_id (from table 1), payment_date My table should have 3 fields: cust_id, invoice_amt, payment_date I tried the following, which is obviously wrong. create table temp1 as ( selec...