Select/update in MySQL Stored Procedure

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Penstar
    New Member
    • Apr 2007
    • 8

    Select/update in MySQL Stored Procedure

    I'm sorry if this is a really stupid question, but I have just started using mySQL.

    I have created a basic stored proc, which does the following:

    SELECT * from members;

    I can call it from mySQL Query Browser and return the results, but the recordset can't be edited.

    Is there any way that the results from a stored procedure can be directly edited, or should I be using views?

    Thanks
    Penny
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    Questions are not stupid, answers can.

    A SELECT is just a read from a table. To update a table you need an INSERT (new row) or an UPDATE (existing row). You can do these from within a stored proc, but you'll have to write the logic for that within the proc.

    In short: you cannot just 'save' the result set of a SELECT, inside or outside a stored proc.

    Ronald

    Comment

    • Penstar
      New Member
      • Apr 2007
      • 8

      #3
      Thank you for clearing that up for me.

      I really appreciate it.

      Penny

      Comment

      • ronverdonk
        Recognized Expert Specialist
        • Jul 2006
        • 4259

        #4
        Originally posted by Penstar
        Thank you for clearing that up for me.

        I really appreciate it.

        Penny
        You are welcome and we'll see you again.

        Ronald

        Comment

        Working...