Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Asynchronous Stored Procedure Calls

Is it possible to call a stored procedure from another stored procedure asynchronously?

Edit: Specifically I'm working with a DB2 database. ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­

like image 766
Tebari Avatar asked Aug 24 '08 23:08

Tebari


2 Answers

Executive summary: Yes, if your database has a message queue service.

You can push a message onto a queue and the queue processor will consume it asynchronously.

  • Oracle: queues
  • Sql Server: service broker
  • DB2: event broker

For "pure" stored procedure languages (PL/Sql or T-Sql) the answer is no, since it works against the fundamental transaction model most databases have.

However, if your database has a queuing mechanism, you can use that to get the same result.

like image 79
Mark Harrison Avatar answered Sep 28 '22 06:09

Mark Harrison


With MS Sql Server 2005, try the Service Broker and/or CLR stored procedures. I don't think there's anything built directly into TSQL.

like image 20
Eric Z Beard Avatar answered Sep 28 '22 05:09

Eric Z Beard