oracle

Why has Hibernate switched to use LONG over CLOB?

It looks like that Hibernate started using LONG data type in version 3.5.5 (we upgraded from 3.2.7) instead of CLOB for the property of type="text". This is causing problems as LONG data type in Oracle is an old outdated data type (see http://www.orafaq.com/wiki/LONG) that shouldn’t be used, and tables can’t have more than one column ha...

How to do Outer Join on >2 Tables (Oracle)

I'm not sure how to describe my table structure, so hope this makes sense... I have 3 tables in hierarchical relationship such that A has a one to many relationship to B which in turn has a one to many relationship with C. The trick is that the foreign key in B and C are allowed to be null (i.e. no parent defined). I also have D and E...

How to pass array and other type of variable to oracle stored procedure?

I want to pass one array and one integer variable to a oracle stored procedure from c#.net application. I can pass both parameter as array but can't pass two different type of variable. Is there any solution where I can pass array and any other type of variable together? ...

Case and accent insensitive 'like' comparison oracle without altering session on oracle

Hi all I need to be able to do 'like' queries across several languages, so that a umlaut, a and A are treated the same and so on. I'm on 10gr2 of oracle and I can't alter the session. I've been trying things like nls_upper(col_name,'NLS_SORT=BINARY_AI') like nls_upper('%fur%','NLS_SORT=BINARY_AI') but I'm not having any joy. Whatever...

How should I actually pronounce "PL/SQL" (the language name) in my speech? :)

This question is pointed to those who speak English as their native language. I know it's kinda off-topic, so I am aware it is likely to get closed or voted down to deep negatives, but I'm still curious. :) I suppose this name is not as simple to pronounce as, say, Pascal, Java, Perl, well, put almost any other one here. In Russian, whi...

Oracle fusion middleware - Reports 11g - graph background color

I have created a graph in oracle reports 10G/11G for the following query. Select object_type,count(*) from user_objects group by object_type In 10g I have got the graph with white background where as in 11g I have got the graph with gradient effect.I have changed the plot area background (with white color) also but there is no change ...

My procedure is not returning expected results

Here is my code: create or replace procedure date_report (start_date timestamp , end_date timestamp ) is cursor cursor_audit is select audit_id, audit_action, audit_user, audit_date from customer_audit where audit_date between start_date and end_date ; rec cursor_audit%rowtype; begin open cursor_audit; fet...

Oracle to_date function. Mask needed

I have string of date from xml file of such kind: '2010-09-09T22:33:44.OZ' I need to extract only date and time. I want to ignore symbol T and .OZ (time zone). Which mask I should use? Thanks in advance ...

How to duplicate a table with all its constrains in SQL*Plus?

Using create table tab2 as select * from tab1;, I am able to copy the data but not the primary key constraint : SQL> desc tab1; Name Null? Type ----------------------------------------- -------- ---------------------------- ID NOT NULL NUMBER NAME ...

is there a boolean type in oracle databases?

is there a boolean type in oracle databases? ...

Oracle & java dynamic 'Order by' clause

Hi guys, I am trying to build a dynamic sql query in java (shown below) sqlStr = "Select * " + "from " + tableName if(tableName!=null){ if(tableName.equals("Table1"){ sqlStr = sqlStr.concat("order by city desc"); }else if(tableName.equals("Table2"){ sqlStr = sqlStr.concat("order ...

reducing the time of scheduled job

Hi , I have written this scheduled job for the ORACLE DB which is run every second. Now in my schedule program what I want to do is to set the frequency to every 5 millisecond. BEGIN sys.dbms_scheduler.create_schedule( repeat_interval =>'FREQ=SECONDLY;INTERVAL=1', start_date => to_date('15:19 09/16/10...

Auto-insert a range into an Oracle table

How would i insert a number of rows into a table given an incremental range, with one column of the row containing the values? ...

Another issue with to_number(). I simply do not understand it.

I have a master table (hereafter called SURVEY) and a detail table (hereafter called ANSWERS.) Unsurprisingly, ANSWERS has answers to SURVEY questions. ANSWERS has a VARCHAR2 column named TEXT. Some ANSWERS.TEXT values are truly text but some are actually numerics. Fortunately, I always know which rows contain text and which contain ...

How can I mock an OracleConnection and OracleCommand?

For my tests I need to mock out the data client, in my case they are Oracle. I have created my data access layer to allow this to be passed in: public static Int32? GetUserRoleId(string userName, OracleConnection cn, OracleCommand cmd) I am using Moq, though I can switch to another framework if needed, and when I go to create the Moc...

Oracle Forms - Host Command - Return Error Code

Within a Oracle Forms trigger I am using the host command to make a directory on the file server. An example of this part of my code is below: HOST ('mkdir'||:GLOBAL.DIRECTORY_PATH||'\FERTILIZER\'||ADDY); I need to have the error code returned to me if the directory is not created on the server. Any suggestions of the code I need to ad...

How is mysql different from oracle performance-wise?

I've started a new job where I'm working with MySQL instead of Oracle. What are some things that I might have to "unlearn" from using Oracle? What are some things that might make Oracle SQL go faster, but might be bad under MySQL (and vice-versa)? In particular, is it better for MySQL code to commit less frequently (as is the case for...

[SQL] How can I check for a certain value in all aggregated rows?

Suppose I have three tables: user, group and xref, a table that gives them many-to-many RI. I might want to see how groups each user belongs to: select user.user_id, user.user_name, count(*) as group_count from user inner join xref on user.user_id = xref.user_id inner join group on group.group_id = xref....

Oracle disk space used by a table

Hello, I have a table in an Oracle db that gets a couple of million new rows every month. Each row has a column which states the date when it was created. I'd like to run a query that gets the disk space growth over the last 6 months. In other words, the result would be a table with two columns where each row would have the month's na...

Oracle debugging techniques

I don't know where error information goes when a trigger doesn't work correctly. My tool for writing triggers has been Oracle's Sql Developer tool, and my knowledge of how to debug it is pretty much nonexistent. What are some pointers for being able to find useful information about things happening "behind the scenes"? Also, are the...