oracle

Oracle outer join short hand with upper

Works: AND UPPER(a.name) = b.lname(+) does not work AND UPPER(a.name) = UPPER(b.lname) (+) Moving to ANSI joins is an option but a painstaking one. This code should be changed in lot of places and there are lot of joins. I would like to get this syntax correct and be on my way. Is it possible? ...

mysql script of scripts

I have a database that I need to maintain in both oracle and mysql. The data insert script of scripts looks like below. Of course Mysql uses source while oracle uses @ In all other respects the scripts invoked and their order of invocation are identical. (That's because they are just ANSI compliant insert statements). Is there anyway ...

complex sql query

There is a customer table. I want to list active and deactive status in one query. How can I do this ? SELECT count(*) as ACTIVE, count(*) as DEACTIVE FROM V_CUSTOMER WHERE STATUS='a' AND STATUS='d' ...

Oracle's dbms_metadata.get_ddl for object_type JOB

I'd like to create ddl scripts for most of my database objects. dbms_metadata.get_ddl works for most of the object types. For instance the following creates the ddl for a view: select dbms_metadata.get_ddl ( 'VIEW', 'SAMPLE_VIEW') from dual On the other hand it's not working for object_type 'JOB'. The following: select dbms_metadata....

populating a aggregate table

I have a question target table str_week_day end_week_day age_id usage_ratio eq_type ------------ ------------ ------ ----------- ------- 11-Jul-10 17-Jul-10 1.00 0.5 RECEIVER 11-Jul-10 17-Jul-10 2.00 0.5 HUB 18-Jul-10 24-jul-10 1.00 0.5 RECEIVER 18-Jul-10 24-jul-10 2.00 ...

Run 2 queries at the same time on Oracle SQL Developer?

I need to retrieve quite a bit of data from our oracle DB and to do so I need to run 20+ queries. Is there any way to run more than one query at a time on the same connection? I tried using / to separate the queries, but that simply opens multiple tabs and queries still run sequentially, although I don't have to start them one by one. ...

How can I see queries that are executed against Oracle ?

Hi, I need to see the queries that are being sent to Oracle to execute them. Can someone give me specific detailed instructions on how to do this ? ...

Why SELECT 123456.123456789123456 FROM Dual; returns 123456.123457 ?

Why SELECT 123456.123456789123456 FROM Dual; returns 123456.123457 ? How can I increase this precision ? I ask this because I am summing up cost values defined as NUMBER(38,20) and I can notice that errors are accumulated, but since these numbers represent money, rounding up is unacceptable. It is not only the tool I am using that rou...

Database Re-engineering/Schema Generator Tools

Hi, I have joined a project which has been already developed and its a legacy project with very large database and its in Java/J2EE. I am trying to understand the Database Design & Architecture and so is there a tool available which can generate schema from the populated table representing all the constraints like foreign keys etc ? ...

Help with this SQL query...

The follow query is returning an error at column 143: "ORA-00934: group function is not allowed here" SELECT * FROM TBLENTITYLOCATION TL INNER JOIN TBLENTITY TE ON TE.ENTITYID = TL.ENTITYID WHERE TE.ENTITYNAME = 'foobar' AND LOCATIONDATETIME = MAX(LOCATIONDATETIME) It works fine if I take out the last line - AND LOCATIONDATETIME = ...

Save image in Oracle without retrieving a BMP later

Hello there. Right now I'm facing some performance issues in a web app because of a situation with Oracle saving images and my webapp getting them. The database gets the input from a form, which allows user to save any kind of image as a BLOB. No matter the format, it gets saved in a table with its description and stuff. The field gett...

Not all variables bound (but they are there)

I am having a problem with this method. All the parameters are there, and in order, but I still get this error: ORA-01008: not all variables bound protected void LastUpdateDates(string Path, string Key, bool Update) { //load the update dates of the mta files try { FileInfo fi...

Oracle PL/SQL script generation from excel sheet

Hi, I'm having requirement to generate a insert script file from excel sheet. I'm partly successfully in generating script file. But i got struck in a situation,I need help from any1. My logic is some thing like this, Read first cell,check if the value in the cell already exists in DB.If not, generate an insert script as follow declar...

Adding a unique constraint on calculated value of a column

Hi all, I'm not exactly sure how to phrase this, but here goes... We have a table structure like the following: Id | Timestamp | Type | Clientid | ..others.. 001 | 1234567890 | TYPE1 | CL1234567 |..... 002 | 1234561890 | TYPE1 | CL1234567 |..... Now for the data given above... I would like to have a const...

What ways can you create a string with 2000 "spaces"

For various reasons I am trying to set a string to 2000 spaces. Currently I am using: String s = String.format("%1$-2000s"," "); This is great for Java 5, however, some of the developers in our department are using 1.4 and this does not work. I was wondering, are any other ways of achieving the same result? I know I can do things l...

I have problem to connect oracle DB with SQL developer

I try connect to my oracle db with oracle SQL developer and received that message: pic (pictures 1 and 2) if i try connect with sql plus, all well. command : select userenv('LANGUAGE') from dual; result: Connected to: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production SQL> select userenv('LANGUAGE') from dual; *USERE...

How to use Entity Framework against multiple databases?

I would like to use EF 4.0 against Oracle. The challenge I have is that I have multiple databases (all with nearly identical schemas) for different clients. Is it possible to generate my CRUD layer once, and then point at the correct database at runtime based on user identity (or whatever criteria I need to supply)? I think I can hand...

Oracle Insert with mutli-valued column

Hey, I am new to Oracle SQL and I am trying to make a trigger which has an insert dependent on columns received from a select query. I have a basic fantasy baseball app and I am trying to update a table which correlates the player to the team he played on for a single day. The basic idea i want to do is to update the date for each team...

difference in dateTime in database(oracle) and client side(asp.net 3.5)

hai friends, i am fresher to asp.net and oracle. in my project, i am storing a datetime in oracle 10g database and i have to retrieve it as a datatable with all other fields in that table. so when i am retrieving it, i am not getting the same date and time. i am using german culture in database and server side. and i am using US culture...

oracle alias in where clause

I am inside oracle procedure I have a complex query with join which gives single value to which i assign alias now can i pass alias in where clause in another query rather than making above query again as subquery? ...