Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I was wondering if anyone has experience calling some VB.NET code from within an Oracle trigger. Can this be done? What about on SQLSErver?

 

I would like a proc to be run each time an Oracle Trigger is fired. Would I be able to put some code in the PL/SQL to do this? Or would I have to use the Java interface or something like that?

Wanna-Be C# Superstar
Posted
You can run an EXE from Oracle and SQL Server but I doubt you can run a specific piece of code.

I know in MSSQL you can load a COM object. It is a little hairy, but it is but is possible.

 

You can also build extended stored procedure DLL's. . . even hairier :eek:

 

BTW. This is where Informix rocked!!!

Joe Mamma

Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized.

Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.

  • *Experts*
Posted

You can xpcmdshell (with underscores in the name somewhere) in SQLServer to run any EXE. I would guess Oracle has a similar bit of functionality. BUT, I would strong reccommend NOT using this. Performance alone should be enough to drive you away from this one (it's absolutely horrible on a realworld transactional server).

 

If you just want to run a proc during a trigger, then sure - go for it (that's mostly what it's there for). Generally, you'll have your code right in the trigger since triggers should be fast (do their work and get out quickly).

 

If you need something realtime, go with triggers or a proc. If all your inserts into TableA go through one proc, then you wouldn't need a trigger (for example). If you need something more robust, like an EXE, then I'd suggest logging to a specific table that an EXE can scan periodically (polling).

 

If we knew what you were trying, maybe even more suggestions.

 

-ner

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...