Must I use OracleCallableStatement to process a REFCURSOR?

Oracle 10g Rel 2 using latest Oracle thin drivers on a Java 1.5 application.
I'm in the process of porting our existing application to Oracle, but for the next several months, I must support multiple databases (SQL Server, DB2) with the same codeline. Our db access layer is stored procs wrapped in CallableStatements whereby a vast majority returns a result set. I very much need to continue to use existing java.sql.CallableStatements and resultSets.
A typical stored proc looks like this:
CREATE OR REPLACE PROCEDURE getMeData
v_c_columnname IN VARCHAR2 DEFAULT NULL ,
v_intSort IN NUMBER DEFAULT 0 ,
cv_1 IN OUT SYS_REFCURSOR
AS
BEGIN
OPEN cv_1 FOR
SELECT col1,
col2,
col3
FROM someTable
WHERE somecolumn = v_c_columnname ;
END;
We currently abstract the stored proc calls by doing a check on which db platform, then wrapping them with either EXEC or CALL and constructing the proc call for the target RDBMS.
My first question is, is there a way for me to handle/process the return REFCURSOR in vanilla java.sql.Callable statement/ResultSets, or must I use oracle.jdbc.CallableStatment (and register the out cursor type (ie, cStmt.registerOutParameter(3, OracleTypes.CURSOR)?
Second question - I'm currently testing with the OracleCallableStatement, but my cStmt.execute is simply skipping the execute call - I know its constructed properly, and when I call via pl/sql with binds, it returns properly, so am I missing something in how to process the REFCURSOR? It's not failing with an Oracle error, it's just not executing.
This is the call:
begin getMeData(?,?,?); end;
Last question - must one use a REFCURSOR to return a result set via PL/SQL stored procs, or is there another way?
TIA

So, a bit confused. In the JDBC examples I've seen for refcursors, I see the following:
CallableStatement stmt = connection.prepareCall("{? = call demo_refcursor.getRefCursor }");
// Set the Out Parameter type to be of type CURSOR
stmt.registerOutParameter(1, OracleTypes.CURSOR);
stmt.execute(); // Execute the statement
// Cast the returned parameter, (defined as type OracleTypes.CURSOR) to
// a JDBC result-set.
resultSet = (ResultSet)stmt.getObject(1);
Where the call is in the format of {? = call myProc(?,?)}.
Is the first ? (?= call) the registered out parameter? Am I understanding that correctly? If so, and my procedure looks something like this:
CREATE OR REPLACE PROCEDURE getMeData
v_c_columnname IN VARCHAR2 DEFAULT NULL ,
v_intSort IN NUMBER DEFAULT 0 ,
cv_1 IN OUT SYS_REFCURSOR
AS
BEGIN
OPEN cv_1 FOR
SELECT col1,
col2,
col3
FROM someTable
WHERE somecolumn = v_c_columnname ;
END;
... where the refcursor is actually the third param, how do I make sure the ? = call is the refcursor param? Am I totally missing something here? I am a bit rusty, so forgive me if this is obvious and I'm just missing it..

Similar Messages

  • Firefox does not "close" when closed under Windows 7; Task Manager must be used to "End Process." How do I close Firefox and reopen it without getting a "Still Running" error message?

    Even though Firefox has been updated multiple times (currently using Ver. 3.6.13) since I started using Windows 7, I am still unable to totally close it from the toolbar or taskbar. Firefox does closeout on the screen but apparently continues to run in the background. If I open Firefox at a later time, I get an error message stating that Firefox is still running. I then have to go Task Manager to "End Process." Electing to do so allows me to restart Firefox. I never had this problem with Firefox when using Windows XP and I never have this problem with any other software under Windows 7.

    https://support.mozilla.com/en-US/kb/Firefox%20hangs#w_hang-at-exit

  • HT4168 I have created an 100 page booklet in Pages, with many photographs, can I export it to ePub, and make an electronic book, because it says that "Note: The Pages document must have been created using a word processing template"?

    I have created an 100 page booklet in Pages, with many photographs, and much written word, can I export it to ePub, and make an electronic book, because it says that "Note: The Pages document must have been created using a word processing template"?....
    Basically what I want to do is publish the document into both an eDocument, and a hard copy document. What is the best way to do this?

    No Peter, this statement came right off the Apple ePub statement when outlining how to use ePub. the full context is:
    Creating ePub files with Pages
    Summary
    Learn how to create ePub files with Pages.
    Products Affected
    Pages '09
    ePub is an open ebook standard produced by the International Digital Publishing Forum. Pages ’09 lets you export your documents in ePub format for reading with iBooks on iPhone, iPad, or iPod touch.
    iBooks supports both ePub and PDF file formats, and you can export both from Pages.
    When to use ePub or PDF
    Use ePub when text is the most important part of your document, for example when you create a book, a report, a paper, a thesis, or classroom reading material.
    More details on using ePubUse PDF when layout is the most important part of your document, for example when you create a brochure, a flyer, or a manual with multiple illustrations.
    More details on using PDF
    Creating an ePub Document to Read in iBooks
    You can export any Pages word processing document to the ePub file format for reading in an ePub reader, such as the iBooks application on the iPad, iPhone, or iPod touch. Documents created in page layout templates can’t be exported to the ePub format.
    Documents exported to ePub format will look different than their Pages counterparts. If you want to get the best document fidelity between the Pages and ePub formats, style your Pages document with paragraph styles and other formatting attributes allowed in an ePub file. A sample document is provided on the Apple Support site that features styles and guidelines to help you create a Pages document that’s optimized for export to the ePub file format, which you can use as a template or a guide. To learn more about using paragraph styles in Pages, see the topics under the heading “Working with Styles” in the Pages built-in help.
    To read your ePub document in iBooks on your mobile device, you must transfer the ePub file that you create onto your device.
    To use the “ePub Best Practices” sample documentTo learn more about using the ePub format and get a better feel for how a Pages document might appear as a book in iBooks, it’s a good idea to download the “ePub Best Practices” sample document. After reading the guidelines and instructions within the document, you can use it as a template to create your own document. You can also import the styles from the sample document into a new document you create.
    Download the “ePub Best Practices” sample document at the following web address:
    http://images.apple.com/support/pages/docs/ePub_Best_Practices_EN.zip
    Do either of the following:Use the sample document as a template.Import the paragraph styles from the sample document into a new or existing Pages document.
    Export the document you create to ePub format to see how it looks in iBooks.
    Preparing an existing Pages document for export to ePub format
    Documents exported to the ePub format automatically appear with page breaks before every chapter. A table of contents is automatically generated, which allows readers to jump quickly to any chapter title, heading, or subheading in the book. In order to create a meaningful table of contents, it’s important to apply appropriate styles within your document. The ePub reader uses the paragraph styles to determine which items should appear in the table of contents for your book.
    Note: The Pages document must have been created using a word processing template.

  • Unable to open a new window you must first close exsisting firefox process or restart your system. There is no firefox process running why should I receive this error msg?

    I closed a Firefox process. Then clicked the FF icon to restart my browser. I received an error message. " Firefox is already running, but not responding. To open a new window you must first close existing Firefox process, or restart your system. However there is no Firefox process running to begin with. I checked the task manager.
    == This happened ==
    Every time Firefox opened

    It takes Firefox 5-15 seconds to completely close and for the OS to release the processes; it may take longer if you have a Flash animation/video running in one of the tabs. If not waiting long enough is not the problem, you can try the following to determine if an Extension or Plugin might be causing Firefox to hang at exit.
    <u>'''Kill Application'''</u>
    In Task Manager, does firefox.exe show in the <u>'''Processes'''</u> tab?
    See: [http://kb.mozillazine.org/Kill_application Kill Application]
    '''<u>Causes and solutions for Firefox hanging at exit:</u>'''
    [[Firefox hangs]]
    [http://kb.mozillazine.org/Firefox_hangs#Hang_at_exit Firefox hangs at exit]
    [[Firefox is already running but is not responding]]
    <u>'''Safe Mode'''</u>
    You may need to use '''[[Safe Mode]]''' (click on "Safe Mode" and read) to localize the problem. Firefox Safe Mode is a diagnostic mode that disables Extensions and some other features of Firefox. If you are using a theme, switch to the DEFAULT theme: Tools > Add-ons > Themes <u>'''before'''</u> starting Safe Mode. When entering Safe Mode, do not check any items on the entry window, just click "Continue in Safe Mode". Test to see if the problem you are experiencing is corrected.
    See:
    '''[[Troubleshooting extensions and themes]]'''
    '''[[Troubleshooting plugins]]'''
    '''[[Basic Troubleshooting]]'''
    If the problem does not occur in Safe-mode then disable all of your Extensions and Plug-ins and then try to find which is causing it by enabling <u>'''one at a time'''</u> until the problem reappears. <u>'''You MUST close and restart Firefox after EACH change'''</u> via File > Restart Firefox (on Mac: Firefox > Quit). You can use "Disable all add-ons" on the Safe mode start window.

  • While deleting the virtual machine .vhd folder -- error msg : the process cannot access the file beacuse it is being used by another process

    When i am trying to delete the Virtual Machine folder/directory i get the below error. Virtual machine is turned off
    V:\>rmdir ME-EXCAS01 /s
    ME-EXCAS01, Are you sure (Y/N)? y
    ME-EXCAS01\ME-EXCAS01\Virtual Machines\1B1FD14E-B3F0-4232-9F96-2A871E879CD6.xml
    - The process cannot access the file because it is being used by another process
    How to delete the whole folder ?
    Thanks

    Also, if your VM has snapshots and you delete it, you must wait for the snapshots to finish merging - the VHD files will be locked until then.
    Brian Ehlert
    http://ITProctology.blogspot.com
    Learn. Apply. Repeat.

  • Error: Message interface is not used by this process Netweaver PI 7.0

    Hi All,
    I am receiving this error in file to idoc scenario. The file is being picked up by communication channel. Then through an interface mapping IM_MET_ROUTE is being forwarded to a BPM MET_FILE_ROUTE. The MET_FILE_ROUTE forwards it to different BPM depending on file type. whenever I am posting a file it is not reaching IM_MET_ROUTE and giving an error  as shown below.
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--
    Call Adapter
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
      <SAP:Category>XIAdapter</SAP:Category>
      <SAP:Code area="BPE_ADAPTER">MESSAGE_NOT_USED</SAP:Code>
      <SAP:P1 />
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>Message interface is not used by this process</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    Can you please suggest any solution to remove the error.

    Hi All,
    Thanks a lot Vikrant for your suggestion. The error is resolved. This was not a configuration problem. This was a design problem. Initially I also looked for configuration changes but that was correct hence I came to conclusion that this might be a design isuue.
       These are the steps that we should follow to resolve the errors
    1. First Check your configuration again and again with test tool and payload to find where exactly your configuration is failing.
    2. The above step will not be successful since we are already receiving the error.
    3. The above test will fail in interface determination step.
    4. Please go through the interface determination in Integration repository(PI 7.0).
    5. Check whether all interface mapping,source and target message interface are proper or not.
    6. if receiver or sender of message is an BPM please look into their receiver and sender element message type.This must match with the one specified in Interface mapping defined within Integration directory( in the interface deterination step).
       In my case the sixth step above was the solution.

  • BPM : Message interface is not used by this process

    Hi,
    In BPM : to pass the message facing error as below.
    Messages not reflecting in BPM monitor.
    I have configured Recveiver - transformation - sender in BPM.
    In recvier in BPM is configured with Abstract Type as same in the message mapping.
    Is there any thing i am missing?
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Call Adapter
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
      <SAP:Category>XIAdapter</SAP:Category>
      <SAP:Code area="BPE_ADAPTER">MESSAGE_NOT_USED</SAP:Code>
      <SAP:P1 />
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>Message interface is not used by this process</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    I have refered links but not able to get the clue for this error as its from the Call adapter.
    error: Message interface is not used by this process Netweaver PI 7.0
    BPE_ADAPTER: MESSAGE_NOT_USED
    Regards,

    Hi,
    I just saw your IP design and from this I can see that you have message mapping between Sender(as in Outbound interface MIOASY) and abstract interface (as in MIAASY) and then in that you have used transformation step to utilise Interface mapping which is between same abstract interface which is not required at all as message type for both the interfaces is same. For me, what your configuration would be is
    1. Sender agreement to fetch the message from outbound interface(MIOASY) utilising communication channel with whatever adapter you have used
    2. Receiver Determination with Sender and sender interface as MIOASY while receiver as IP(Integration process)
    3. Interface determination between
        a. Sender and Outbound interface and Abstract interface with interface mapping IM_Sender
        b. IP as sender with abstract interface MIAASY and receiver interface MIIASY with no interface mapping being used as it must be of same type as receiver interface is
    4. Receiver agreement with MIIASY being used as receiver interface and communication channel utlililsed to convert it into receiver format.
    If I am assuming it correct then if you see then inside BPM we are not using receiver interface MIIASY which is why I feel this error is coming.
    However, if you design it something like this then I feel the error would get resolved
    Design
    1. Make one abstract interface (MIAASY_Sen) of same type as sender, and create another abstract interface (MIAASY_Rec) of same type as your receiver message type
    2. Create message mapping between sender message type and receiver message type, Interface mapping IM_ABS - (MM_ABS_ABS) between sender abstract interface (MIAASY_Sen)  and receiver abstract interface (MIAASY_Rec)
    3. BPM should be something like this
       Container:*
    rec Abstract Interface MIAASY_Sen
    send Abstract Interface MIAASY_Rec
    Receiver (rec) - Transformation (IM_ABS) -  sender (send)
    Configuration
    1. Sender agreement to fetch the message from outbound interface(MIOASY) utilising communication channel with whatever adapter you have used
    2. Receiver Determination with Sender and sender interface as MIOASY while receiver as IP(Integration process)
    3. Interface determination between
        a. Sender,Outbound interface MIOASY and Abstract interface MIAASY_Sen with no interface mapping
       b. IP as sender with abstract interface MIAASY_Rec and receiver interface MIIASY with no interface mapping being used as it is of same type as receiver interface is
    4. Receiver agreement with MIIASY being used as receiver interface and communication channel utlililsed to convert it into receiver format.
    Let me know if it works.
    Regards,
    Amit

  • How to get the package name of a procedure used in a process flow activity

    Hi all. I'm on OWB 11.2.0.2.0.
    When I used a packaged procedure or function in a mapping operator, I can find out the package.program_unit name by getting the operator's FUNCTION_NAME property. For example,
    OMBRETRIEVE MAPPING '$mapName' OPERATOR '$operName' GET PROPERTIES (FUNCTION_NAME)
    But when the same is used in a process flow activity, I can't find a property name that will give me the same information. I can get the BOUND_NAME, it does not tell me the package name. It must be stored in the activity properties because when you pull up the Synchronize dialog for the activity, it knows the package name.
    Is there a way to get this via an OMBRETRIEVE?
    Thanks.

    ANA, this is exactly what I needed. Thank you so much. I saw REFs also in the OMBRETRIEVE MAPPING/OPERATOR syntax, but went cross-eyed trying to figure out if I could use the same there. The closest I found was GET BOUND_OBJECT.
    Thanks again!

  • To use the transformation process I hear you have to code using OOP, True?

    I've heard that to use the transformation process all update rules, routines must be writtend with OOP and you can't use  the older coding method.  Is this true

    Prefferably Yes Routines hav to be migrated accordingly to OO ABAP.
    <b>Look at</b>
    Re: Doubt Migration of update rules to Transformations ?
    Re: Steps for Copying routine?

  • Use of parallel processing profiles with SNP background planning

    I am using APO V5.1.
    In SNP background planning jobs I am noticing different planning results depending on whether I use a parallel processing profile or not.
    For example if I use a profile with 4 parallel processes, and I run a network heuristic to process 5 location products I get an incomplete planning answer.
    Is this expected behaviour? What are the 'good practices' for using these profiles?
    Any advise appreciated...

    Hello,
    I don't think using parallel processing profile is a good idea when you run network heuristic, since in network heuristic, the squence of the location/product is quite important. The sequence is determined by low-level code, as you may already know.
    For example, in case of external procurement, it must first plan the distribution center then the supplying plant, and in case of inhouse production, it must first plan the final product then the components.
    If you use parallel processing, the data set which is sorted by low-level code would be divided into several blocks and be processed at the same time. This may mess the planning sequence. For example, before the final product is planned in one block, the component is already planned in another block. When it plans the final product, new requirement of the component is generated, but the component will not be planned again, which results supply shortage of the component .
    If there're many location products, maybe dividing the data set manually is a good practice. You can put those related location products in one job, and set several background jobs to plan different data set.
    Best Regards,
    Ada

  • I have a annual plan, it supposed must be used in two terminals, but i haven´t been able to install any app in a second computer, it always says that the app is only available as a trial download. What can I do to solve this issue, and be able to use my p

    I have a annual plan, it supposed must be used in two terminals, but i haven´t been able to install any app in a second computer, it always says that the app is only available as a trial download. What can I do to solve this issue, and be able to use my paid plan in two computers?

    Hi Susan,
    Please refer to the help document to fix this issue:
    Creative Cloud applications unexpectedly revert to trial mode | CS6, CCM
    You may also refer to the thread as below:
    creative cloud software says my free trial has expired, but I have a paid subscription
    Regards,
    Sheena

  • Sale order bom can be used in to process order or not

    To change the BOM for particular order items the sale order BOM can be created , to copy the sale order BOM into production order CO08 can be used , whether the process order can be created with ref to sale order any option is available is SAP

    Hi,
    There is no such transaction for process order with respect to Sale order.If planned order is created with respect to sale order after MRP,that can be converted to process order thorugh COR8 transaction.
    try to explore COR8 transaction

  • I get a message that says ff is already running but is not responding ,to open a new window, you must close the existing ff process or restart your system, how do i close the existing ff process?

    I have windows 7 on dell laptop. I am working on a Word Document and want to go to a diff window for some information. I click on the FF icon on my desktop and get a message that says...FF is already running but is not responding. To open a new window, you must close the existing ff process or restart your system..how do you close the existing ff process?
    == This happened ==
    Every time Firefox opened
    == I got my new dell laptop four weeks ago with window 7 installed

    See https://support.mozilla.com/en-US/kb/Firefox+is+already+running+but+is+not+responding

  • Server 2012 R2 SMB - The process cannot access the file '\\server\share\test.txt' because it is being used by another process.

    Hi,
    We are having issues with Server 2012 R2 SMB shares.
    We try to write some changes to a file, but we first create a temporary backup in case the write fails. After the backup is created we write the changes to the file and then we get an error:
    The process cannot access the file '\\server\share\test.txt' because it is being used by another process.
    It looks like the backup process keeps the original file in use.
    The problem doesn't always occur the first time, but almost everytime after 2 or 3 changes. I have provided some code below to reproduce the problem, you can run this in a loop to reproduce.
    The problem is that once the error arises, the file remains 'in use' for a while, so you cannot retry but have to wait at least several minutes. 
    I've already used Process Explorer to analyze, but there are no open file handles. 
    To reproduce the problem: create two Server 2012 R2 machines and run the below code from one server accessing an SMB share on the other server.
    Below is the code I use for testing, if you reproduce the scenario, I'm sure you get the same error.
    We are not looking for an alternative way to solve this, but wonder if this is a bug that needs to be reported?
    Anybody seen this behavior before or know what's causing it?
    The code:
    string file =
    @"\\server\share\test.txt";
    if (File.Exists(file))
    File.Copy(file, file +
    ".bak", true);
    File.WriteAllText(file,
    "Testje",
    Encoding.UTF8);
    The error:
     System.IO.IOException: The process cannot access the file '\\server\share\test.txt' because it is being used by another process.

    Hi,
    There is someone else having the same issue with yours. You could try code in the article below:
    “The process cannot access the file because it is being used by another process”
    http://blogs.msdn.com/b/shawncao/archive/2010/06/04/the-process-cannot-access-the-file-because-it-is-being-used-by-another-process.aspx
    If you wonder the root cause of the issue, the .NET Framework Class Libraries forum can help.
    Best Regards,
    Mandy 
    If you have any feedback on our support, please click
    here .
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Using XMLDOM to process document in XML DB

    I am new to XML and especially XML DB which I however see as an excellent platform on which to base XML based solutions. I have a specific question and apologise beforehand should any of my assumptions be incorrect.
    I wish to create an application which from a number of XML fragments, together with rules governing the behaviour of the fragments (insertion points, overwrite rules etc) are merged together to finally leave me with a complete and valid XML document in XML DB.
    I thought at first that I could use DBMS_XMLDOM to perform this low level processing required. I have however not managed to understand how this can be used together with XMLDB. I am reluctant to use XMLDOM without XMLDB as I am afraid that I will surpass the limits in XML document size apparently imposed by XMLDOM.
    I see a solution where I create a schema based resource in XML DB containing the initial XML structure and then processing any number of the above mentioned fragments to finaly be left with a complete XML document.
    Can I use XMLDOM to do this or am I barking up the wrong tree?
    I would be grateful for any input on techniques that I can apply to perform elementary search/replace/insert on an XML document which I am, from PLSQL, compiling.
    Thanks
    Hans Christiansen

    Hi
    The size of the documents I want to compose are expected vary from a few Kb to 1 or 2 Gb! In a FAQ found somewhere on OTN there was an entry which mentioned that somebody was having trouble with a 50Mb XML document. The recommendation was to use SAX but I am under the impression that this is more useful when the processing is of a more sequential nature.
    The main thread of my question is to gain clarity in the most suitable technique to use when actualy compsing the XML.
    What I want to do is:
    Create resource (XML document) in XML DB.
    Loop through XML fragments together with rules:
    For each fragment process according to rules and insert
    fragment or update existing XML based on fragment contents.
    At the end of the loop the XML document is complete and ready for further processing.
    XMLDOM seems to give me the tools to do this but I am unsure of how to do this and have XMLDOM work directly against the contents in the resource controlled by XML DB (making use of possible indexes and the scalable nature of XMLDB). I get the feeling that if I simply read the XML from XMLDB resource into a DOM document I am still using the memory based representation of the XML until I write the XML back to XMLDB - is this a correct assumption.
    Alternatively is it the functionality offered by XPath, extract(), updatexml() etc. that I should be looking at?
    Does this make my question more understandable?
    Hans

Maybe you are looking for