Can you change the name of a table column in Oracle?
Oracle 9i and above, you can very easily – there is a direct RENAME column command. Pre-Oracle 9i, you have to do a little more.
In this article, we’ll look at both the current and older methods for how to rename column in an Oracle table.
[click to continue…]
The Oracle database does not have the BOOLEAN datatype. No direct way to represent that a column like IS_ACTIVE on table ITEMS is TRUE or FALSE.
The good news is that there are simple workarounds to the situation.
[click to continue…]
Oracle has three datatypes to store strings. – CHAR, VARCHAR and VARCHAR2. How do they differ from each other? When should you use which?
Let’s find out the answers in this article.
[click to continue…]
DELETE, TRUNCATE and DROP – all three commands get rid of table data. How exactly are they different? When should you use which?
A bird’s eye view of their differences, a table comparing the three.
[click to continue…]
In applications that take user email id as input, there is a need to check for email id validity. Here is a very easy validation for syntax of an email address, using regular expressions in Oracle SQL.
The basic email address format is username@example.com. The SQL will verify that the email address provided fits into that format. This can be used before data entry, or coded on a table as a check constraint.
[click to continue…]
What is an auto-increment column?
An auto-increment column is one of which the value increments automatically each time a row is inserted into the table.
What is the use of auto-increment columns?
An auto-increment column usually serves as the primary key or unique identifier for each row of the table. Since the value automatically increments with each insert, the column guarantees that each row has a unique value associated with it.
An auto-increment column also gives useful information about the sequence of transactions. The higher the column value, the later the row was entered into the table. This can be useful for finding data such as
[click to continue…]
In Oracle installation guides and scripts, you will often come across the term ORACLE_HOME. In fact, we used it on this site a couple of posts back, in the script to install SCOTT schema in Oracle.
This post will cover:
- the meaning and purpose of ORACLE_HOME
- how to check if ORACLE_HOME is set
- how to set ORACLE_HOME
- how to unset, change or delete ORACLE_HOME
[click to continue…]
Oracle Database Express Edition (Oracle Database XE) is a free, lightweight version of Oracle.
If you’re a small enterprise with modest database needs, or an individual looking to learn Oracle on your home computer, Oracle Express Edition is just the answer for you.
This starter version of Oracle is free to download, distribute and deploy. It supports up to 4GB of user data, in addition to Oracle system data.
A demo database called HR is provided with the installation.
[click to continue…]
What is SCOTT?
SCOTT is a database schema in Oracle, used for demos and examples.
The SCOTT schema used to be installed by default in earlier versions of Oracle. Not anymore. Oracle 9i onwards, new sample schemas such as HR and OE are available that are more suited for demoing newer Oracle features.
How to install SCOTT?
You might still want to have the SCOTT schema in the database, for trying out examples from old manuals, or maybe because you’ve used it so much it’s like an old friend.
Good news – there’s a script to do the installation with a single command. Here’s how:
[click to continue…]