Archive | Oracle RSS feed for this section

Oracle – Create Table by Select Statement

–WITH data –without data — For example, create a table named EMPLOYEE3 that includes all — of the column definitions from EMPLOYEE where the DEPTNO = D11.

Read full story Comments { 0 }

Oracle PL/SQL – Finding number of rows in each table by a single query

Sample: Results: OR

Read full story Comments { 0 }

Oracle PL/SQL – SQL Plus Startup Script with glogin.sql or login.sql

This article shows about how to configure the environment variable when SqlPlus – SqlPlus Command start up in order to have always a good behavior in the formatting of the result. You have to setup the Windows – Environment Variable (SQL Plus|SQL Developer)- SQLPATH with a directory. Copy then the file login.sql described below in […]

Read full story Comments { 0 }

Oracle – Create Table – Using Select Statement With Data or No Data

Here is a sample script: WITH data   CREATE TABLE test3 AS SELECT table_name, tablespace_name FROM all_tables;   ———————————   Without data   CREATE TABLE ctas AS SELECT table_name, tablespace_name FROM all_tables WHERE 1=2;     — For example, create a table named EMPLOYEE3 that includes all — of the column definitions from EMPLOYEE where […]

Read full story Comments { 0 }

Oracle: Using the AFTER INSERT and AFTER UPDATE triggers

A database trigger is a stored procedure that automatically executes whenever an event occurs. The event may be insert-delete-update operations. Oracle initiates an ‘AFTER INSERT’ trigger after an insert event has occurred and an ‘AFTER UPDATE’ trigger after an update event has occurred. Let’s see an example for ‘AFTER INSERT’ trigger. Syntax: CREATE or REPLACE […]

Read full story Comments { 0 }

SQL Syntax – SELECT UPDATE and DELETE

SQL Syntax – SELECT UPDATE and DELETE

Read full story Comments { 0 }

SQL Function Reference – Oracle vs SQL Server

SQL Function Reference – Oracle vs SQL Server

Read full story Comments { 0 }

How to Replace Default Date Value if Date Field is NULL with PL/SQL

How to Replace Default Date Value if Date Field is NULL with PL/SQL

Read full story Comments { 0 }