Neil Aitken
Neil Aitken

Reputation: 7854

MySql TABLE data type

MS SQL Server has a TABLE data type which can be used in stored procedures,

Does anybody know if MySQL has an equivalent data type?

I've had a look over the docs but can't seem to find anything, so I presume it doesn't exist, but perhaps somebody has created a workaround

Upvotes: 0

Views: 420

Answers (1)

Konrads
Konrads

Reputation: 2284

Neil,

MySQL has no such data type and I believe it is good that it doesn't. To achieve similar results, use CREATE TEMPORARY TABLE construction. Name clashes are avoided by having per connection temporary tables:

A TEMPORARY table is visible only to the current connection, and is dropped automatically when the connection is closed. This means that two different connections can use the same temporary table name without conflicting with each other or with an existing non-TEMPORARY table of the same name. (The existing table is hidden until the temporary table is dropped.)

Hope it helps.

Upvotes: 2

Related Questions