Sunday, January 16, 2011

Difference between Stored Procedure and Macro?

Difference between Stored Procedure and Macro?
Answer:

SP:
It does not return rows to the user.
It has to use cursors to fetch multiple rows
It used Inout/Out to send values to user
It Contains comprehensive SPL
It is stored in DATABASE or USER PERM
A stored procedure also provides output/Input capabilities

Macros:
It returns set of rows to the user.
It is stored in DBC SPOOL space
A macro that allows only input values

8 comments:

  1. Macro's are never stoed in PERM Space

    ReplyDelete
  2. Hi Vinay.

    It is Possible to return the ROWS to user From Procedure.

    Syntax is:--

    CREATE PROCEDURE PROCEDURE_EMP()
    DYNAMIC RESULT SETS 1
    BEGIN
    DECLARE cur CURSOR WITH RETURN only
    FOR
    SELECT * FROM EMP;
    OPEN cur;
    END;

    ---------

    ReplyDelete
  3. Thanks manjunath. It is interesting & a good learning curve .

    I will check & share the feedback soon .

    Thanks again!
    Vinay

    ReplyDelete
    Replies
    1. It is working fine.Thanks for posting this

      Delete
  4. It is possible to return row in stored procs using cursors

    ReplyDelete
  5. informative post! I really like and appreciate your work, thank you for sharing such a useful facts and information about capability procedure hr strategies, keep updating the blog, hear i prefer some more information about jobs for your career hr jobs in hyderabad .

    ReplyDelete

  6. IEEE Final Year projects Project Centers in Chennai are consistently sought after. Final Year Students Projects take a shot at them to improve their aptitudes, while specialists like the enjoyment in interfering with innovation. For experts, it's an alternate ball game through and through. Smaller than expected IEEE Final Year project centers ground for all fragments of CSE & IT engineers hoping to assemble. Final Year Projects for CSE It gives you tips and rules that is progressively critical to consider while choosing any final year project point.

    Spring Framework has already made serious inroads as an integrated technology stack for building user-facing applications. Spring Framework Corporate TRaining the authors explore the idea of using Java in Big Data platforms.
    Specifically, Spring Framework provides various tasks are geared around preparing data for further analysis and visualization. Spring Training in Chennai


    The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training

    ReplyDelete