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 7993069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:44:36+00:00 2026-06-04T13:44:36+00:00

I have a stored procedure/ routine ABC which returns me a table with few

  • 0

I have a stored procedure/ routine “ABC” which returns me a table with few rows of columns.

In another SP/Routine “XYZ” I want to compare the resultset returned by “ABC” with a table in the db.

But i have hit a roadblock where I am not able to find a way to call the SP “ABC” from within “XYZ”. Is there any way I can populate a temporary table by calling “ABC” from “XYZ”.

I am very new to MySQL, and am quite sure this is possible in SQL Server and i am now clueless to how i can proceed further. please help me identify where i am making a mistake in understanding my process.

  • 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-06-04T13:44:37+00:00Added an answer on June 4, 2026 at 1:44 pm

    You can create and populate temporary table in the procedure. Then you can refer to this table by its name from the another procedure, but you have to use the session where temporary table was created. Temporary tables are session scoped objects.


    Example:

    DELIMITER $$
    
    CREATE PROCEDURE ABC()
    BEGIN
      CREATE TEMPORARY TABLE tmpEnt SELECT 1;
    END$$
    
    CREATE PROCEDURE XYZ()
    BEGIN
      INSERT INTO tmpEnt VALUES (100);
    END$$
    
    DELIMITER ;
    
    CALL ABC; -- it will create temp. table
    CALL XYZ; -- it will insert one more record into temp. table
    
    SELECT * FROM tmpEnt;
    +-----+
    | 1   |
    +-----+
    |   1 |
    | 100 |
    +-----+
    

    I used stored procedures instead of functions.

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

Sidebar

Related Questions

I have a stored procedure that I want to call from within another, and
I have stored procedure which executes another stored procedure several times. I need union
I have a stored procedure that takes no parameters, and it returns two fields.
I have a stored procedure which takes an XML parameter and inserts the data
I have stored procedure (unorganized - not properly outlined) I want automatic outlining in
I have a stored procedure which contains some if statements, with the different conditions,
I have stored procedure which runs perfectly. And when I insert it into query
I have a stored procedure which is building a dynamic sql query and then
I have a stored procedure in Oracle that returns result set(s) via OUT parameter(s)
I have stored procedure which update Customers and a datagridview to work with the

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.