Chat now with support
Chat with Support

SQL Optimizer for SAP ASE 3.8 - User Guide

Introduction Tutorials Preferences Editor Functions SQL Information and Functions Performance Monitor SQL Inspector SQL Collector for Monitor Server SQL Scanner Index Advisor SQL Optimizer
SQL Optimizer Overview Optimization Engine Common Coding Errors in SQL Statements What Function Should l Use to Retrieve the Run Time? Unsatisfactory Performance Results SQL Optimizer Functions SQL Editor Optimized SQL Activity Log
SQL Worksheet SQL Formatter Database Explorer Code Finder Object Extractor SQL Repository Index Impact Analyzer Index Usage Analyzer Configuration Analyzer Migration Analyzer Abstract Plan Manager User-Defined Temp Tables SQL History Legal Information

User-Defined Temp Tables

User-Defined Temp Table Overview

User-Defined Temp Tables > User-Defined Temp Table Overview

The technique of creating temporary tables to extract data from permanent tables is often used. Because the existent of the local temp table is session related, you need to create these temporary tables in your current session. The User-Defined Temp Table window allows you to create temp tables to use so that you may optimize and analyze SQL statements that use temporary tables. Besides temporary table that you create using the User-Defined Temp Table window, temporary table may also be created during the scanning by the SQL Scanner and during the optimization process by the SQL Optimizer.

Note: Temporary Tables created in the User-Defined Temp Table module are not available in the SQL Worksheet module since a new database session is used to execute commands in the SQL Worksheet.

 

Related Topics

Create Temporary Tables

User-Defined Temp Tables > Create Temporary Tables

Temporary tables only exist in your current session. In order to optimize a SQL statement that uses temporary tables, these tables need to be created in this session before you optimize. The User-Defined Temp Table window allows the creation of temporary tables to be use throughout modules that use the original sessions that is created as you logon.

Temporary tables created in the User-Defined Temp Table module are used in the SQL Optimizer and SQL Scanner and can be viewed in the Database Explorer. An icon displays in the status bar of the main window to indicate at least one temporary table was created under the current session.

Temporary tables are dropped when you

  • Exit from the program

  • Reconnect with the same or a different user logon

  • Drop it using the User-Defined Temp Table module

To create temporary tables

  1. Click image\B_UserDefinedTempTable.gif.

  2. Enter the SQL for creating the temporary table on the Creation tab. Multiple commands can be entered.

  3. Click Execute.

After the temporary table is created you will notice an icon image\I_TempTable.gif on the bottom right of the main window status. This icon disappears when all user-defined temporary tables are dropped.

The User-Defined Temp Table module only supports SQL statements that create or modify temporary tables; these are:

  • SELECT INTO

  • CREATE TABLE

  • CREATE INDEX

  • DROP INDEX

  • DROP TABLE

  • INSERT

  • UPDATE

  • DELETE

Note: Temporary tables created within the User-Defined Temp Table window can be used in all modules but the SQL Worksheet. The SQL Worksheet module creates a separate session so temporary tables created in the User-Defined Temp Table cannot be used in the SQL Worksheet and vice versa.

 

Related Topics

Parameters in Temporary Table SQL

User-Defined Temp Tables > Parameters in Temporary Table SQL

In the User-Defined Temp Table window, if the commands for creating the temporary table contain parameters, you are prompted to enter the data types and values on the Parameters window after you click Execute.

 

Related Topics

Related Documents

The document was helpful.

Select Rating

I easily found the information I needed.

Select Rating