Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6840113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:48:04+00:00 2026-05-26T23:48:04+00:00

I have a MySQL stored routine where I’d like to use a temporary data

  • 0

I have a MySQL stored routine where I’d like to use a temporary data table to store intermediate results. To avoid having to create a “normal” table, I want to use an in-memory table that goes away when routine execution has completed. I’m a MySQL newbie, but I suppose this is the way to go:

DROP TABLE IF EXISTS MyInMemoryTable;
CREATE TABLE MyInMemoryTable ( numberField int ) ENGINE = MEMORY;
...
DROP TABLE IF EXISTS MyInMemoryTable;

My routine works for a single user, but I am nervous about what happens if multiple users run the routine at the same time?

Is MyInMemoryTable local to each user session executing the routine, so there can be many instances of this table (without conflicts) at the same time?
Or is MyInMemoryTable a single global table for all users, thereby risking different users’ data getting mixed-up in the table? Or will one user risk getting a database error if another user is busy running the routine?

To me, the documentation is confusing: It says the MEMORY engine associates each table with a disk file, but also that “MEMORY tables are never converted to disk tables.”

Have I misunderstood MySQL in-memory tables? Perhaps there’s a better approach?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T23:48:04+00:00Added an answer on May 26, 2026 at 11:48 pm

    Create a temporary table.

    CREATE TEMPORARY TABLE ...;
    

    Those tables aren’t shared and are deleted when your connection ends.

    The standard in memory tables are probably shared and global.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Greetings, I have data stored on mysql with delimiter , in 1 table. I
I have a MySQL stored procedure that uses a temporary table. Assume that my
I have following data in a mysql table, +------------+--------+--------+ | date | inQty |
I have my records in mysql stored with a datetime column. I would like
I would like to have the option to call Python via MySQL stored procs.
I am having a strange problem with MySQL Stored Procedure. I have written a
I have a MySQL database with a date_of_birth field. The data stored in this
I have a mysql stored procedure from this ( google book ), and one
I have a MYSQL stored procedure SP1() that returns a result set. I want
Well I have this MySQL stored procedure that I wrote and if I run

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.