Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2001
    Location
    India
    Posts
    4

    Unanswered: Calling a dll from a stored Procedure

    Hi All,
    I have this requirement that whenever a particular field changes in the table I need to send some mails exactly after an hour since that field gets updated.
    What I thought of was that Ill create a trigger on the update of that field and insert some values related to that mail in a temporary table along with the time on which the mail has to be sent and later ill create a job that runs every 5 mins and if the current time is less it will then the time stored in that table it will send the mail and delete the row from the table.
    But the difficult part is I need to write the code in a dll(through VB) and call it inside a stored procedure and then call that stored procedure inside that job...
    Does anyone has an idea as to how I can call a dll from a stored procedure and then call that stored procedure in a job..
    Please help me out on this Ill be real greatful..
    Thanks in advance,
    Parul Gulati

  2. #2
    Join Date
    Dec 2001
    Location
    chennai
    Posts
    21
    hii
    from sql server u can use OLE Automation Procedures.
    sp_OACreate,sp_OAMethod . try all procedures with SP_OA.
    but for oracle i am unaware.

    Regards
    Ramakrishnan
    Chennai
    K.Ramakrishnan
    Chennai

  3. #3
    Join Date
    Dec 2001
    Location
    India
    Posts
    4
    Thanks a lot.
    I am going to try that.
    But do you have any idea as to how I can call an exe from a Job coz the other best soln to this problem would be that i create a job that will call an exe in place of the dll.
    Regards,
    Parul

  4. #4
    Join Date
    Dec 2001
    Location
    chennai
    Posts
    21

    calling an exe

    hii
    try using xp_cmdshell sp in MS SQL Server.

    check Books online for exact syntax

    K.Ramakrishnan
    Chennai

  5. #5
    Join Date
    Dec 2001
    Location
    India
    Posts
    4
    Well I was able to call an exe from SQL Server.
    Thanks a lot, it was all interface based.
    But tell me one thing can I have a condition on when I can call an that exe.
    Whenever that condition gets true only then that exe is called.
    Regards,
    Parul

  6. #6
    Join Date
    Dec 2001
    Location
    chennai
    Posts
    21

    do via a job

    HII
    u can do that in the job by giving a condition in the job and calling the xp_cmdshell procedure
    K.Ramakrishnan
    Chennai

Posting Permissions

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