Loading ...
Sorry, an error occurred while loading the content.

Can a trigger have Input parameters? ( like procedure )

Expand Messages
  • y_sh_1984
    Hi . I am designing a query . I want to write a trigger that accepts parameters. Is this possible and how? If not what should I do to solve this ? I know that
    Message 1 of 4 , Nov 22, 2011
    • 0 Attachment
      Hi . I am designing a query . I want to write a trigger that accepts parameters. Is this possible and how?
      If not what should I do to solve this ?
      I know that we have those tables in triggers . I am not doing dml action to effect them .I have a query that returns some "Personnel Codes" that these codes should be in the trigger as input parameters . Now I am looking for a way to solve this problem .
      thanks
    • Joe Fawcett
      Not that I know of. But you could write the values into a globally available source and then retrieve them in the trigger. Regards Joe ... [Non-text portions
      Message 2 of 4 , Nov 23, 2011
      • 0 Attachment
        Not that I know of. But you could write the values into a globally
        available source and then retrieve them in the trigger.

        Regards

        Joe


        On 23 November 2011 07:24, y_sh_1984 <y_sh_1984@...> wrote:

        > **
        >
        >
        > Hi . I am designing a query . I want to write a trigger that accepts
        > parameters. Is this possible and how?
        > If not what should I do to solve this ?
        > I know that we have those tables in triggers . I am not doing dml action
        > to effect them .I have a query that returns some "Personnel Codes" that
        > these codes should be in the trigger as input parameters . Now I am looking
        > for a way to solve this problem .
        > thanks
        >
        >
        >


        [Non-text portions of this message have been removed]
      • John Warner
        Depending on the RDBMS the result set of query that fires the trigger is available. http://www.databasejournal.com/features/mssql/article.php/3837541/DML-Trig
        Message 3 of 4 , Nov 23, 2011
        • 0 Attachment
          Depending on the RDBMS the result set of query that fires the trigger is
          available.

          http://www.databasejournal.com/features/mssql/article.php/3837541/DML-Trig
          gers-in-SQL-Server-2008.htm



          John Warner

          > -----Original Message-----
          > From: SQLQueriesNoCode@yahoogroups.com
          > [mailto:SQLQueriesNoCode@yahoogroups.com] On Behalf Of Joe Fawcett
          > Sent: Wednesday, November 23, 2011 11:22 AM
          > To: SQLQueriesNoCode@yahoogroups.com
          > Subject: Re: [SQLQueriesNoCode] Can a trigger have Input parameters? (
          like
          > procedure )
          >
          > Not that I know of. But you could write the values into a globally
          > available source and then retrieve them in the trigger.
          >
          > Regards
          >
          > Joe
          >
          >
          > On 23 November 2011 07:24, y_sh_1984 <y_sh_1984@...> wrote:
          >
          > > **
          > >
          > >
          > > Hi . I am designing a query . I want to write a trigger that accepts
          > > parameters. Is this possible and how?
          > > If not what should I do to solve this ?
          > > I know that we have those tables in triggers . I am not doing dml
          action
          > > to effect them .I have a query that returns some "Personnel Codes"
          that
          > > these codes should be in the trigger as input parameters . Now I am
          looking
          > > for a way to solve this problem .
          > > thanks
          > >
          > >
          > >
          >
          >
          > [Non-text portions of this message have been removed]
          >
          >
          >
          > ------------------------------------
          >
          > Yahoo! Groups Links
          >
          >
          >
        • Arnie Rowland
          Using a TRIGGER should be restricted to data management (conformance and consistency) ONLY. Don t use a TRIGGER to manage business rules. Not only does this
          Message 4 of 4 , Nov 23, 2011
          • 0 Attachment
            Using a TRIGGER 'should' be restricted to data management (conformance
            and consistency) ONLY. Don't use a TRIGGER to manage business rules.

            Not only does this place an undue burden on the server, but it
            effectively hides activities that should be both in view and easily
            accessible to those that maintain the database.

            I have worked with many clients that had 'gremlins' in the database only
            to discover some TRIGGER that no one remembered.

            That said, if the "Personnel Codes" are in the table controlled by a
            TRIGGER, then those fields are accessible to the TRIGGER.

            From the limited scenario, I would guess that a TRIGGER is NOT the
            solution.


            Regards,

            Arnie Rowland | Westwood Consulting, LLC | +1-503-246-6172

            "You cannot do a kindness too soon because you never know how soon
            it will be too late."
            -Ralph Waldo Emerson




            -----Original Message-----
            From: SQLQueriesNoCode@yahoogroups.com
            [mailto:SQLQueriesNoCode@yahoogroups.com] On Behalf Of Joe Fawcett
            Sent: Wednesday, November 23, 2011 8:25 AM
            To: SQLQueriesNoCode@yahoogroups.com
            Subject: Re: [SQLQueriesNoCode] Can a trigger have Input parameters? (
            like procedure )

            Not that I know of. But you could write the values into a globally
            available source and then retrieve them in the trigger.

            Regards

            Joe


            On 23 November 2011 07:24, y_sh_1984 <y_sh_1984@...> wrote:

            > **
            >
            >
            > Hi . I am designing a query . I want to write a trigger that accepts
            > parameters. Is this possible and how?
            > If not what should I do to solve this ?
            > I know that we have those tables in triggers . I am not doing dml
            > action to effect them .I have a query that returns some "Personnel
            > Codes" that these codes should be in the trigger as input parameters .

            > Now I am looking for a way to solve this problem .
            > thanks
            >
            >
            >


            [Non-text portions of this message have been removed]



            ------------------------------------

            Yahoo! Groups Links
          Your message has been successfully submitted and would be delivered to recipients shortly.