Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2002
    Posts
    12

    Unanswered: Does mysql has something like a stored procedure?

    Thanks

  2. #2
    Join Date
    Jul 2002
    Posts
    55
    No.

    If you need to use something like a stored procedure, you need to write something that stores SQL in a database table and a wrapper function to retrieve and execute it. But you won't benefit from the same advantages a SQL Server stored procedure has (such as being precompiled and parsed).

    Mull.

    edit: I don't think this is a planned addition to MySQL in version N (where N is an unknown value). Heck, we're still waiting for sub-selects (though we can get by without 'em).
    Last edited by Mulligan; 08-22-02 at 12:32.

  3. #3
    Join Date
    Jul 2002
    Posts
    12
    Thanks. Yes, we do need sub query badly, why they are so slow for it

  4. #4
    Join Date
    Jul 2002
    Posts
    55
    Sub-selects tend to make for sloppy and lazy SQL statements and can almost always be worked around using tight SQL or temporary tables. They're also a good way to slow down a query and MySQL takes pride in its speed. Probably why they're low-priority.

    Mull.

  5. #5
    Join Date
    Mar 2001
    Location
    Lexington, KY
    Posts
    606
    Subqueries, when properly optimized, shouldn't show a performance difference from thier JOINed equivalent.
    Thanks,

    Matt

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •