oracle

Oracle SQL Query to Summarize Statistics, using GROUP BY

I have an Oracle table with data that looks like this: ID BATCH STATUS 1 1 0 2 1 0 3 1 1 4 2 0 That is, ID is the primary key, there will be multiple rows for each "batch," and each row will have a status code in the STATUS column. There are a bunch of other columns, but these are the important...

Convert a parameter entered as an integer to a string in JasperReports

I have a JRXML file that I use to generate a report built on a massive SQL query for an Oracle database. I have entered a parameter to the report that gets filled as an Integer. However, I would also like to reference this parameter as a String at a different point in the query. Is there a way I can convert the parameter from an Intege...

WebSphere MQ/MQSeries - Possible to send a message to multiple queues with single call?

I'm queuing messages to a WebSphere MQ queue (NB: A point-to-point queue -- not a topic) using a stored procedure in my Oracle database. Is there a way to publish each message to multiple queues with a single call? What I would like is to find a solution that would incur zero additional latency on my database compared to sending the mess...

Hidden features of PL/SQL

In light of the "Hidden features of..." series of questions, what little-known features of PL/SQL have become useful to you? Edit: Features specific to PL/SQL are preferred over features of Oracle's SQL syntax. However, because PL/SQL can use most of Oracle's SQL constructs, they may be included if they make programming in PL/SQL easier...

Oracle DB: How can I write query ignoring case?

Hello, As I had written in title, I have SQL query, run on Oracle DB, lets say: SELECT * FROM TABLE WHERE TABLE.NAME Like 'IgNoReCaSe' If I would like, that the query would return either "IGNORECASE", "ignorecase" or combinations of them, how can this be done? Is this possible? ...

Does anybody know what encrypting technique is JDeveloper/SQL Developer using to persist credentials?

I'd be more than interesting for me to understand which technique is being used here to persist sensible data since I'm needing to implement a similar solution. Here's a sample connection configuration and the resulting exported snippet: <?xml version = '1.0' encoding = 'UTF-8'?> <References xmlns="http://xmlns.oracle.com/adf/jndi"&g...

selecting distinct same column values from non related tables

In my database, I have 3 tables that have 2 similar columns, Year and Month. These tables aren't linked by anything. What i want to do is select the distinct year and months from these tables. So where table 1 contains: 2009 MAY (multiple times) 2008 NOVEMBER (multiple times) 2007 MAY (multiple times) and table 2 and 3 contains: 20...

Can a query from an Oracle to a DB2 through a dblink block the DB2 table?

I have a middle size query with 500.000 registers from an Oracle to an DB2 system through a DBLink. Can this query block the DB2 table so that it can be updated until i close the DBLink or until i finish the job whith the query (an insert-select into an Oracle table) ...

Oracle Analytic Question

Given a function zipdistance(zipfrom,zipto) which calculates the distance (in miles) between two zip codes and the following tables: create table zips_required( zip varchar2(5) ); create table zips_available( zip varchar2(5), locations number(100) ); How can I construct a query that will return to me each zip code from the z...

What is the difference between converting to hex on the client end and using rawtohex?

I have a table that's created like this: CREATE TABLE bin_test (id INTEGER PRIMARY KEY, b BLOB) Using Python and cx_Oracle, if I do this: value = "\xff\x00\xff\x00" #The string represented in hex by ff00ff00 self.connection.execute("INSERT INTO bin_test (b) VALUES (rawtohex(?))", (value,)) self.connection.exec...

PHP and Oracle using a thin driver

Is there a thin driver for Oracle available to be used with PHP (for example as an extension)? I cannot install the OCI driver/client, but need to be able to access an Oracle database. ...

How to determine a PL/SQL function's schema from within the function

I have a PL/SQL package in an Oracle 10g database and I want to write a function that returns the name of the schema that the package (and hence the function) is defined in. Anyone know how to do this? ...

Dump Oracle table(s) data to INSERT statements

I have a requirement right now where my client's business people have populated a website with a bunch of data. They want the site to go live to production with the UAT data so that on launch day the site is not barren. Now, the webservers and data centers are managed by a certain Big Blue friend of ours and they refuse to give me a us...

SQL to Return Results from Week 13 Year 2008 (not grouped)

Hi folks, I'm trying to use a Year-Week format in oracle SQL to return results only from a range of Year-Weeks. Here's what I'm trying SELECT * FROM widsys.train trn WHERE trn.WID_DATE>=TO_DATE('2008-13', 'YYYY-IW') AND trn.WID_DATE<=TO_DATE('2008-15', 'YYYY-IW') ORDER BY trn.wid_date but it shoots this error. ORA-01820: format c...

Is MSMQ a good idea

System A captures X information from users via UI. This information is validated and persisted in a database. The user can change, add or delete the information. I have to keep this X information is sync with System B using web service. Also I need to send this information as soon as possible after its persisted in the database. I thoug...

Hibernate @OrderBy with referenced class

Hi All, I have a class say: "ClassA" which has a collection of "ClassB" @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY) @JoinColumn(name = "COLUMN_NAME") private List<ClassB> lotsOfClasses; "ClassB" has a mapped class "ClassC" using plain old mapping annotations: public class ClassB { ... @ManyToOne @JoinColumn...

What's a quality development environment for writing Oracle SQL?

The project I'm working on has an Oracle backend, and we use SQL Navigator 5.5 for SQL development and it really sucks: the intellisense doesn't work for queries with more than one table and you can't browse the schema and write a query on the screen at the same time. Not fun. I also tried using Oracle SQL Developer. That's not much o...

How to do monthly refresh of large DB tables without interrupting user access to them

Hi all, I have four DB tables in an Oracle database that need to be rewritten/refreshed every week or every month. I am writing this script in PHP using the standard OCI functions, that will read new data in from XML and refresh these four tables. The four tables have the following properties TABLE A - up to 2mil rows, one primary k...

IndexOf Feature in Pl/SQL

I'd like to look up the location of a specific character in a varchar variable. ...

Relation between Oracle session and connection pool

Let me explain the set up first. We have an oracle server running on a 2GB RAM machine. The Db instance has the init parameter "sessions" set to 160. We have the application deployed on Websphere 6.1. The connection pool settings is Min 50 and Max 150. When we run Load test on 40 Users (concurrent, using jMeter), everything goes fine....