Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2011
    Posts
    2

    Unanswered: Generator And Mutator Functions

    I have to prepare for a presentation about generator and mutator functions.
    I also read about them in my book, A first course in Database System.
    I need an example, I tried to find it from internet but I can't.
    So, could any one give me an example how to declare, use that functions.
    Thanks very much!

  2. #2
    Join Date
    Nov 2004
    Posts
    1,427
    Provided Answers: 4
    I have never heard the terms "generator and mutator functions" in relation with a database. I have heard of "generator and mutator methods" as alternative names for creators and setters in OO languages.

    I guess
    - any stored procedure that creates a record in a table can be called a creator or generator
    - any stored procedure that updates a column in one (ore more) record(s) can be called a setter or mutator.

    Yet these are not functions, but procedures.

    You cannot use user-defined functions for these methods. As user-defined functions cannot be used to perform a set of actions that modify the global database state. So no INSERTs, UPDATEs or DELTEs are allowed within a UDF (unless you are applying them on locally defined temporary table(s)).
    With kind regards . . . . . SQL Server 2000/2005/2012
    Wim

    Grabel's Law: 2 is not equal to 3 -- not even for very large values of 2.
    Pat Phelan's Law: 2 very definitely CAN equal 3 -- in at least two programming languages

  3. #3
    Join Date
    Jul 2011
    Posts
    2
    In the book: A first course In Database System, chapter 10.5.3, I found "Generator and mutator functions"
    I understand what are they, the mater is I don't know how to use.
    And a day ago, My teacher told me that, MS SQL server doesn't support that features

  4. #4
    Join Date
    Nov 2004
    Posts
    1,427
    Provided Answers: 4
    Quote Originally Posted by Sayuri0903 View Post
    I understand what are they, the mater is I don't know how to use.
    You don't know how to use them, but you do know how to write/program them?

    What database does support those features?
    With kind regards . . . . . SQL Server 2000/2005/2012
    Wim

    Grabel's Law: 2 is not equal to 3 -- not even for very large values of 2.
    Pat Phelan's Law: 2 very definitely CAN equal 3 -- in at least two programming languages

Posting Permissions

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