web stats
Calling stored procedure - Page 2 - Mirth Community

Go Back   Mirth Community > Mirth Connect > Development

Reply
 
Thread Tools Display Modes
  #11  
Old 12-20-2006, 10:34 AM
rbmangeles rbmangeles is offline
Mirth Newb
 
Join Date: Dec 2006
Posts: 7
rbmangeles
Default Re: Calling stored procedure

I added another driver for SQL Server 2005 and it's working fine.

Thanks!
Reply With Quote
  #12  
Old 01-03-2007, 11:46 AM
Bobbit Bobbit is offline
Mirth Newb
 
Join Date: Jan 2007
Posts: 9
Bobbit
Default Re: Calling stored procedure in 1.3.1

org.mozilla.javascript.EcmaError: TypeError: Cannot find function getInt. (3416a60c-6dad-4779-91cd-d197d7d25a85#39)
at org.mozilla.javascript.ScriptRuntime.constructErro r(ScriptRuntime.java:3226)
at org.mozilla.javascript.ScriptRuntime.constructErro r(ScriptRuntime.java:3216)
at org.mozilla.javascript.ScriptRuntime.typeError(Scr iptRuntime.java:3232)
at org.mozilla.javascript.ScriptRuntime.typeError1(Sc riptRuntime.java:3244)
at org.mozilla.javascript.ScriptRuntime.notFunctionEr ror(ScriptRuntime.java:3304)

I'm getting this error and I was wondering if this function like .next(), .getInt(), .close() are still working. The code below is a part of my transformer.

var dbConn = DatabaseConnectionFactory.createDatabaseConnection (globalMap.get('jdbcDriver'), globalMap.get('dbAddress'), globalMap.get('dbLogin'), globalMap.get('dbPassword'));


var spParams = tmpNTE1 + ', ' + tmpNTE2 + ', ' + tmpNTE3
;

var expression = "EXEC uSP_SampleTest" + spParams;

logger.info('SQL: ' + expression);
var result = dbConn.executeUpdate(expression);

result.next();

var iReturnVal = result.getInt(1);

result.close();
dbConn.close();


Thank you very much!
Reply With Quote
  #13  
Old 01-03-2007, 01:35 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

The result var still works, however on executeInsert(). On executeUpdate, result is an integer indicating the number of rows updated:

Code:
var iReturnVal =  dbConn.executeUpdate(expression);
__________________
Chris Lang
Reply With Quote
  #14  
Old 01-04-2007, 07:40 PM
Bobbit Bobbit is offline
Mirth Newb
 
Join Date: Jan 2007
Posts: 9
Bobbit
Default Re: Calling stored procedure

So, result.close() and result.next() are not working anymore? Did I get that right?

Thanks!
Reply With Quote
  #15  
Old 01-04-2007, 08:22 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

result.close() and result.next() work when you have a result set. Only SELECT SQL statements return result sets. If you have an insert or update, the result variable is not a result set, it is an integer (that equals the number of rows affected by the update or insert).

-Chris
__________________
Chris Lang
Reply With Quote
  #16  
Old 01-05-2007, 04:07 AM
Bobbit Bobbit is offline
Mirth Newb
 
Join Date: Jan 2007
Posts: 9
Bobbit
Default Re: Calling stored procedure

Ok Chris, thanks!
Reply With Quote
  #17  
Old 01-05-2007, 09:15 AM
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

Hope that helps!
__________________
Chris Lang
Reply With Quote
  #18  
Old 06-02-2007, 12:38 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

Just an update -

Mirth now support calling stored procedures on the Source connector and Destination connectors. You must select "use Javascript". Here you can call the Stored Procedure in your JS code.
__________________
Chris Lang
Reply With Quote
  #19  
Old 08-23-2007, 12:23 AM
lordvega lordvega is offline
What's HL7?
 
Join Date: Aug 2007
Posts: 1
lordvega
Default Re: Calling stored procedure

What abt return variables. Can they be supported using this technique.

What is the long term stance on supporting stored procedure through database writer?

Thanks
Karan
Reply With Quote
  #20  
Old 08-23-2007, 09:29 AM
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

Anything that can be used with regards to stored procedures in Java can now be used in Mirth with the Javascript DB functions. We fully support stored procedures in a database writer Javascript step.
__________________
Chris Lang
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 10:22 AM.


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