oracle

How do you Send More that 20 Parameters to a Stored Procedure Using ODP.Net?

Switching from Microsofts Oracle Driver to ODP.NET version 10.2.0.100. After changing the data types to OracleDBTypes in a procedure, that worked perficetly using System.Data.OracleClient, the procedure fails if we try and pass in more that 20 parameters. The error returned is: ORA-06550: line 1, column 7: PLS-00306: wrong number o...

Oracle - truncating a global temporary table

I am processing large amounts of data in iterations, each and iteration processes around 10-50 000 records. Because of such large number of records, I am inserting them into a global temporary table first, and then process it. Usually, each iteration takes 5-10 seconds. Would it be wise to truncate the global temporary table after each ...

Checking for Error during execution of a procedure in oracle

create or replace procedure proc_advertisement(CustomerID in Number, NewspaperID in number, StaffID in Number, OrderDate in date, PublishDate in date, Type in varchar, Status in varchar, Units in number) is begin insert into PMS.Advertisement(CustomerID, NewspaperID, StaffID, OrderDate, PublishDate, Type, Status, Units) valu...

How to extent activrerecord,just make id to id.to_i

module ActiveRecord module Mixin alias old_id id def id old_id.to_i end def hello "hellooooooooooooo" end end end ActiveRecord::Base.send :include, ActiveRecord::Mixin I make is because: id column in oracle is number type,not number(10), @user.id return 123.0,not 123,so I would like to do it b...

Oracle TNS problems ?

I have an error ? My pl/Sql Developer says my oracle database cannot find the service descriptor But when I Do a check the listener I get this error. LSNRCTL> start Starting tnslsnr: please wait... Service OracleOraDb10g_home1TNSListener already running. TNS-12560: TNS:protocol adapter error TNS-00530: Protocol adapter error LSNRCT...

How can I get a COUNT(col) ... GROUP BY to use an index?

I've got a table (col1, col2, ...) with an index on (col1, col2, ...). The table has got millions of rows in it, and I want to run a query: SELECT col1, COUNT(col2) WHERE col1 NOT IN (<couple of exclusions>) GROUP BY col1 Unfortunately, this is resulting in a full table scan of the table, which takes upwards of a minute. Is there any...

wm_concat function and small characer buffer

Hi, i have select like: select substr(account,1,4), currency, amount, module,count(*) quan, wm_concat(id) ids from all_transactions group by substr(account,1,4), currency, amount, module But sometimes COUNT(*) is more then 600. In that case i get: 'ORA-06502: PL/SQL: : character string buffer too small' Is there any way out to keep w...

Exporting collections

Hi, have select like select trn_dt,collect(ac_no) from transactions where rownum < 1000 group by trn_dt i'm doing it in SQL Navigator. But i can't export results! Table collect(ac_no) is not exported. Is there any way out? ...

Oracle PL/SQL UTL_SMTP raising a 501 5.1.7 Bad sender address syntax

When I send e-mails using the package UTL_SMTP I am getting this error when executing the comand UTL_SMTP.MAIL: 501 5.1.7 Bad sender address syntax I am passing olny the e-mail as second parameter. This occurs only with certain smtp servers. The code is this: sFrom := '[email protected]'; Utl_Smtp.Mail(Connection, sFrom); Does a...

Fill in missing values in a SELECT statement

I have a table with two columns, customer id and order. Let's say I have in total order IDs 1,2,3,4 All the customer can have all the four orders, like below: 1234 1 1234 2 1234 3 1234 4 3245 3 3245 4 5436 2 5436 4 You can see above that 3245 customer doesn't have order id 1 or 2. How could I print in ...

sql query problem

why this query give me an error:ORA-01790 SELECT TO_CHAR(logical_date,'MM') MONTH FROM logical_date WHERE logical_date_type='B' UNION SELECT TO_CHAR(logical_date,'MM')+1 MONTH FROM logical_date WHERE logical_date_type='B' but when i run them separately,they give the proper output. ...

Oracle performance problems with large batch of XSL operations

I have a system that is performing many XSL transformations on XMLType objects. The problem is that the system gradually slows down over time, and sometimes crashes when it runs out of memory. It seems that the slow down (and possibly memory crash) is around the dbms_xslprocessor.processXSL function call, which gradually takes longer and...

How to resolve "TNS-12520 TNS:listener could not find available handler for requested type"?

I have brand new MacBook Pro (Mac OS 10.6.3) and installed Oracle's SQLDeveloper. After doing so, I set the connection and was connecting just fine. But after an hour or so I got "TNS-12520 TNS:listener could not find available handler for requested type". I wonder how can I fix it? ...

Why do these seemingly similar queries have such drastically different run times?

I'm working with an oracle DB trying to tune some queries and I'm having trouble understanding why working a particular clause in a particular way has such a drastic impact on the query performance. Here is a performant version of the query I'm doing select * from ( select a.*, rownum rn from ( select * fro...

Best way to migrate export/import from SQL Server to oracle

Hi guys! I'm faced with needing access for reporting to some data that lives in Oracle and other data that lives in a SQL Server 2000 database. For various reasons these live on different sides of a firewall. Now we're looking at doing an export/import from sql server to oracle and I'd like some advice on the best way to go about it......

oracle display for every stored procedure the execution time

Hi all. I'm working on a stored procedure. Inside this one, there are many call to the other stored procedures. There are a bunch of them. I was wondering if there is a option to be able to have the execution time of every stored procedure involved, every function (with a start and end time, ior something like that). The idea is that ...

How to enforce DB field size limit to related Java String?

What is the correct way to defend against trying to store more text than can be accommodated in a VARCHAR2 database field? Say the PARTNER_ROLE field of the REGISTRATIONS table is declared as VARCHAR2(80). This field is mapped in the Registration class in Java as public class Registration { @Column(name=”PARTNER_ROLE” length=”80”) ...

Table transformation / field parsing in PL/SQL

I have de-normalized table, something like CODES ID | VALUE 10 | A,B,C 11 | A,B 12 | A,B,C,D,E,F 13 | R,T,D,W,W,W,W,W,S,S The job is to convert is where each token from VALUE will generate new row. Example: CODES_TRANS ID | VALUE_TRANS 10 | A 10 | B 10 | C 11 | A 11 | B What is the best way to do it in PL/SQL without u...

VS 2010 Server Explorer Database Showing No Tables

I'm working on a .Net application that needs to read from an Oracle 10g database behind Siebel. In VS 2010 Server Explorer, I've created a connection using the OracleClient type connector with a reference to the Oracle TNS service name as the "server name." The "Test Connection" button shows that the connection is successful. However,...

Nhibernate Complex Type binding

I have two oracle user defined types: Audit_Type – A normal object with two fields a string and a number Audit_Table_Type – A table of audit_types, (an array) I have a stored procedure that takes as a parameter an Audit_Table_Type. List<Audit_Type> table = new List<Audit_Type>(); var query = session.CreateSQLQuery("call Audit_Rows(A...