Database Tutorials, Tips & Tricks

Java: Passing Array to Oracle Stored Procedure

This tutorial guides us on how to pass Array objects from Java to stored procedures in Oracle and also, how to retrieve an array object in Java.All PLSQL arrays can not be called from java. An array needs to be created as TYPE, at SCHEMA level in the database and then it can be used ...

Oracle Skip Locked

Oracle Skip Locked
Oracle 11g introduced SKIP LOCKED clause to query the records from the table which are not locked in any other active session of the database.This looks quite similar to exclusive mode of locking.The select for update statement has always been problematic for large updates because it the default is to wait for locks and using select for ...

Index Skip Scan in Oracle

Index Skip Scan in Oracle
With Oracle 9i, the Cost-Based Optimizer (CBO) is equipped with many useful features, one of them is "Index skip scan". In previous releases a composite index could only be used if the first column, the leading edge, of the index was referenced in the WHERE clause of a statement. In Oracle 9i this restriction is removed ...

Pagination in Oracle using ROWNUM and Limiting Result Set

Pagination in Oracle using ROWNUM and Limiting Result Set
ROWNUM is a magic column in Oracle Database that gets many people into trouble. When you learn what it is and how it works, however, it can be very useful. I use it for two main things:To perform top- N processing. This is similar to using the LIMIT clause, available in some other databases. To paginate through a ...

Index usage with LIKE operator in Oracle & Domain Indexes

Index usage with LIKE operator in Oracle & Domain Indexes
A lot of developers might be confused about index selectivity while using %LIKE% operator. So please find below how index worked when you use LIKE operator.Problem StatementWhile optimizing high CPU consuming queries on 3rd party application, verified that most of the queries are using '%LIKE%' operator. Interestingly enough, while some of these queries are going for "INDEX RANGE" while others are going for "FULL TABLE ...

How To Convert Number into Words using Oracle SQL Query

How To Convert Number into Words using Oracle SQL Query
How can you convert a number into words using Oracle Sql Query? What I mean by Number to Word is:Here's a classy query which will convert number into words.Please see the query below:select to_char(to_date(:number,'j'),'jsp') from dual;If I pass 234 in number, then the output will : two hundred thirty-fourSELECT TO_CHAR (TO_DATE (234, 'j'), 'jsp') ...

How To Reset MySQL Autoincrement Column

MySQL database provides a wonderful feature of Autoincrement Column index. Your database table can define its primary key as Autoincrement number and MySQL will take care of its unique value while inserting new rows.Each time you add a new row, MySQL increments the value automatically and persist it to table. But sometime you may want ...

Hibernate One To One Mapping Tutorial (XML Mapping)

Hibernate One To One Mapping Tutorial (XML Mapping)
Let us understand how One-to-one mapping works in Hibernate. Following is a simply yet concept building example where we will understand One-to-one mapping in Hibernate framework using XML Mappings. We will use two tables "employee" and "employeedetail" which exhibits one-to-one relationship. Using Hibernate we will implement this relationship.Tools and technologies used in this article:Java JDK 1.5 above MySQL 5 above Eclipse 3.2 above Hibernate 3 above Maven 3 ...

Hibernate Maven MySQL Hello World example (XML Mapping)

Hibernate Maven MySQL Hello World example (XML Mapping)
In this tutorial, we will try to write a small hello world program using Hibernate, MySQL and Maven. We will create a Java project using Maven and will then try to add Hibernate on it.Following are the tools and technologies used in this project.Java JDK 5 or above Eclipse IDE 3.2 or above Maven 3.0 or above Hibernate 3.0 or above MySQL 5.0 or above1. Database CreationFor this tutorial, ...

Oracle 11G new feature: Virtual Column

Oracle 11g introduced the concept of 'Virtual Column' within a table. Virtual Columns are similar to normal table's columns but with the following differences:They are defined by an expression. The result of evaluation of this expression becomes the value of the column. The values of the virtual column are not stored in the database. Rather, it's computed ...
Page 1 of 3123