oracle

Selecting all rows untill first occurence of given value

Hi, For following data: date|value|check 2009 | 5 | 1 2008 | 5 | 1 2007 | 5 | 1 2006 | 5 | 0 2005 | 5 | 0 2004 | 5 | 1 2003 | 5 | 1 2002 | 5 | 1 I need to select all rows from 2009 back until first occurrence of 0 in check column: date|value|check 2009 | 5 | 1 2008 | 5 | 1 2007 | 5 ...

Is there an Oracle SQL tool that builds insert statements from a result set?

Is there an Oracle SQL tool that builds insert statements from a result set? We are currently only allowed to use a tool called SQL Station. I'd like to either suggest a tool, like Rapid SQL or CrazySQuirrell, or build my own re-usable chunk of sql. ...

Unable to create a simple view on Oracle table

An external DB admin guy exported a production database and imported it into test environment. We are using Oracle 9.2. Majority of imported database objects (tables, views, idexes, packages,...) works fine, but we have problems with three specific tables: we can do SELECT,UPDATE, DELETE on those tables, but we can not create views on ...

When are two columns that look the same not the same in oracle?

I am work on a project in oracle 9i. I was having a problem with toplink 10.1.3 loading a particular row in a table. It turns out the jdbc driver that toplink is relying on is acting very funny. Perhaps someone here can help... I have a table named: crazytable. It has a column: "ver_num number(19) not null default 0". This column w...

Strange behaviour when accessing Oracle 8i table from servlet

Hi there, First a little background, I'm using jdk 1.6. I've got a 2 column table in an Oracle 8i DB that holds a very simple code to word map. There are no strange characters. Both columns are varchar. From my desktop machine, when I execute the the following: OracleDataSource ods = new OracleDataSource(); ods.setDri...

Suggest a book on Oracle Application Framework

Hello, everyone. Suggest me a book on Oracle Application Framework, please. OAF is not Oracle ADF. ...

Getting started with Oracle application development

I am not sure if I am getting in a little too deep but I have decided i'd like to learn how to develop applications built using the Oracle technology stack. I don't come from a programming background (I have always been on the business side) but I love that no matter what problem you encounter, you can almost always solve it with a prog...

Retrieve value of an xml element in Oracle PL SQL

Does anybody know how to retrieve the values of <ZIPCODE> and <CITY> using PL/SQL? I have followed a tutorial over the net, however, it can retrieve the element names, but not their values. Any of you know what seems to be the problem? I have already consulted Google (the internet's well kept secret) over this but no luck :( <Zipcodes>...

What is wrong with Cursors ?

Hi, SQL Server developers consider Cursors a bad practise , except under some circumstances. They believe that Cursors do not use the SQL engine optimally since it is a procedural construct and defeats the Set based concept of RDBMS. However, Oracle developers do not seem to recommend against Cursors. Oracle's DML statements themselve...

Oracle merge partition from procedure giving error

CREATE OR REPLACE PROCEDURE test AS sql_stmt VARCHAR2(200); BEGIN sql_stmt := 'ALTER TABLE daily_table PARTITIONS p1 , p2 into PARTITION p2'; EXECUTE IMMEDIATE sql_stmt; END ; / The above procedure is giving me the following error - ORA-01031: insufficient privileges ORA-06512: at "test", line 8 ORA-06512: at l...

How to reuse dynamic columns in an Oracle SQL statement?

I try to reuse some columns that I calculate dynamically in Oracle SQL, something like SELECT A*2 AS P, P+5 AS Q FROM tablename Where 'tablename' has a column called 'A', but no other colums. This gives me an ORA-00904: "P": invalid identifier I know how to work around this by using a subquery like SELECT P, P+5 AS Q FROM ...

What's the smallest footprint necessary to use an unmanaged Oracle provider?

I'm working on an application written in .NET. We are currently using ODP.NET 11's xcopy deployment for all of our .NET operations and everything is peachy - we can run on machines with no Oracle client previously installed. Peachy, that is, until we came to the part of the application which depends on a library written in COM, which o...

How do I improve performance of a SQL UPDATE statement whose SET involves an expensive aggregate subquery?

I have the following UPDATE scenario: UPDATE destTable d SET d.test_count = ( SELECT COUNT( employee_id ) FROM sourceTable s WHERE d.matchCode1 = s.matchCode1 AND d.matchCode2 = s.matchCode2 AND d.matchCode3 = s.matchCode3 ...

OleDb vs DataReader When Reading Data From Oracle

Is it faster to use 1 type of provider over the other? We are using SSIS (SQL Server 2005) to pull some data from Oracle and import it into SQL Server. It was my understanding that OLEDB is faster, because the connection is native, and the data isn't being run through any .NET code? Is this correct? ...

Refer to other SQL SELECT statements aliased as tables in FROM clause

I have a very large query that follows the format below: select ... from ( select field1, field2 from some_table ) table1, ( select field1, field3 from other_table ) table2 where ..... Is is possible for me to refer to one of the tables "defined" in the from clause, lets...

Oracle Lite - Cannot connect to newly created DB. [POL-3013]

I get an error when I try to connect to my newly created Oracle Lite database. But I can connect to the orabpel DB that was created with the Oracle SOA install. Here are the steps I took to create it: Ran: createdb polite db1 manager Result: Oracle Lite CREATEDB Version 10.2.0.2.0. Copyright (c) 1997, 2005, Oracle. All rights reserv...

Database agnostic table/view export software?

Trying to search for a more elegant/overall solution to our common/basic data export tasks I am convinced that there must be software out there that allows me to: Define and persist a "setup" (definition of file format, delimiters, encoding, column names etc) from a GUI Run on a schedule/from command line Work on both Oracle and MSSql...

Oracle in-line method to produce CSV for relation

I have the following tables: ALERT (ID,Name) 1 | Alert A 2 | Alert B ALERT_BRAND_XREF (ALERT_ID, BRAND_ID) 1 | 1 1 | 2 2 | 1 BRAND (ID, NAME) 1 | Brand A 2 | Brand B I am trying to write one statement to return a list of alerts with the applicable brands as a CSV list in one field. Desired results: Al...

Learning Oracle for the first time

I am a very experienced MS Sql developer, and a few new job positions are coming my way where I will be working with Oracle on a more daily basis. As with all the technologies I have learned, I want to know the best places and books to get started and up to speed with designing and developing with Oracle, but with pure C#. What resourc...

Dynamic PL/SQL

In PL/SQL,I would like to pass a source as well as the target schema as a parameter to a stored procedure. For source we can use: PROCEDURE select_from_schema( the_schema VARCHAR2) IS TYPE my_cursor_type IS REF CURSOR; my_cursor my_cursor_type; BEGIN OPEN my_cursor FOR 'SELECT my_field FROM '||the_schema||'.my_table'; -- Do y...