oracle

Oracle sql types over dblink

I have two schemas: A and B (Oracle 9). At the A there is a dblink to B. At the B there is a package, that i calls from A. Procedures in B package can returns varying count results and i think that returning a collection is a better way for this reason. create type B.tr_rad as object ( name varchar2(64) ,code number ,vendor ...

Oracle SYS_GUID does not change

I have an Oracle project that would be a good fit for using GUIDs as a key. I found the following snippet SET SERVEROUTPUT ON BEGIN FOR indx IN 1 .. 5 LOOP DBMS_OUTPUT.put_line ( SYS_GUID ); END LOOP; END; / From http://feuerthoughts.blogspot.com/2006/02/watch-out-for-sequential-oracle-guids.html When I run it against my database (I ...

How do I spool to a CSV formatted file using SQLPLUS?

I want to extract some queries to a CSV output format. Unfortunately, I can't use any fancy SQL client or any language to do it. I must use SQLPLUS. How do I do it? ...

Invalid scale size. Cannot be less than zero

I am using spring-2.5.6 to connect from a standalone application to an Oracle 10g database (ojdbc14.jar) using the org.apache.commons.dbcp.BasicDataSource. When I try to retrieve a SqlRowSet using the public SqlRowSet queryForRowSet(String sql, Object[] args) throws DataAccessException method I am getting an 'java.sql.SQLException: Inval...

Oracle: how to run a stored procedure "later"

We have a system that allows users interfacing data into the database to set up various rules that are used to alter data before it is merged in to the main table. For example, an order might have a rule that sets up what delivery company to use based on a customer's address. This is originally intended to operate only on the data being...

Mixing ON and USING within one join

Is there a way to do the following in Oracle: SELECT * FROM Tbl1 JOIN Tbl2 USING (col1) AND ON Tbl1.col2 = Tbl2.col3 ...

Deleting a LOT of data in Oracle

I am not a database person, exactly, and most of my db work has been with MySQL, so forgive me if something in this question is incredibly naive. I need to delete 5.5 million rows from an Oracle table that has about 100 million rows. I have all the IDs of the rows I need to delete in a temporary table. If it were a just a few thousand r...

Best tool to convert my SQL Server database to Oracle

I need a tool that will convert my SQL Server database to Oracle 10. A have found many of them but which is best? ...

Implementing an Application in PL/SQL

We're developing a web application which according to my spec must have the backend written entirely in PL/SQL (stored procs etc.). Anyone have any advice/links on how to write a well structured backend using stored procedures and custom types? Normally I would have a business layer where all this would happen but what the employer wants...

How to execute an .SQL script file using c#

Hi I'm sure this question has been answered already, however I was unable to find an answer using the search tool. Using c# I'd like to run a .sql file. The sql file contains multiple sql statements, some of which are broken over multiple lines. I tried reading in the file and tried executing the file using ODP.NET ... however I don't ...

ASP Membership Odd Problem

I am using the Membership API in ASP .NET and I have encountered the following problem on my staging server. The application works fine on my local machine. The data tables are stored on a SQL Server. Both my local and staging server point to the same DB server. When I deploy to my staging server I get the following error: Parser E...

Formatting an SQL numeric query result with an arbitrary number of decimal places

I have a database table with these two columns: Amount: numeric (18,0) DecimalPlaces: numeric (18,0) This table can store amounts in various currencies, with the decimal place removed from the amount (I can't change this data model). For example, there might be two rows like this: 1290, 2 (This is £12.90, needs to appear as "12.90"...

Why use Oracle Application Express for web app?

Hi all. I believe we're moving to Oracle Apex for future development. I've read about Oracle Apex on wikipedia and it's pro and con. It seem to me the con outweigh the pro but maybe I'm wrong. I get the sense that Oracle Apex is for DBA with little or no programing knowledge to setup a web app quickly sort like MS Access for none program...

Oracle converts empty string to null but JPA doesn't update entity cache correspondingly

It's a well known fact, that Oracle treats empty strings as null. However, I'm having an issue because of this behaviour due to JPA's caching. First I persist using JPA (Toplink Essentials) an entity, which has an empty string as one field. Oracle converts this value to null when it stores it. However, when I fetch the entity, JPA see...

Beginner's book for PL/SQL programming?

Suggestion for PL/SQL programming book ...

Oracle Import errors

I'm trying to make an import of a database but I get this error: Imp-00009 Abnormal end of export file Imp-00020 Long column too large for column buffer size(7) The import creates four tables and creates the rows for three of them, I guest that when the import tries to create the rows for the last table is when I get the error. I try ...

Oracle Backup Database with sqlplus it's possible?

I need to do some structural changes to a database (alter tables, add new columns, change some rows etc) but I need to make sure that if something goes wrong i can rollback to initial state: All needed changes are inside a SQL script file. I don't have administrative access to database. I really need to ensure the backup is done on ser...

Database history for client usage

Hey, I'm trying to figure out what would be the best way to have a history on a database, to track any Insert/Delete/Update that is done. The history data will need to be coded into the front-end since it will be used by the users. Creating "history tables" (a copy of each table used to store history) is not a good way to do this, sin...

Oracle Connection Problem

Hello, I recently got a new machine at work, and moved from XP 32 Bits to Vista 64 Bits. Whatever I do I cannot get my .Net projects to connect to the oracle Server... I can connect to the database using oracle sqldeveloper, but not from my projects... I Get This error (which is puzzling me...) "An error has occurred while establishi...

When I call PreparedStatement.cancel() in a JDBC application, does it actually kill it in an Oracle database?

Hi All, I have Java JDBC application running against an Oracle 10g Database. I set up a PreparedStatement to execute a query, and then call ps.executeQuery() to run it. Occasionally the query takes a long time, and I need to kill it. I have another thread access that PreparedStatement object, and call cancel() on it. My question is,...