Professional Web Applications Themes

calling perl script from mysql trigger - MySQL

Is it possible to execute an perl script after a record is added to mydatabase.mytable on mysql 5. I want to be able to do some processing after database has been updated. TIA Kees....

  1. #1

    Default calling perl script from mysql trigger

    Is it possible to execute an perl script after a record is added to
    mydatabase.mytable on mysql 5.

    I want to be able to do some processing after database has been updated.

    TIA
    Kees.



    kees hessels Guest

  2. #2

    Default Re: calling perl script from mysql trigger

    kees hessels wrote:
    > Is it possible to execute an perl script after a record is added to
    > mydatabase.mytable on mysql 5.
    This is highly inadvisable to run external processes from a trigger or
    stored procedure.

    - External processes may run in an indefinite amount of time, and the
    server will wait for it, potentially locking up access to tables for
    other users.
    - External processes can crash or have other faults, which may endanger
    the stability of mysqld.
    - The processes run as the user id of the mysqld process, which may
    represent a security breach.
    - Work done by a trigger may be rolled back (if you use InnoDB tables
    and explicit transactions), but any work done by the external process
    won't be rolled back in that case. This can cause confusion and
    erroneous results.
    - It's more complicated to log and debug such convolutions in workflow.
    > I want to be able to do some processing after database has been updated.
    I would recommend doing that processing in the application that executed
    the update. Test for successful completion of the update statement,
    commit the transaction, and then do the additional work. You can even
    spawn the Perl script process from your application. Don't do it from a
    trigger.

    Regards,
    Bill K.
    Bill Karwin Guest

  3. #3

    Default Re: calling perl script from mysql trigger

    Thanks Bill for the explenation, i'll do it from the calling script as you
    suggested, i thought to make an application real db driven one should be
    able to fire external processes from triggers, but i stand corrected.
    Thanks,
    Kees.

    "Bill Karwin" <billkarwin.com> wrote in message
    news:e1h16r02nv0enews1.newsguy.com...
    > kees hessels wrote:
    >> Is it possible to execute an perl script after a record is added to
    >> mydatabase.mytable on mysql 5.
    >
    > This is highly inadvisable to run external processes from a trigger or
    > stored procedure.
    >
    > - External processes may run in an indefinite amount of time, and the
    > server will wait for it, potentially locking up access to tables for other
    > users.
    > - External processes can crash or have other faults, which may endanger
    > the stability of mysqld.
    > - The processes run as the user id of the mysqld process, which may
    > represent a security breach.
    > - Work done by a trigger may be rolled back (if you use InnoDB tables and
    > explicit transactions), but any work done by the external process won't be
    > rolled back in that case. This can cause confusion and erroneous results.
    > - It's more complicated to log and debug such convolutions in workflow.
    >
    >> I want to be able to do some processing after database has been updated.
    >
    > I would recommend doing that processing in the application that executed
    > the update. Test for successful completion of the update statement,
    > commit the transaction, and then do the additional work. You can even
    > spawn the Perl script process from your application. Don't do it from a
    > trigger.
    >
    > Regards,
    > Bill K.

    kees hessels Guest

Similar Threads

  1. Replies: 2
    Last Post: February 8th, 03:22 PM
  2. Calling a webservice from within a SQL Trigger
    By Fabiano in forum ASP.NET Web Services
    Replies: 0
    Last Post: September 8th, 02:50 PM
  3. Control a non-perl image viewer from perl script
    By Harry Putnam in forum PERL Beginners
    Replies: 1
    Last Post: October 31st, 10:28 PM
  4. building C DLL for calling from Perl using (*.XS)
    By Kenjis Kaan in forum PERL Miscellaneous
    Replies: 3
    Last Post: July 16th, 01:16 PM
  5. Execute shell script from a perl script
    By kderaedt in forum Perl / CGI
    Replies: 3
    Last Post: June 26th, 08:26 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139