web stats
Calling stored procedure - Page 3 - Mirth Community

Go Back   Mirth Community > Mirth Connect > Development

Reply
 
Thread Tools Display Modes
  #21  
Old 09-03-2007, 03:05 PM
ricber ricber is offline
Mirth Guru
 
Join Date: Jun 2007
Location: Barcelona, Spain
Posts: 181
ricber
Default Re:Calling stored procedure

Hi all,

I read in a past issue that JS database connections can manage stored procedures execution but, it will be available in a near future native support (not from JS, simply calling SP) for this kind of data retrieval?.

On the other hand, I think that this support is necessary in both channel modes (input/output), not only at output as I can remember in mentioned issue.

Waiting your news,

Ricard
Reply With Quote
  #22  
Old 09-03-2007, 03:20 PM
chrisl chrisl is offline
Mirth Employee
 
Join Date: Aug 2006
Posts: 967
chrisl is an unknown quantity at this point
Default Re:Calling stored procedure

Previously, there was a JS workaround to call a stored procedure in the transformer/filter. As of 1.5, JS was added to the database reader and writer, which supports stored procedures and the FULL JDBC spec. The JS code is precompiled and you are using PURE Java objects so it is just as native as the non-JS db calls. The reason you can't use stored procedures in a non-JS DB connection is due to a limitation with mule under the hood. It needs to know the column and table names in order to work it's magic. When you use JS it is executing the script just like it was native, but we're bypassing Mule's db engine and letting you hit JDBC directly.
__________________
Chris Lang
Reply With Quote
  #23  
Old 11-16-2007, 01:11 AM
Alexander Alexander is offline
OBX.2 Kenobi
 
Join Date: Sep 2007
Posts: 59
Alexander
Default Re: Calling stored procedure

Hi Chris!

I'm trying to use Mirth with procedures in the SQL Server.
I developed a channel that in the source is DB Writer with some transformers.
In the destination I'm trying to get the values defined in the transformers into the source section.

I tried both ways, pure SQL statement like EXEC PROCEDURE ... ... ... or with JS. No success in both cases.
I created a variable to store the SQL statement like EXEC PROCEDURE param1, param2, param3 and etc, and inside the function to execute the SQL string I added the variable name.

Is not executing. I don't know why.

Do you have any example to execute a procedure with parameters in the destination retrieving the values from the transformers in the source ?

Thanks a lot!
Reply With Quote
  #24  
Old 02-20-2008, 04:12 AM
Svetlomir Kasabov Svetlomir Kasabov is offline
OBX.3 Kenobi
 
Join Date: Feb 2008
Posts: 131
Svetlomir Kasabov
Default Re: Calling stored procedure

Hello,

I read this thread and as far as I understood, I can call the stored procedure only with javascript.

My guestion is: is there already a way to call the stored procedure in mirth without using javacript?

Can you please paste some instert / update / delete statements triggering a stored procedure?

Thank you very much!

Svetlomir
Reply With Quote
  #25  
Old 03-10-2008, 05:30 PM
Colizobble Colizobble is offline
OBX.1 Kenobi
 
Join Date: Mar 2008
Posts: 33
Colizobble
Default Re: Calling stored procedure

Just to add a comment from a new Mirth user, but experienced MS SQL Server programmer:

A simple way of getting round Mirth's limitation on requiring an INSERT statement would be to use a dummy VIEW in SQL Server (2000 and later), with an INSTEAD OF INSERT trigger that calls the stored procedure(s)

eg (in SQL Server)

CREATE VIEW MIRTH_INSERT_DUMMY
AS
SELECT CONVERT(VARCHAR(255),NULL) AS MessageControlID,...
WHERE 0=1

GO

CREATE TRIGGER ON MIRTH_INSERT_DUMMY INSTEAD OF INSERT
AS
BEGIN
DECLARE @MessageControlID VARCHAR(255),...

SELECT @MessageControlID=MessageControlID,...
FROM inserted

-- logic steps to choose which stored proc etc...

EXEC MyStoredProc @MessageControlID=@MessageControlID,...

END

--------

Then in Mirth, just use

INSERT INTO MIRTH_INSERT_DUMMY(MessageControlID,...)
VALUES (${MessageControlID},...)
Reply With Quote
  #26  
Old 04-10-2008, 09:49 PM
Alexander Alexander is offline
OBX.2 Kenobi
 
Join Date: Sep 2007
Posts: 59
Alexander
Default Re: Calling stored procedure

Hi Colizobble!

The problem is, when you put a SELECT statement you'll see the result set already mapped, I meant the fields on the query, for example: SELECT FIELD1, FIELD2, FIELD3 FROM TABLE.

But, how to get the fields or result set from a stored procedure that are executing a lots of instructions inside and returning a SELECT statement ?

Thanks,

Alexander
Reply With Quote
  #27  
Old 06-02-2015, 07:05 PM
19hostingsurabaya 19hostingsurabaya is offline
What's HL7?
 
Join Date: Jun 2015
Posts: 4
19hostingsurabaya is on a distinguished road
Default

What abt return variables. Can they be supported using this technique.
Reply With Quote
  #28  
Old 09-15-2015, 02:54 AM
Shakurr Shakurr is offline
What's HL7?
 
Join Date: Sep 2015
Posts: 5
Shakurr is on a distinguished road
Default

Quote:
Originally Posted by 19hostingsurabaya View Post
What abt return variables. Can they be supported using this technique.
yes, they can







sony z5 compact schutzhülle

Last edited by Shakurr; 09-15-2015 at 06:13 PM.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Error calling stored procedure on mysql through a CALL Stmt. d.voelkerts Support 3 08-30-2017 06:14 AM
calling mssql stored procedure julia1231 Support 4 05-17-2009 11:59 PM
calling stored procedures on the Source connector rkedilaya Support 4 06-04-2007 11:32 AM
need some help with calling stored procedure julia1231 Development 3 04-05-2007 01:04 PM
Error calling a Stored Procedure d.voelkerts Support 1 03-15-2007 03:59 AM


All times are GMT -8. The time now is 05:04 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation