Results 1 to 13 of 13
  1. #1
    Join Date
    Sep 2006
    Posts
    11

    Unanswered: using mysql, can i have a trigger that calls a VBS file

    using mysql, can i have a trigger that calls a VBS file?

  2. #2
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    No, you cannot

  3. #3
    Join Date
    Sep 2006
    Posts
    11
    can the trigger run vb within it?

  4. #4
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    No, it cannot.

    Why don't you read the manual? Triggers are well documented there...

  5. #5
    Join Date
    Sep 2006
    Posts
    11

    agerled instance

    is there any way around this? can the trigger call a Stored Procedures can can run a batch file, vbs or some vb? on a windows server?

  6. #6
    Join Date
    Sep 2006
    Posts
    11

    called ourred

    what about sending a email from a trigger?

  7. #7
    Join Date
    Sep 2009
    Location
    San Sebastian, Spain
    Posts
    880
    Hi Mathew,

    what exactly are you looking to achieve? It looks like you would like an event to be triggered on some data being added to the database. Is this correct? If you can provide more information about what you are trying to do I am sure we can suggest alternative ways of doing this.
    Ronan Cashell
    Certified Oracle DBA/Certified MySQL Expert (DBA & Cluster DBA)
    http://www.it-iss.com
    Follow me on Twitter

  8. #8
    Join Date
    Sep 2006
    Posts
    11
    What I want to do is call a dll. The script is basally I need to call this script

    Dim TCAPI, Session, TaskItem
    Set TCAPI = CreateObject("Iwcltcp.TCAPI")
    Set Session = TCAPI.Logon(logon, "localhost", "username", "password")
    Set TaskItem = Session.OpenTaskItem(13)
    TaskItem.QueueTask

    The dll will be local on a windows server. I don’t mind running the script in the trigger or calling a vbs file.
    If this cannot be done then I can pick up an email as long as I can passed column information from the trigger (column id or order id)

  9. #9
    Join Date
    Sep 2009
    Location
    San Sebastian, Spain
    Posts
    880
    Off the top of my head I can see two potential solutions here:

    1. A batch process that runs every minute that identifies the new entries and sends out the emails.
    2. The insert statement is being executed by some process into the table. If this is in VB then have this process send out the email.

    As I said previously it is not possible to execute VB code inside a trigger so alternatives is all we can go with. I have used both above on other projects and these appear to work fine.
    Ronan Cashell
    Certified Oracle DBA/Certified MySQL Expert (DBA & Cluster DBA)
    http://www.it-iss.com
    Follow me on Twitter

  10. #10
    Join Date
    Sep 2006
    Posts
    11

    aston hemerno

    how can i write a btach process to check?

    how can i do the secord option?

  11. #11
    Join Date
    Sep 2009
    Location
    San Sebastian, Spain
    Posts
    880
    A batch process is something that is scheduled to run every x minutes. The process itself is quite simple i.e. find all the records that have been added since the last check and then process each of these one by one. The process will be responsible for connecting to the database and to query the database for these records. If you have a timestamp on the records added then you can use this to determine the records that have been inserted. Otherwise you could create a second table which will contain the primary key columns of your main table. An insert trigger can be created that will simply add the record to the secondary table.

    The other alternative, you would need to investigate what process is inserting the information into the database and in particular into this table. The next line after the insert you could add your lines of VB code to send out the email.
    Ronan Cashell
    Certified Oracle DBA/Certified MySQL Expert (DBA & Cluster DBA)
    http://www.it-iss.com
    Follow me on Twitter

  12. #12
    Join Date
    Sep 2006
    Posts
    11
    thanks for your help. i have resovled my problem. i wanted to stay away from rechecking the database every few mins.

    what i have have done is added if statements to my insert php pages. so when the right data matches the php pages then sends an email with the information need in teh subject. i am then pick up that email and do what i need to do.

    i think this is a better way because this does not matter there the DB is (will work outside teh domain or on a non windows server.)

    thanks for your email.

  13. #13
    Join Date
    Sep 2009
    Location
    San Sebastian, Spain
    Posts
    880
    I agree with your choice here. Selecting the contents of a database periodically is a drain on resources. Handling the process where the VB code is adding the record into the database minimizes using the resources on your server.
    Ronan Cashell
    Certified Oracle DBA/Certified MySQL Expert (DBA & Cluster DBA)
    http://www.it-iss.com
    Follow me on Twitter

Posting Permissions

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