FUNCTION and OUT %ROWTYPE

Best Regards.
I tried running an Oracle function in. Net this function has an OUT parameter of type ROWTYPE, when I try to run the function always takes me the following error and
ORA-06550: line 1, column 15:
PLS-00306: wrong number or types of arguments in call to 'CONSULTAR_DIRECCION'
ORA-06550: line 1, column 15:
PLS-00306: wrong number or types of arguments in call to 'CONSULTAR_DIRECCION'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
The code I'm using is this:
C#
OracleConnection conexion = new OracleConnection(StrCred);
conexion.Open();
OracleCommand comando = new OracleCommand();
comando.CommandText = "MP_DIRECCIONES_PKG.CONSULTAR_DIRECCION";
comando.CommandType = CommandType.StoredProcedure;
comando.Connection = conexion;
comando.Parameters.Add("DIRSTANDEPM", OracleDbType.Varchar2, DBNull.Value, ParameterDirection.Input);
comando.Parameters.Add("MUNICIPIO", OracleDbType.Varchar2, DBNull.Value, ParameterDirection.Input);
comando.Parameters.Add("DEPARTAMENTO", OracleDbType.Varchar2, DBNull.Value, ParameterDirection.Input);
comando.Parameters.Add("RC_MP_DIRECCION", OracleDbType.RefCursor, DBNull.Value, ParameterDirection.Output);
comando.Parameters.Add("RETURN_VALUE", OracleDbType.Varchar2, DBNull.Value, ParameterDirection.ReturnValue);
comando.Parameters[0].Value = DIRSTANDEPM_;
comando.Parameters[1].Value = MUNICIPIO_;
comando.Parameters[2].Value = DEPARTAMENTO_;
comando.ExecuteNonQuery();
conexion.Close();
and when I run it I get the above error. This is the function I'm using Oracle
FUNCTION CONSULTAR_DIRECCION(DIRSTANDEPM IN VARCHAR2, MUNICIPIO IN VARCHAR2, DEPARTAMENTO IN VARCHAR2,RC_MP_DIRECCION OUT MP_DIRECCION%ROWTYPE)
RETURN VARCHAR2 IS
vError VARCHAR2 (100);
-- Obtiene información del elemento a consultar
CURSOR cudireccion (wdirstandarepm MP_DIRECCION.DIRECCION%TYPE, wmunicipio MP_DIRECCION.MUNICIPIO%TYPE,
wdepartamento MP_DIRECCION.DEPARTAMENTO%TYPE)IS
SELECT *
FROM MP_DIRECCION
WHERE DIRECCION=wdirstandarepm AND MUNICIPIO=wmunicipio AND DEPARTAMENTO=wdepartamento ;
BEGIN
RC_MP_DIRECCION := NULL;
--abre el cursor
OPEN cudireccion(DIRSTANDEPM, MUNICIPIO, DEPARTAMENTO);
FETCH cudireccion INTO RC_MP_DIRECCION;
CLOSE cudireccion;
IF RC_MP_DIRECCION.CODINSTALACION IS NULL THEN
RETURN ('NO EXISTE INFORMACION PARA LA DIRECCION CONSULTADA: '||DIRSTANDEPM);
ELSE
RETURN NULL;
END IF;
EXCEPTION
WHEN OTHERS THEN
--vError := PKG_SIGMA_LOG.almacenar_error (SQLCODE,'CONSULTA','Error al consultar la direccion por dirección EPM: ' || SQLERRM,
--'FUNCION CONSULTAR DIRECCION POR DIRECCION EPM',NULL, DIRSTANDEPM, municipio, RC_MP_DIRECCION.Codinstalacion);
--RAISE_APPLICATION_ERROR(-20001,SUBSTR (SQLERRM||' * INCONSISTENCIA AL CONSULTAR DIRECCION POR DIRECCION ESTANDAR EPM', 1,1000));
     null;
END;
Please who can help me to know how I should return the parameter value RC_MP_DIRECCION MP_DIRECCION% ROWTYPE OUT. Net?
Many thanks and blessings.

Hi refer this Blogs for ur querry
/people/bhavesh.kantilal/blog/2006/07/03/jdbc-receiver-adapter--synchronous-select-150-step-by-step
/people/saravanakumar.kuppusamy2/blog/2005/01/19/rdbms-system-integration-using-xi-30-jdbc-senderreceiver-adapter
/people/siva.maranani/blog/2005/05/21/jdbc-stored-procedures
/people/jegathees.waran/blog/2007/03/02/oracle-table-functions-and-jdbc-sender-adapter
<b>also refer these, as i replied earlier</b>
/people/yining.mao/blog/2006/09/13/tips-and-tutorial-for-sender-jdbc-adapter
http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
Also, you can check Sriram's blog for executing Stored Procedures,
/people/sriram.vasudevan3/blog/2005/02/14/calling-stored-procs-in-maxdb-using-sap-xi
/people/jegathees.waran/blog/2007/03/02/oracle-table-functions-and-jdbc-sender-adapter
This blog might be helpfull on stored procedures for JDBC
JDBC Stored Procedures
/people/siva.maranani/blog/2005/05/21/jdbc-stored-procedures
Please go through these threads and see if it helps...
Re: How to execute Stored Procedure?
Re: Problem with JDBC stored procedure
http://en.wikipedia.org/wiki/Stored_procedure
Thanks
pls reward if useful

Similar Messages

  • How do i turn off new zoom in and out function on IOS 7?

    Hi Apple support people
    How do i turn off the IOS 7 new zoom in and out function when opening and closing applications. The movement makes me sick and gives me a head ack when i use it.
    I can not find the option anywhere
    Thank you very much for your help

    I don't believe it can be totally disabled. Send feedback to Apple here:
    http://www.apple.com/feedback/

  • DB Function errors out when trying to use in both Answers and RPD file.

    Hi All,
    Its a strange behaviour that one function which is in Database works fine the other does not. I have created 2 DB functions and accessing them from OBIEE in both Answers and RPD. One function which returns a Date is working fine, the one which is returning a number is throwing a error.
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 16001] ODBC error state: S0022 code: 904 message: [Oracle][ODBC][Ora]ORA-00904: "APPS"."XXX_BUSINESS_DAYS": invalid identifier. [nQSError: 16001] ODBC error state: S0022 code: 904 message: [Oracle][ODBC][Ora]ORA-00904: "APPS"."XXX_BUSINESS_DAYS": invalid identifier. [nQSError: 16015] SQL statement execution failed. (HY000)
    SQL Issued: SELECT "Soft cost Fact".Project saw_0, "Soft cost Fact"."Fiscal Year" saw_1, "Soft cost Fact".XXX_BUSINESS_DATE saw_2, CASE WHEN EVALUATE('APPS.XXX_BUSINESS_DAYS(%1,%2,%3)',"Soft cost Fact"."Soft Cost Date","Soft cost Fact"."Soft Cost Date",1) =0 THEN 'ZERO' ELSE 'NON-ZERO' END saw_3 FROM "Soft Cost" WHERE "Soft cost Fact".Project = '060096' ORDER BY saw_0, saw_1, saw_2, saw_3
    Both functions are in same schema, have the similar grants.
    Please help me resolving this error. Any pointers in resolving this is much appreciated.
    Thanks,
    Vijay

    I noticed that you have not specified the type of return value that the function returns. It is good practice to do so..
    EVALUATE('DB_Function(%1)' as returntype, {Comma separated Expression}).
    Try EVALUATE('APPS.XXX_BUSINESS_DAYS(%1,%2,%3)' as number,"Soft cost Fact"."Soft Cost Date","Soft cost Fact"."Soft Cost Date",1) to see if that resolves the error.
    Also check this out if you haven't already.
    http://obiee101.blogspot.com/2007/12/evaluate-function-and-presentation.html
    Hope this helps.Thanks.

  • "in port" and "out port" VIs are not in the functions palette!

    Hi,
    I am using LabVIEW 2012 on a Win 7 64 bit. I want to read a digital input (3.5V) using PC parallel port. I also read this white paper:
    http://digital.ni.com/public.nsf/allkb/B937AC4D8664E37886257206000551CB
    I searched all the functions palette for “in port” and “out port” VIs but I could not find them. Apparently they are not supported in 64bit OS. What are my alternatives for reading digital input via PC parallel port?
    Thanks.

    They have not been supported for quite some time. What happens when you use the recommended VISA api?

  • With the installation of IOS5 on ipfone4 ​​battery started to run out quickly. I in turn cut off the different functions, and attention when you disable geolocation battery was used as fuktsionirovat

    With the installation of IOS5 on ipfone4 ​​battery started to run out quickly. I in turn cut off thedifferent functions, and attention when you disable geolocation battery was used asfuktsionirovat

    When in Unix ( i guess u are using Oracle Application server installed in unix)
    the owner of the ias in unix is used to run this.
    Its usually oracle. try to login with oracle /the user who owns the ias and run the script
    Rajesh Alex

  • I recently upgraded my Mac to Yosemite and I can't use the custom function (grayed out) in Image Trace Illustrator CS6 (physical version). Anyone else having this issue?

    I recently upgraded my Mac to Yosemite and I can't use the custom function (grayed out) in Image Trace Illustrator CS6 (physical version). Anyone else having this issue?

    Custom will show automatically as soon as you just edit some options. So just go ahead, you don't need to select "custom"

  • Transporting a business function: lock out users and suspend batch?

    Hi gurus,
    SAP advises in help.sap.com to lock out all users and suspend batch jobs before activating a business function in development.  I did that in development, activated the business function, and saved it to a transport.  Does the same recommendation to lock out users and suspend batch jobs hold true in the QA and Production systems when the transport is moved in? ... or is it ok to transport it during a time when there is user and batch activity going on?
    Warm Regards,
    CM

    You do have to lock out users and suspend batch, even using a transport.  There is a pdf called
    SAP Enhancement Packages Selecting and Activating Business Functions,  In it, it says to lock out users and stop batch activity in all systems,

  • DLL Wrapper works when functions called out of main(), not from elsewhere?

    Hello all,
    I am currently trying the JSAsio wrapper out ( http://sourceforge.net/projects/jsasio )
    Support on this project is nearly unexisting and a lot of people seem to complain that it doesn't work well.
    It works very nicely here, I wrote a few test classes which called some functions (like playing a sound or recording it) and had no problems whatsoever.
    These test classes were all static functions and ran straight out of the main() method and printed some results to the console.
         public static void main(String[] args)
              boolean result = callFunction();
              .. end..
         public static boolean callFunction()
              initASIO();
              openASIOLine();
              return true;
         }The results were all great!
    Then I tried to implement these test classes into my swing-based applications. So I want to call these same functions, as in the test classes, as a result of any user action (for example, selecting the asio driver in a combobox) But then these asio driver functions just stop to work. I get errors saying that the ASIO driver is not available. (meaning that the dll wrapper loads the wrong asio driver or can't load one at all)
    The library path and classpath are all set correctly, exactly the same as the test classes. Even copied the test code word for word in to my swing applications but it still will not work. I am calling these functions in a new Thread, and even put them in a static methods to try and get that working. When calling these asio methods from the main() method AFTER I set up my components gives me the desired results as well. But as soon as I call these same methods (which are in the same class) from a swing event, it fails;
    public class ASIOTest
         public static void main(String[] args)
              ASIOTest test = new ASIOTest();
              test.callFunction(); // <-- WORKS
         public ASIOTest()
              initializeComponents();
         private void initializeComponents()
              frame = new JFrame();
              choices = new JComboBox();
              choices.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent event)
                     // user made selection
                    new Thread(
                            new Runnable() {
                                public void run() {
                                    try
                                         callFunction(); // <-- DOES NOT WORK
                                    catch (Exception e)
                                        e.printStackTrace();
                            }).start();
         public void callFunction()
              initASIO();
              openASIOLine();
    }Is there something fundamental I am missing here?
    For what reasons can an application which uses JNI functions go wrong when working in a swing enviroment? (and out of a static context, although this does not seem to make any difference, eg. when calling these functions from static methods inside another class, inside a new thread when the user has generated an event)
    I am hoping someone could point me in the right direction :-)
    Thank you in advance,
    Steven
    Edited by: dekoffie on Apr 21, 2009 11:11 AM
    Edited by: dekoffie on Apr 21, 2009 11:16 AM

    jschell wrote:
    Two applications.
    And you probably run them two different ways.
    The environment is different so one works and the other doesn't.Thank you for your fast reply!
    Well, I am running the "updated" version from the same environment; I copied the jframe, and a jcombobox into my original test class which only ran in the java console. Consider my second code example in my original post as the "updated" version of the first code example. And as I pointed out, it works fine when I call the jni functions in the main method, but not when I call it from inside the ActionListener.
    Or am I again missing something essential by what you mean with a different environment? The classpath and the working directory is exactly the same, as is the Djava.library.path option. :-)
    Thanks again!

  • How do you cut and paste tables in and out of Excel from either Mail.app or Outlook 2011?

    When I try to cut and paste a table generated in Excel for Mac into the body of an email the formatting holds but when I send the table is reduced to one column. Same is true for copying from incoming mail into Excel, when I paste into Excel it is reduced to one column rather than keeping the table format. I have tried using mail.app and went out and Outlook 2011 and both programs have the same issue. The reformatting also happens when I forward an email received from a coworker that contains a table, not just on cut and paste operations.
    I need to do this regularly and right now my only option is using my old PC where the cut and paste function keeps formatting between Excel and Outlook just fine. Attaching a pdf or excel file is not an option. There has to be a way to maintain the formatting and being able to extract the tables keeping them intact. Please let me know if you have a solution to maintain this formatting within email programs. Thank you in advance.

    Selecting all does not help - the issue is I need a table within an incoming email to be moved to excel, edited and then pasted back into a new email. "Select All" picks up the email headers, signatures, any messages around the table etc so that doesn't work. Also, as pointed out above Excel doesn't have a select all feature to get the tables back into the body of an email.
    I just tried again going from Excel into Outlook 2011. No luck. All one column down the left side of the email. All columns are removed and text crammed into one column. Just to check I cut from one Excel document and pasted into another and it retained all formating just fine. It is only in and out of Outlook that seems to be the issue.

  • HT4913 i am trying to get my computer and my wifes computer on my itunes match.  i did the add a computer function and it says that this computer is already associated with an apple id...if you use itunes match with your apple id etc for 90 days...please

    i did the add a computer function and it says that this computer is already associated with an apple id...if you use itunes match with your apple id etc for 90 days...please explain.  is this going to screw my wifes account up? 

    If you both have seperate iTunes Store accounts then basically, yes, it is going "screw up" your wife's account.
    iTunes Match is designed as a single-user service which is associated with one and only one iTunes Store account ID. If you have subscribed on your account and want to activate the service on another computer that is already signed in with an account the present account must be signed out and then iTunes signed into your account. This means the other computer will have complete access to your account and will only be able to make purchases on your account. iTM is not designed to be signed in and out at will. If she has apps purchased with her iTunes Store account they will not be able to be updated.

  • Error in using aggregate function in Outer Query in Siebel Analytics

    Hi,
    When I am using aggregate function in outer query in Siebel Analytics I am facing error.
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 59111] The SQL statement must include a GROUP BY clause. (HY000)
    Bellow is the code.
    SELECT test1.username saw_0, test1.desg saw_1,COUNT (test2.querydate) saw_2
    FROM (SELECT POSITION.CBL username,
    POSITION.CBP desg
    FROM "CM"
    WHERE (POSITION.BPTCD = 'Marketing')
    AND (POSITION.EDate =TIMESTAMP '1899-01-01 00:00:00'
    ) test1,
    (SELECT users.UN username,
    measures."Query Count" querycount,
    measures."Max Total Time" secs,
    topic.db dashboardname,
    "Query Time".DATE querydate
    FROM "Plan"
    WHERE (topic."Dashboard Name" IN ('DS'))) test2
    WHERE test2.username = LOWER (test1.username)
    AND test2.dashboardname = 'DS'
    GROUP BY test1.username, test1.desg

    Should your query be a valid SQL query?
    I can't think that the query you have would be valid in a SQL plus window.
    Chris

  • Calling a function module out of a web template

    Hi experts,
    I need to call an ABAP function module out of a web template including a query with the variable values of the query as input parameters. There shall be button, which starts the funtion module, if the user clicks it. I don't need to transfer any other data just the variables. I have no idea how to accomplish that.
    I experimented with implementing interface IF_BICS_CONS_WEBITEM_CUST_EXIT but this does not seem to help me, as the initialize method is called when starting the web template and I did not manage to bind it or the execute method to that button. Besides I was getting shortdumps when starting the web template with the customer extension web item. I declared it as ABAP_CLASS_NAME exit and set the right class name. Variable Container Access and Navigational State Access is on, Result Set Access is off.
    Is there any other possibility to do this? Perhaps with BSP?
    Can I call an ABAP function module with Javascript out of the template? If yes, which command can I use to do it?
    Thank you very much in advance
    Edited by: Markus Maier on Aug 17, 2009 4:15 PM
    Edited by: Markus Maier on Aug 17, 2009 4:32 PM

    Hi Markus,
    if you are on BI 7.0 or higher I recommend using Integrated Planning for this requirement. If you implement a fox formula you can easily get the current variable value and execute the function module. You can execute the fox formula upon button click.
    If you need more information just let us know.
    Brgds,
    Marcel

  • HT1218 After a recent iTunes update attempt iTunes no longer functions and the airport extreme base station is not accessable on our computer.  We still have wifi but cannot access the base station software.

    After a recent iTunes update attempt iTunes no longer functions and the airport extreme base station is not accessable on our computer.  We still have wifi but cannot access the base station software.

    Thanks for the reply. I appreciate the response. I tried that approach this evening and it didn't work for me. (Technically it worked for me, when I was hardwired into my base station, but would not work for me wirelessly, which is my main issue.)
    Again, using the approach you recommended works only if I have my ethernet cable attached to the LAN port so my computer is communicating directly to the base station through the hard wire. I am able to scan for my base station and make setting adjustments normally this way too.
    As soon as I disconnect from the LAN port and try to go wireless is where I run into problems. The Base Station's wireless network I created is available to choose in the top right corner of the monitor with all of the other available wireless devices/networks -- but the network I created does not have access to the internet. I am also unable to configure my Base Station wirelessly. When my Airport Utility tries to scan for the Base Station and Network, it cannot find any Apple Wireless Device. It's like the Wireless Network in my base station is not sending out a signal.
    Is there a way to resolve this issue?

  • Windows says "device is not functioning" and "Windows does not recognize"

    I lost my USB dock connector cable for my ipod. I just went out today and bought a brand new "Cygnett GrooveLink Strech Retractable USB Cable for iPod". I was pumped when I came home to finally be able to add music to my ipod again, but alas when I plug the iPod in, Windows pops up saying that the device is not functional and that Windows does not recognize it. I tried everything from rebooting the iPod to re-downloading iTunes and iPod updater. After searching this site for the past few hours, I figured I'd try and possibly find some real answers here. Please Help!!

    Hey everyone,
    I had the same problems all of you are having. I
    just got a 5th generation video ipod. For a few
    days, my computer a) wouldn't recognize it; b) froze
    up when I connected it; c) mistook it for a mass
    storage device ("drive E"). I bought a USB 2.0
    notebook card which didn't work either and actually
    seemed to make the problem worse because when I
    connected the iPod to it my computer froze up.
    I was very confused because my new iPod worked on my
    brother's computer--which is much older than mine but
    still recognized the iPod and connected to it.
    Then I noticed that my brother's computer is running
    an older version of the ipod software. I used his
    disk to install "Ipod Updater 2005-06-26" rather than
    the new version of the software on the Apple Web
    site. Then I plugged my iPod into a USB 1.1 port.
    To my surprise, my computer finally recognized the
    iPod and is now loading music onto it. I cannot
    believe this worked. I wonder if the latest version
    of the software is faulty in some way.
    Try it! I hope it will work for you too. You will
    need an older version of the iPod updater software,
    so borrow it from a friend with an older ipod.
    I am having this problem also...It will work fine on the 1.1 but when i plug it into the 2.0 it has trouble recognizing it...

  • User-Defined Function and Context Manipulation

    Hi Mapping Gurus, I need your help.
    I have a user-defined function and one of my input parameter (c) is in a loop (EDI segment).  So one, if I execute my function I get:
    Exception:[java.lang.ArrayIndexOutOfBoundsException: 0]
    If I change the context or use the remove context node function it’s working but it’s always taking the first row in consideration since I'm using c[0] .  Here is the logic:
    String WHERE_CLAUSE = "A"" = ""'"b[0]"'"" and B = ""'"c[0]"'";
    So since c is an array [], I have tried different logic to get to the right row.
    1- I tried using another parameter (e) to pass a counter or an index to my function.  So each time it's looping, it's passing a new value to the function but I’m still getting the first row and I’m not to sure why?
    int G = Integer.parseInt(e[0]);  // e[] = My counter field
    String WHERE_CLAUSE = "A"" = ""'"b[0]"'"" and B = ""'"c[G]"'";
    2- I tried using a parameter stored in the container:
    String Num;
    Num = (String)getParameter(“counter”);
    if (Num == null)  G = 0;
    else
    G = Integer.parseInt(Num);
    G = G + 1;
    String WHERE_CLAUSE = "A"" = ""'"b[0]"'"" and B = ""'"c[G]"'";
    Num = "" + G;
    setParameter(e[0], Num);
    and I’m still getting the first one, look like it’s using a different container each time it’s looping so the Value is always the same?
    4- I created a new user-defined function with the container logic, then it’s working but I’m back to the same problem in my main function, it’s only looking at e[0] for my counter all the time.
    5- I tried using the Seeburger Java Variables and guess what in the main fonction, as new UDF,... and guess what, same result!
    So anybody out there that was able to get UDF's working into a multiple context scenario?
    Am I missing something?
    I will reward points and beer for any help!

    This is one of the text with passing a counter to the function to try to go to the right row in the array since I'm doing a remove context and I'm getting all the d_234's:
    public void ReadTable(String[] a,String[] b,String[] c,String[] d,String[] e,ResultList result,Container container){
    int G = Integer.parseInt(e[0]); // My counter
    String var;
    String DBTABLE = a[0];
    String lookUpField = d[0];
    String WHERE_CLAUSE = "A"" = ""'"b[0]"'"" and B = ""'"c[G]"'";
    Now this one was with the internal container logic:
    int G;
    String DBTABLE = a[0];
    String lookUpField = d[0];
    String Num;
    Num = (String)getParameter(e[0]);
    if (Num == null)  G = 0;
    else
    G = Integer.parseInt(Num);
    G = G + 1;
    Num = "" + G;
    setParameter(e[0], Num);
    String WHERE_CLAUSE = "A"" = ""'"b[0]"'"" and B = ""'"c[G]"'";
    And now with the Seeburger Variables:
    int G;
    try {
    VariableBean be=VariableFactory.getVariableInstance("");
    G = Integer.parseInt(String.valueOf(be.getStringVariable("yves")));
    } catch (Exception f) {
    throw new RuntimeException(f);
    String DBTABLE = a[0];
    String lookUpField = d[0];
    String WHERE_CLAUSE = "A"" = ""'"b[0]"'"" and B = ""'"c[G]"'";
    try {
    G = G + 1;
    Num = "" + G;
    VariableBean be=VariableFactory.getVariableInstance("");
    be.setStringVariable("yves",Num);
    catch (Exception f) {
    throw new RuntimeException(f);
    All 3 logics were returning always the first row or a counter of 1 if the logic is in the main ReadTable function.

Maybe you are looking for