tech on the net
Home About Us Feedback Site Map

Microsoft

Access Excel Word

Database

SQL Oracle / PLSQL SQL Server MySQL MariaDB PostgreSQL

Web Development

HTML CSS Color Picker

Language

C Language

More

ASCII Table Linux UNIX Java Clipart Joke of the Moment

Other Sites

CheckYourMath BigActivities DigMinecraft
Share this page:

SQL: GLOBAL TEMPORARY TABLES

Learn how to create SQL GLOBAL TEMORARY tables with syntax and examples.

Description

SQL GLOBAL TEMPORARY TABLES are tables that are created distinct within SQL sessions.

Syntax

The syntax for SQL CREATE GLOBAL TEMPORARY TABLE is:

CREATE GLOBAL TEMPORARY TABLE table_name
( column1 datatype null/not null,
  column2 datatype null/not null,
  ...
);

Parameters or Arguments

table_name is the name of the global temporary table that you wish to create.

column1, column2 are the columns that you wish to create in the global temporary table. Each column must have a datatype. The column should either be defined as "null" or "not null" and if this value is left blank, the database assumes "null" as the default.

Example

Let's look at a SQL CREATE GLOBAL TEMPORARY TABLE example:

CREATE GLOBAL TEMPORARY TABLE suppliers_temp
( supplier_id numeric(10) not null,
  supplier_name varchar2(50) not null,
  contact_name varchar2(50)
);

This example would create a GLOBAL TEMPORARY TABLE called suppliers_temp.