0

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

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks. I'm familiar with temporary tables, and did consider them in this case. I was just checking if there was native type that may have a lower overhead. I will see if they work with what i'm attempting here.
Are you able to send a datatable into a stored procedure like in MSSQL?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.