
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
Fix Error with TYPE=HEAP for temporary tables in MySQL?
The TYPE=HEAP deprecated in newer MySQL versions. You can use ENGINE=HEAP instead of TYPE. Following is the syntax −
ENGINE=HEAP;
Let us first create a table. Here, we have set Engine=HEAP −
mysql> create TEMPORARY table DemoTable -> ( -> StudentId int, -> StudentName varchar(30) -> )Engine = HEAP; Query OK, 0 rows affected (0.00 sec)
Let us check the definition of table −
mysql> show create table DemoTable;
Output
This will produce the following output −
+--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Table | Create Table | +--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | DemoTable | CREATE TEMPORARY TABLE `DemoTable` (`StudentId` int(11) DEFAULT NULL,`StudentName` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL) ENGINE=MEMORY DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci | +--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.00 sec)
- Related Articles
- Fix MySQL Error #1064 - You have an error in your SQL syntax… near 'TYPE=MyISAM?
- Fix MySQL Database Error #1064?
- How can we see MySQL temporary tables in the list of tables?
- Update column data without using temporary tables in MySQL?
- Fix Error in MySQL syntax while creating a table column with name “index”?
- What happens to MySQL temporary tables if MySQL session is ended?
- Fix ERROR 1064 (42000) while creating a database in MySQL?
- Fix Drop table view #1051 unknown table error in MySQL
- Fix error in MySQL “select ClientId,ClientName,ClientAge, from tablename”
- Fix: ERROR 1396 (HY000): Operation CREATE USER failed in MySQL?
- Fix Connectivity error in Java MySQL connection for connector to be set to class path?
- Fix for MySQL ERROR 1406: Data too long for column” but it shouldn't be?
- What are MySQL Temporary Tables? How can we create them?
- How can I see the description of a MySQL Temporary Tables?
- Why the #1054 - Unknown column error occurs in MySQL and how to fix it?

Advertisements