oracle

Combining multiple rows into one row, Oracle

Hi. I'm working with a database which is created in Oracle and used in a GIS-software through SDE. One of my colleuges is going to make some statistics out of this database and I'm not capable of finding a reasonable SQL-query for getting the data. I have two tables, one with registrations and one with registrationdetails. It's a one to...

Java - creating an oracle date field

I have an Oracle Date type to which I need to insert the current date. I am using Java to generate this date but everything I've tried so far yeilds the following error: java.sql.SQLException: ORA-01843: not a valid month Can anyone suggest java code to generate a proper date? Update: The dates in the DB look like 11-DEC-06 SO, I'...

Getting all rows from a Table where the column contains only 0

I got a little problem i need a sql query that gives all rows back that only contains 0 in it. the column is defined as varchar2(6) the values in the column looks like this: Row Value 1 0 2 00 3 00 4 100 5 bc00 6 000000 7 00000 my first solution would be like this: Oracle: subst...

The entity framework and database agnostic programming, possibilities?

We want to use the Entity Framework (.NET 4.0) to build applications that can deal with Sql Server, MySQL and Oracle. And maybe Sqlite too. It should be easy to switch the db vendor by some setting in a config file. Is this possible? I prefer real life examples! What kind of providers did you use? ...

oracle global temporary tables

I created the global temp table. when I execute the code as an individual scripts it works fine. but when I execute it as a single script in TOAD then no record was created. there was just an empty global temp table. eg. CREATE GLOBAL TEMPORARY TABLE TEMP_TRAN ( COL1 NUMBER(9), COL2 VARCHAR2(30), COL3 DATE ) ON COMMIT PRESERVE ROWS / ...

devArt's dotConnect for Oracle vs. ODP.net/OCI performanc.

Does anybody have any experience going from ODP.net to devArt's dotConnect for Oracle? Some initial testing is showing Direct Connect in 64bit dotConnect running 30% slower at times than our original ODP.net/OCI 32 bit solution. Trying to determine if that's normal or if something may be wrong in my testing approach. Thanks! ...

How Oracle 10g evaluates NULL in boolean expressions

if not (i_ReLaunch = 1 and (dt_enddate is not null)) How this epression will be evaluated in Oracle 10g when the input value of the i_ReLaunch = null and the value of the dt_enddate is not null it is entering the loop. According to the rules in normal c# and all it should not enter the loop as it will be as follows with the values. ...

ORACLE: can we create global temp tables or any tables in stored proc?

Hi, below is the stored proc I wrote: create or replace procedure test005 as begin CREATE GLOBAL TEMPORARY TABLE TEMP_TRAN ( COL1 NUMBER(9), COL2 VARCHAR2(30), COL3 DATE ) ON COMMIT PRESERVE ROWS / INSERT INTO TEMP_TRAN VALUES(1,'D',sysdate); INSERT INTO TEMP_TRAN VALUES(2,'I',sysdate); INSERT INTO TEMP_TRAN VALUES(3,'s',sy...

what if system crashes when i type SQL command

I have some doubt as follows We are UPDATING a field in SQL and ALTER the row also.After giving the COMMIT command the system is crashed.Wat will happen to the commands given,whether it will UPDATE and ALTER the table r not? ...

Oracle vocabulary, what is the mysql/SQL Server equivalent of a database

Hi, I need some help with vocabulary, I don't use Oracle that often but I am familiar with MySQL and SQL Server. I have an application I need to upgrade and migrate, and part of the procedure to do that involves exporting to an XML file, allowing the installer to create new database tables, then import to the new database tables from ...

Oracle - Determine maximum supported size for regular expression

I have a regular expression that throws ORA-12733, "regular expression is too long". How do I determine what the maximum supported size is? FYI: the offending regex is 892 characters. It's a generated regex, so I could change how I generate and execute it, but I would like to know what the limits to the max size are before I change how ...

How do I get every nth row in a table, or how do I break up a subset of a table into sets or rows of equal size?

I have a table of heterogeneous pieces of data identified by a primary key (ID) and a type identifier (TYPE_ID). I would like to be able to perform a query that returns me a set of ranges for a given type broken into even page sizes. For instance, if there are 10,000 records of type '1' and I specify a page size of 1000, I want 10 pair...

Update multiple table column values using single query

How would you update data in multiple tables using a single query? MySQL Example The equivalent code in MySQL: UPDATE party p LEFT JOIN party_name n ON p.party_id = n.party_id LEFT JOIN party_details d ON p.party_id = d.party_id LEFT JOIN incident_participant ip ON ip.party_id = p.party_id LEFT JOIN incident i ON ip.incident_id = i.i...

Global Temporary Table "On commit delete rows" functionality discrepancy.

I have a global temporary table. I shall call him GTT, for that was it's initials. My GTT never hurt anyone, and did everything I bade of it. I asked my GTT to delete rows on commit. This is a valid function in the creation script of my GTT in oracle. I wanted to be able to have different users see GTT with their own data, and not the ...

PL/SQL profiler missing data

We are using pl/sql profiler to collect metrics. We noticed that on one of the environment the plsql_profiler_runs table is populated with the total execution time but the finer details that gets collected in the table plsql_profiler_data is missing. Any idea why this would be happening? We do use dbms_profiler.flush_data() before stopp...

How to duplicate all data in a table except for a single column that should be changed.

I have a question regarding a unified insert query against tables with different data structures (Oracle). Let me elaborate with an example: tb_customers ( id NUMBER(3), name VARCHAR2(40), archive_id NUMBER(3) ) tb_suppliers ( id NUMBER(3), name VARCHAR2(40), contact VARCHAR2(40), xxx, xxx, archive_id NUMBER(3...

Table of Oracle DB versions supported by newest ODBC driver

I want to know which ODBC driver version is recommended for Oracle 9 and 10. Is there official Oracle document that says that newest version of Oracle ODBC driver can or even should be used with older servers? ...

Can compilation of several Oracle Pl/SQL package be an atomic operation?

If I deploy N pl/sql packages to Oracle DB, can I make their compilation atomic i.e. the changes in these packages will be applied after the successful compilation of all packages? ...

Is there an automatic way to generate a rollback script when inserting data with LINQ2SQL?

Let's assume we have a bunch of LINQ2SQL InsertOnSubmit statements against a given DataContext. If the SubmitChanges call is successful, is there any way to automatically generate a list of SQL commands (or even LINQ2SQL statements) that could undo everything that was submitted at a later time? It's like executing a rollback even though ...

cx_Oracle and output variables

I'm trying to do this again an Oracle 10 database: cursor = connection.cursor() lOutput = cursor.var(cx_Oracle.STRING) cursor.execute(""" BEGIN %(out)s := 'N'; END;""", {'out' : lOutput}) print lOutput.value but I'm getting DatabaseError: ORA-01036: illegal variable name/number Is...