web stats
Oracle SQL Cursor? - Mirth Community

Go Back   Mirth Community > Mirth Connect > Development

Reply
 
Thread Tools Display Modes
  #1  
Old 01-23-2013, 11:58 AM
appsbyaaron's Avatar
appsbyaaron appsbyaaron is offline
Mirth Guru
 
Join Date: Nov 2011
Location: Florida, USA
Posts: 377
appsbyaaron is on a distinguished road
Default Oracle SQL Cursor?

I have a project where I need to use a cursor. I am reading an Oracle DB and I need to send out an email to several different people giving them some stats based on their facility. I have a cursor all set up (in TOAD) to grab the information.

Anyone have any experience with this? Is this even possible?
Reply With Quote
  #2  
Old 01-23-2013, 12:30 PM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,123
narupley is on a distinguished road
Default

Yes it is; the Oracle JDBC package contains everything that you need. Use prepareCall to create an OracleCallableStatement, which you can then execute and retrieve the cursor from using getCursor. For most intents and purposes Oracle cursors work much the same way ResultSet objects do, so really you could have forgone all the work to create the cursor, and instead just used JDBC to handle query cursors. But it'll work either way.
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
  #3  
Old 01-24-2013, 04:45 AM
appsbyaaron's Avatar
appsbyaaron appsbyaaron is offline
Mirth Guru
 
Join Date: Nov 2011
Location: Florida, USA
Posts: 377
appsbyaaron is on a distinguished road
Default

You rock Nick! Do you have any examples? I'm kind of up against a wall
Reply With Quote
  #4  
Old 01-24-2013, 07:35 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,123
narupley is on a distinguished road
Default

Quote:
Originally Posted by appsbyaaron View Post
You rock Nick! Do you have any examples? I'm kind of up against a wall
The Javadoc for OJDBC is here; there are several code snippets in there. Also just doing a quick Google search: http://www.idevelopment.info/data/Pr...orExample.java
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
Reply

Tags
cursor, oracle, sql

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


All times are GMT -8. The time now is 03:30 AM.


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