oracle

Django on Jython with Oracle: Too many open cursors

Hi. I am running Django on Jython with Oracle and I often get the famous "Too many open cursors" error. It never happens with the same code with Python and the cx_Oracle driver. Is there something wrong with the zxJDBC driver or perhaps there is a way to ask Django to close the cursors when I am done with the querysets? Thank...

Surrogate foreign key

Oki so I have two tables: person and person_email PERSON ------ id (PK) person_code (Unique key 1) person_type (Unique key 1) surname forename PERSON_EMAIL ------------ id (PK) person_id (Unique key 1) (references person(id)) email_address (Unique key 1) Is this correct?? or should it be: PERSON_EMAIL ------------ id (PK) person_i...

qt + oracle connecting problem

Hi, I'm trying to connect to my db in Oracle with the following code: #include "mainwindow.h" #include <QCoreApplication> #include <QtGui> #include <QtSql> int main(int argc, char **argv) { QCoreApplication myApp(argc, argv); QSqlDatabase db; db.addDatabase("QOCI"); db.setDatabaseName("RFV75"); db.setUserName("RFV...

How can I use an alias inside a sub-query?

What I am trying to achieve is to get the rows having the maximum value from a table of the following form: A | B | Ratio 0 | 1 | 1.0 1 | 2 | 1.0 2 | 3 | 1.0 3 | 4 | 0.33 4 | 5 | 0.25 I am trying to display only rows containing the maximum value (in this case 1.0). May be I am not doing this right. I have a query of the form: SELECT...

nested loop for retrieving specific row doesn't work

The below code doesn't work. The while loop doesn't display any values. If I change it to 0 and 150 it works fine. Please help me out here. Anything other than 0 doesn't retrieve any value. Using Oracle database. I tried using ORDER BY but it still doesn't work. ResultSet rset1 = stmt.executeQuery (" SELECT * FROM (SELECT * FROM iri...

How to handle optional parameters in SQL query?

Hi, guys. Say I have a sample table: id_pk value ------------ 1 a 2 b 3 c And I have a sample PL/SQL block, which has a query that currently selects a single row into an array: declare type t_table is table of myTable%rowtype; n_RequiredId myTable.id_pk%type := 1; t_Output t_table := t_table(); b...

implementation of package specifications

Where can be found implementations of built-in Oracle PL/SQL packages? For example, there can be found specification stdspec.sql with impl. stdbody.sql. But for package DBMS_ASSERT there is only spec. dbmsasrt.sql. Where can be found implementation? (using version 11.2) ...

sql tuning - with multiple joins

I recently read somewhere that one of ways of tuning sql query is - If it has too many joins then do one join with fewer tables and cache the results in a temporary table. Then do the rest of the query joining on that table. My question - How it will improve the performance, as you are joining same numbers of tables. (Only not together)...

How do you create a table with random number of fields in Oracle using PL/SQL?

I need to create a Oracle tables with random number of columns for load testing. I just want to specify number of columns with type NUMBER, number of columns with type VARCHAR2 etc and the fields should be generated automatically. Also, I will be filling up the tables with random data for which I will be using dbms_random. How can I ac...

Berkeley DB and C++ benchmark example?

Hi there! I'm trying to run benchmarks with a little berkeley db and c++ code, just for research purposes. Currently I'm testing with the following code. I'm filling the recors only with incrementing integers (I omitted things like error handling for better readability) (db is my own berkeley db class) // Open the database db.open( NU...

Oracle Instant Client with web application

I have a visual studio solution with an ASP.NET 3.5 web application (WCF host) and a test project. I wanted to use the Oracle Instant Client (v11, via NHibernate) to create Oracle connections without having the Oracle client tools installed on every "involved" machine (dev, CI server, test server, production server). The weird thing is ...

Database deletes failed during inserts

Hi, I have two java apps: one of them inserts records to Table1. Second application reads first N items and removes them. When 1st application inserts data intensive, 2nd failed when I try to delete any rows with CannotSerializeTransactionException. I don't see any problems: inserted items are visible in select/delete only when insert ...

bulk upload and trigger

Few of questions for bulk-bind and trigger (Oracle 10g) 1) Will row level trigger execute in case of bulk binding ? 2) If yes then, is there any option to surpress the execution only for bulk binding ? 3) If no then, is there a way to execute row level trigger in bulk binding ? 4) Will performance hamper in case row level trigger execut...

Replacing part of an Oracle package

I need to modify one procedure from within a package. I need to touch both the declaration and the implementation. As I am maintaining patch files for each modification, I would like the changes to be minimal. Can I update the package with just the changed procedure ( if yes, how ? ) , or do I need to supply the complete package definit...

EMPTY_CLOB() in Microsoft SQl server

Hey guys, Oracle has a CLOB type and the function EMPTY_CLOB(). I'm looking for an alternative for use in SQL server. Thanks in advance. ...

How show function code from package in ORACLE?

Hi, I have newbie question, what is best way to show function FUNCTION1 from package PACK ? DESC PACK.FUNCTION1 does not work :( Thanks ...

Generating a report in Oracle?

I am trying to generate a report using Oracle but am having some alignment problems. Is there a way to print values in particular columns? I am trying to achieve the following: --------------------------------------------------------- ColA ColB ColC ----- --------- --------- 1 2 1 2 4 ...

formatting (or supplying string to) exception's messages in oracle

There are parameterized error messages in Oracle database. For example, there is 01919, 00000, "role '%s' does not exist" in oraus.msg. If one issue some nonsense GRANT ... TO ... %s is substituted by this nonexistent privilege. It is possible to raise exception -1919 and supply some string to %s? Code: not_system_privilege EXCEPTION; ...

Does OR clause suppress indexes in oracle?

Does OR clause suppress Indexes, If yes can someone provide appropriate example? ...

How can I connect to ORACLE DB through ssh tunnel chain (double tunnel, server in company network) ?

Hi, I have SSH access to 'public' server, which is also the gateway to company network. There is another server in the network, where local ORACLE server is running (There is no access from outside of this server, only localhost DB connections are accepted). And of course, I have another SSH access to this server. Is there any way to j...