oracle

sql query count the zeros

I have this sql query retrieving IDs from a table with 3 columns: ID, Country and Age SELECT Country, (CASE WHEN AGE BETWEEN 0 AND 9 THEN '0-9' WHEN AGE BETWEEN 10 AND 19 THEN '10-19' WHEN AGE BETWEEN 20 AND 29 THEN '20-29' WHEN AGE BETWEEN 30 AND 39 THEN '30-39' WHEN AGE BETWEEN 40 AND 49 THEN '40-49' ELSE '50+' END) Age_Bins, ...

OracleCommand seems to convert literal dates

Hi, I built a small query tool for Oracle using OracleCommand and OracleDataAdapter. Users just input a full query (no parameters), execute and the results are shown in a datagridview. So far so good, although I tried an invalid query, e.g.: SELECT * FROM mytable WHERE dateColumn = '1-JAN-10' This query is not valid SQL for Oracle. Y...

How do i access an out parameter in a pl/sql proc via hibernate

I have a pl/sql procedure with the following signature PROCEDURE pr_log_process_started ( p_process_id IN log_process_status.process_id%TYPE, p_run_id IN OUT log_process_status.run_id%TYPE); How can i make a call to this proc via Hibernate and access the value of the second parameter after the call? ...

Validate Oracle dmp

Hi! I have a Oracle backup done with EXP utility. How can I validate it? Is there any command/tool to validate the backup archive? Thank you! ...

Oracle Check Constraint Issue with to_date

So I'm new to Oracle, trying to create a table as follows: create table Movies ( Title varchar2 primary key, Rating NUMBER CONSTRAINT Rating_CHK CHECK (Rating BETWEEN 0 AND 10), Length NUMBER CONSTRAINT Length_CHK CHECK (Length > 0), ReleaseDate DATE CONSTRAINT RDATE_CHK CHECK (ReleaseDate > to_date('1/1/190...

CONECT BY for two tables with two JOINS

Hi, I have 3 tables: - two with hierarchical structures (like "dimensions" of recursive type of hierarchy); - one with summing data (like "facts" with X column). There are here: 1) DIM1 (ID1, PARENT2, NAME1) 2) DIM2 (ID2, PARENT2, NAME2) 3) FACTS (ID1, ID2, X) Example of DIM1 table: -- 1 0 DIM1 ---- ...

Oracle SQL Issue with Insert Statements

So I am a beginner to this, and trying to follow my professors instructions on how to complete this. They are as follows: Consider the relational database described in Tables 1-3. The underlined attribute(s) is the primary key for a table. Use your Oracle account to create this database and to insert the tuples listed in each table. ...

CREATE TABLE [email protected](..)

How to Create a Table in Oracle with name [email protected] I tried doing CREATE TABLE [email protected](..) but this gives me error so i was looking for some other way of doing it ...

Update Zero Rows and then Committing?

Which procedure is more performant for an update which affects zero rows? UPDATE table SET column = value WHERE id = number; IF SQL%Rowcount > 0 THEN COMMIT; END IF; or UPDATE table SET column = value WHERE id = number; COMMIT; In other words if an Update affect ZERO rows and a commit is issued am I incurring any added expense ...

Is it possible to pass table name as a parameter in Oracle?

I want to create a stored procedure like this: PROCEDURE P_CUSTOMER_UPDATE ( pADSLTable IN Table, pAccountname IN NVARCHAR2, pStatus IN NUMBER, pNote IN NVARCHAR2, pEmail IN NVARCHAR2, pMobi IN NVARCHAR2, pServiceTypeID IN NUMBER, pDate IN DATE ) IS BEGIN UPDATE pADSLTable ...

oracle connection in jsp

firstly i am a total newbie for both jsp as well as oracle. i just want to know the steps for connecting an oracle 10g database with a jsp page. ...

Oracle ODP.NET version agnostic alternative

I am implementing an x64 application, connecting to Oracle. What driver should I use, to make sure that it doesn't matter what client version the user has installed. So, right now I'm building my versions with an x64 and x86 ODP.NET driver, but I'm worried that this won't work when the user has an older/newer version of the Oracle clie...

Need help with some Oracle SQL Queries

Here is the question posed by a professor: Find the minimum and maximum length of movies playing in each city. And here is how I have my tables structured: CREATE TABLE Theatres ( Name varchar2(50) not null, City varchar2(50) not null, State varchar2(50) not null, Zip number not null, Phone varchar2(50) not null, PRIMARY KEY (Name) ); ...

Follow-Up Help with a SQL Query

I asked something similar a few days ago, here is my issue. My professor has phrased the following question: Find the average ratings of all movies playing at each theatre. Display the theatre name and the computed rating. Order the results ascending by rating. Here is how my tables are structured: CREATE TABLE Theatres ( Name var...

ORACLE SQL Statement

So I need help modifying my query to not just include one movie from each city, but all movies from each individual city. Here is my professor's question: Find the average rating of all movies playing in each city. Display the city name and the computed rating. Order the results descending by rating. Here is my definition for each tabl...

Oracle SQL Question

So I've been doing this all night - can't quite understand my homework, and sadly my professor is unavailable on the weekend. Here it goes: Find the titles of the newest movies shown in each city. Display the city name and the newest movie title ordered by city name and movie title. Here are my table declares (and thank you to EVERYONE...

Oracle newly created user privileges issue?

Does newly created user: create user John identified by secret; have some privileges? Or is there any oracle config for privileges of newly created user? I need information about this topic. ...

Hibernate deleting all rows before inserting ...

hi, Im new to hibernate... I have this entity class, the first one i built to test Hibernate, it uses an oracle sequence to fill the ID field : @Entity @Table(name="COMPANIES") public class Companies { private Integer cmpid; private String cmpname; private String cmpcountry; ...

Oracle SQL Question - Need Help

So I've been doing this all night - can't quite understand my homework, and sadly my professor is unavailable on the weekend. I've posted a few of these questions, this being the last one. I've got something to go on, but it needs working (and coming out of this I'd love to fully understand the answer so I don't need help on something ...

How do I use sqlldr to load data from multiple files at once?

I need to load data into an oracle DB using SQLLDR, but I need to pull parts of my table from two different INFILES using the different positions from those infiles? ...