Calling a database procedure which returns the array as output parameters

Hello


I wanted to call a procedure that returns "T_Disponibilidad_Diaria".

Type T_Disponibilidad_Diaria is Table of the R_Disponibilidad_Diaria
INDEX OF DIRECTORY;


Type R_Disponibilidad_Diaria is {Record

}

Please suggest me the best way to convert this type of array complex java object
Thanks in advance


Concerning
Vidya

But what you can do...

Try to create a new stored procedure, which returns the type of the database object.
In this procedure, you can call the original procedure.
Take what it returns and make the type object. That's what you need to retrieve your procedure ;-) (.. .huh?)

Tags: Java

Similar Questions

  • Call a procedure that returns an array of the results of dotnet

    Hi I have a function in the database (see below), I am creating a Web page and you want to call the function and get the results, how can I do this in dotnet using the ODP.net. does anyone have a code please... I called procedures in the database that return of refCursors but not tables.


    Type rec_user is record (call varchar2 (200),)
    Identification number);

    Type tab_user is table of the rec_user;

    function populate_user (piusername in varchar2) return tab_user;

    ------------------------------
    Concerning
    Ash

    Hello

    Registration table is a PLSQL type and cannot be called from OIC (this is what ODP.NET is written in). If you change the procedure to return the table or Varray of the object instead, you could do that with the support of the UDT available in ODP 11106.21 and higher.

    There is an example in this thread that you may find useful:
    By the way the table of the UDT or Collection, as IN to the OracleDbType.InputOutput HELP

    It will be useful,
    Greg

  • I want my procedure to return the error message in the batch file

    Hi team,

    I have a requirement from users of the company. Could you please provide your suggetsion to achieve this.

    We have a batch file that is short on time, in this batch file, I'll call you a SQL script.

    In the SQL script, I called you a procedure to run.

    Inside the procedure, I have the following statement,

    Select, insert and update commands.

    and I use ANOTHER exception to handle errors.

    My requirement is to pass the error messages for the batch file when one of the orders was not not run and send a notification e-mail to the group with the error text.

    Please provide your suggestion.

    Thank you and best regards,

    Robette.

    Could you please tell me, inside the procedure I have to remove the OTHER exception and how I can pass the value to the command file and where I add the content of the e-mail notification.

    I suggest that you write modular code instead.

    1. create a log table

    2 modify the procedure to log on to the error log table or exceptions

    3. that others suggest have the recovery/return procedure an exception in the client/batch file

    4. for an exception have the batch file to call a procedure to do the emailing if there were exceptions

    IMHO, it's a MISTAKE to try to put all these features in a single file. It is NOT scalable and makes it almost impossible to update the batch file if the requirements change in the future.

    Logging should be a separate process with a separate log table so that you can capture ALL of the information that may be necessary, now or in the future. Enter information in a table of newspaper, it is EASY for ANYONE to query to see what problems are occurring in the process.

    Emailing should be a separate process so that it can be used for your batch file current, files of future orders or even by procedures or functions in the database.

    Do not try to create a solution "a script does everything."

  • VcHostVirtualSwitch 'portgroup' object property returns the array of channels, no objects

    Something seems a little wrong here; on a vSphere 5.5 installation, you ask a traditional vSwitch (IE not dvSwitch) for exchanges that I do not receive the table of object of type [VcHostPortGroup], but rather an array of flat strings that cannot be extended.

    This seems to break the shares provided for registration of trade as well as my own code, so I suspect that some changes in the API 5.5 can have passed unnoticed since so few people more uses vSwitches.

    Could someone check the following code and see what happens:

    var hosts=Server.findAllForType("VC:HostSystem");
    
    
    var host=hosts[0];
    var switches=host.configManager.networkSystem.networkInfo.vswitch;
    
    for (var i=0; i<switches.length; i++) {
      vswitch=switches[i];
      System.log(vswitch);
      var pglist=vswitch.portgroup;
      for (var n=0;n<pglist.length;n++) {
      var pg=pglist[n];
      System.log (pg);
    System.log("Found portgroup "+ pg.spec.name +" with vlan ID "+pg.spec.vlanId); // This breaks
      }
    }
    
    

    Okay, so I figured this out on my own.

    There is a bug in the documentation in the API of vCO HostVirtualSwitch object does not point to a group of ports, but rather returns an array of strings "flattened" with the keys (not unique, useless) to the port associated with the vSwitch groups. It is correctly stated in the vSphere API reference but incorrect in the version of vCO, which may indicate that the code real vCO is incompatible as well.

    To recover a real populated HostPortGroup object you must descend through the successful HostNetworkInfo object; the portgroup here property is an array of the appropriate type.

  • Call a package.procedure that accepts an array type.

    I get the error message "Error (45.20): PLS-00330: incorrect use of the name of type or subtype" when I run the SP procedure when it calls the d.is_date procedure that accepts an array as the second parameter.

    Here's the short code for package.procedures that contain the "is_date.

    I tried several things and can't seem to get the SP to compile.
    Thank you.



    create or replace
    PROCEDURE SP ACE

    valid_out boolean;
    date of date_out;
    date_fmt_out varchar2 (30);

    type of Mask_Tabtype is
    table of varchar2 (30)
    index of directory;

    FMT Mask_Tabtype;

    BEGIN
    FMT (1): = 'fxDD-MON-RR ';
    FMT (2): = 'fxDD-MON-YYYY ';
    FMT (3): = 'fxDD-LUN;
    FMT (4): = ' fxMM/DD ";
    FMT (5): = ' fxMM/RRRR ";

    d.Is_Date ('test', Mask_Tabtype, Valid_out, Date_out, Date_Fmt_out);

    END SP;


    create or replace package d as

    type of Mask_Tabtype is
    table of varchar2 (30)
    index of directory;

    FMT Mask_Tabtype;

    Procedure Is_Date (Value_in in varchar2,
    Tab in Mask_Tabtype,
    Valid_out Boolean
    Date_out date,
    Date_Fmt_out out varchar2);
    end of;



    create or replace package body d as
    Whole Fmt_Count;
    Date of Date_Val: = null;
    Date_Fmt varchar2 (30): = ' fxMM/JJ/AAAA ";

    Procedure Is_Date (value_in in varchar2, Mask_Tabtype tab,
    Valid_out Boolean, Date_out date, Date_Fmt_Out out varchar2)
    is

    Start
    / * Logic here removed to make more small
    .........
    */
    End Is_date;
    End of;

    Ah, it's because you have tab_masktype stated in the package and in the calling code.

    Change your PS procedure declaration to be:

    Fmts d.Mask_Tabtype;
    

    and there is no need to declare Mast_tabtype in this procedure.

  • Input processor may not return the array

    Hi all

    I've set up an EntryProcessor to return the results of the calculated amounts, however, under the exception is thrown when retrieving the result. Any idea? I tried to change to return BigDecimal instead of BigDecimal [], it works. Why?

    Exception in thread "main" java.lang.ClassCastException: [Ljava.lang.Object; incompatible with [Ljava.math.BigDecimal;


    BigDecimal results = (BigDecimal []) CacheHelper.getCounterPartyCache () .invoke (new FttCntptId("052753"), new CreateOrderProcessor());

    Henry

    922963 wrote:
    Hi all

    I've set up an EntryProcessor to return the results of the calculated amounts, however, under the exception is thrown when retrieving the result. Any idea? I tried to change to return BigDecimal instead of BigDecimal [], it works. Why?

    Exception in thread "main" java.lang.ClassCastException: [Ljava.lang.Object; incompatible with [Ljava.math.BigDecimal;

    BigDecimal results = (BigDecimal []) CacheHelper.getCounterPartyCache () .invoke (new FttCntptId("052753"), new CreateOrderProcessor());

    Henry

    Hi Henry,.

    It can return the paintings, but he cannot return correctly typed arrays.

    On the client side, this table has been deserialized as an Object [] and not as a BigDecimal [] and, therefore, it cannot be cast to BigDecimal [].

    So just change the declaration of the Object [] results variable and do the distribution on the elements instead.

    Best regards

    Robert

  • stored procedure to return the number of rows

    Hello. How can I create a stored procedure that returns a number of lines such as select count (*) of the emp. I only know how to return a result set, but how to a single value. Need help please.

    Easy:

    CREATE OR REPLACE PROCEDURE get_count (p_count OUT NUMBER) IS
    BEGIN
       SELECT COUNT(*)
       INTO   p_count
       FROM   a_table;
    END get_count;
    
  • Simple HTTPService which returns the text

    I have made through Google and the documentation for it but still can't find what I want. Basically I have a php file that takes some of the entries, it treats and returns the text, I already know how to transfer the data to the flex php file, what I'm trying to do is get the text that returns the file and put it in a label in my flex application.

    So far, I have a function that the httpservice calls when the event "train", but so far, I still havn't found away to get the actual text that is returned, can someone tell me how to get this text the HTTPService?

    Just a note, I'm using the httpservice mxml form.

    The only thing is your text that is returned from php to be in xml format. Then, print your query result to XML first. And then parse through the xml in flex by using something like this:

    I created a script that analysis automatically any how MySql query that I throw at it as xml. There are some constraints you must follow while using it however.

    The caller script should have:
    $Query = a mysql query
    $queryName = 'name you give it. " This is also equal to the XMLRootName
    $tableName = 'name you give it. " This will correspond to the XMLResultSetName and doesn't really tell the table you are querying, but rather a generic name that you give the results table.
    $Result = mysql_query ($Query); the $Query is simply the veriable calling the actuall mysql query.
    include ('xmlParser.php'); place after the $Result statement.

    <-----------xmlParser.php------------>
    <>
    create the root node;
    $Return =""." \n"." \n » ;
    $Return. = «<$queryName>». » \n » ;

    treat a line at a time
    While ($row = {mysql_fetch_assoc ($Result))}

    Add node for each line
    $Return. = « <$tableName>». » \n » ;

    Add a child node for each field
    {foreach ($row as $fieldname-online $fieldvalue)

    $Return. = « <$fieldname>». "" $fieldvalue ". »«. » \n » ;

    } / / foreach

    $Return. = " «. » \n » ;
    } / / While

    $Return. = "«. » \n » ;

    ?>

    Then use the dataProvider to display resutls in Flex.

  • SELECT which returns the columns as DESCRIBED?

    Hello

    I need a SQL that returns the column name and type as DESCRIBED in SQL * more.

    I know that I can query all_tab_columns, but then I concatenate the string type myself.

    SELECT  column_name "Name"
           ,CASE WHEN data_type IN ('VARCHAR2','CHAR') THEN
                data_type||'('||data_length||')'
            WHEN data_type = 'FLOAT' THEN
                data_type||'('||data_precision||')'
            WHEN data_type = 'NUMBER' THEN
                CASE WHEN data_precision IS NULL THEN
                    data_type
                WHEN data_scale = 0 THEN
                    data_type||'('||data_precision||')'
                ELSE
                    data_type||'('||data_precision||','||data_scale||')'
                END
            ELSE
                data_type
            END "Type"
    FROM    all_tab_columns
    WHERE   table_name = 'ABC'
    ORDER BY column_id;
    

    An idea for another solution that considers each default data type?

    Concerning

    Marcus

    Tip: you can run a trace and see what SQL query rained questions on your account when you issue a describe statement.

    That said, I do not know if all the of that formatting is in the request or if it is made by the executable SQL more himself.

  • Using RemoteUpdateManager on labs Mac returns the code of output 0 immediately, Ute, the product is still on version 2015.1 instead of 2015.5

    I've never had this problem before updating my Adobe CC produts for the Mac Labs in the school that I work. Normally I just pull the terminal command

    usr/local/bin/remoteupdatemanager

    and the products are beginning to update themselves. For some reason any in this case, they return the exit code 0, but when I check the products that they are still stuck on 2015.1

    All advice is appreciated!

    I did some further tests on this issue.

    2015.5 Photoshop isn't an update for Photoshop 2015.5, this is a standalone version with a full installer which can coexist with earlier versions. So, it would be necessary to package and deploy the latest version of Photoshop. Once deployed, it can be updated with the current version of RUM.

  • function to return the array of strings, a given string

    Hi all

    someone at - it a procedure/function of relaible, which takes a string like "a |" b | c | d | e' and retrun me a table IE [a, b, c and d, e] so I can loop throug the table and do stuff?

    Cheers in advance

    Concerning

    Satnam

    Hi, Michel,.

    You can loop through the string itself and do things.

    FOR  j IN 1 .. ( LENGTH (txt) -          -- In Oracle 11, use REGEXP_COUNT instead
                          LENGTH (REPLACE ( txt
                          , '|'
                         )
                   )
                ) + 1
    LOOP
         this_item := REGEXP_SUBSTR ( txt
                                , '[^|]+'
                           , 1
                           , j
                           );
         ...
    END LOOP;
    
  • Help returns the array of query results

    Hi all... Pretty new to this so please forgive my ignorance. Running Oracle 11 g, trying to return results as in the example I give below. I don't know how the Sport field will have unique values, and I don't know how many unique values the year field is seen in the data. Does anyone have recommendations/suggestions?

    The structure of the table is:
    Year of sport
    Baseball 10-11
    Football 10-11
    Football 11-12
    Football 11-12
    Football 11-12
    Baseball 11-12

    The result should be sports in each year and should be grouped by year but shown as columns so:
    (GROUP OF the year)
    1, baseball 1, Football
    2, 1, Football Soccer 1, Baseball


    I hope that makes sense. Thanks for any help!
    ... Kaelon

    Does anyone have recommendations/suggestions?

    Maybe something like:

    SQL> with t as (
     select 'Baseball' sport, '10-11' year from dual union all
     select 'Football', '10-11' from dual union all
     select 'Football', '11-12' from dual union all
     select 'Football', '11-12' from dual union all
     select 'Soccer',   '11-12' from dual union all
     select 'Baseball', '11-12' from dual
    )
    --
    --
    select year, listagg(cnt || ', ' || sport, ' ') within group (order by cnt desc) sports from (
    select count(*) cnt, sport, year from t
    group by sport, year)
    group by year
    /
    YEAR    SPORTS
    ------- ----------------------------------------
    10-11   1, Baseball 1, Football
    11-12   2, Football 1, Baseball 1, Soccer       
    
    2 rows selected.
    

    ?

  • call a stored procedure for each row in the transitional attribute and display the data in the form of af: table. The other rows are based on the entities

    Hi Experts,

    JDeveloper 12.1.3.0.0

    I have a VO based on entity object. With a column of the VO is transient attribute (I created).

    I need to call a stored procedure for each row in the transitional attribute and display the data in the form of af: table. As well as other attributes.

    So can anyone suggest how can I achieve this?

    Thank you

    AR

    I think that you need a stored function (which returns the value) in this case, is not?

    Take a look at:

    https://docs.Oracle.com/CD/B31017_01/Web.1013/b25947/bcadvgen005.htm

    and search for:

    Invoking stored function with only Arguments in

    call your function in the Get attribute and return value accessor...

  • Error in the call to a procedure that is packed on another schema with the alias name

    Hi all

    I call a packaged procedure that has the type as a parameter collection that resides in the remote database by using synonyms.for which I am creating a synonym in my current schema.

    Below the package in the remote database:
    CREATE or REPLACE PACKAGE test_hlr BODY
    AS
    PROCEDURE raj_test)
    pi_username IN VARCHAR2,
    pi_serial_no IN arr_numb, - type of user-defined collection
    po_error_code OUT NUMBER
    )
    AS
    BEGIN
    BECAUSE me IN pi_serial_no. FIRST... pi_serial_no. LAST
    LOOP
    INSERT INTO hlr_raj
    (user_name, serial_no
    )
    VALUES (pi_username, pi_serial_no (i)
    );
    END LOOP;
    END;
    END;



    I'm create synonym of package in my current database and call this package synonymous as shown below

    create synonym ram_test for ram_test@dblink

    CREATE or REPLACE PACKAGE test_bnr BODY
    AS

    PROCEDURE ram_test)
    pi_username1 IN VARCHAR2,
    pi_serial_no1 IN arr_numb, - type of user-defined collection
    po_error_code OUT NUMBER
    )
    AS

    BEGIN
    test_hlr.raj_test (pi_username = > pi_username1,)
    pi_serial_no = > pi_serial_no1,
    po_error_code = > po_error_code
    );
    END;
    END;

    When compiling above package am getting error below
    PLS-00306: wrong number or types of arguments in the call to ' RAJ_TEST


    If I remove the collection type and use types of primitive data and then do not get error.

    Please give suggestions, about the same.

    Kind regards
    Sri Ram.

    There is no need to declare the type arr_numb locally. In fact, two types with exact same statement and namesake are not the same type. Each type has a unique OID. You can specify own OID. Then you can create the types the and remote with same OID. But if the type is the type of PL/SQL it didn't need to. For example. ON remote DB:

    create or replace
      package pkg1
        as
          type arr_numb is table of number;
          procedure p1(
                       p_numb_arr IN arr_numb,
                       p_sum OUT number
                      );
    end;
    /
    create or replace
      package body pkg1
        as
          procedure p1(
                       p_numb_arr IN arr_numb,
                       p_sum OUT number
                      )
            is
            begin
                for i in 1..p_numb_arr.count loop
                  p_sum := nvl(p_sum,0) + p_numb_arr(i);
                end loop;
          end;
    end;
    /
    

    Now locally:

    set serveroutput on
    declare
        v_numb_arr pkg1.arr_numb@sol10;
        v_sum number;
    begin
        v_numb_arr := pkg1.arr_numb@sol10(1,2,3,4,5,6,7,8,9);
        pkg1.p1@sol10(v_numb_arr,v_sum);
        dbms_output.put_line(v_sum);
    end;
    /
    45
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    

    SY.

  • Return an array of strings of call library function node

    Hello

    I'm having a few problems getting the following work.

    I have a camera from a manufacturer that came with its own .dll and header files. I'm calling the LabVIEW .dll file (2011). In total, there are about 50 functions, and there is a rest that I can't go to work (probably because I understand enough about the topic to interface with an external code).

    The description of .dll is delivered with the following text:

    #define length

    #define MAX_CONFIGURATIONS

    Prototype: int ConfigListGet (char (& sConfigurations) [MAX_CONFIGURATIONS] [length]);

    and the header file with:

    extern "C" __declspec (dllexport) int RepRateConfigurationListGet (char (& sConfigurations) [MAX_CONFIGURATIONS] [length]);

    The function should return an array of strings to the list of configurations.

    The problem I have is that I can not understand how to return the array of strings for the node of the library function call to LabVIEW. I looked a little on the web and the examples in LabVIEW and I can't find anything specific to return an array of strings in this way, so if anyone can point me in the right direction I would really appreciate it.

    Also, if I click with the right button on the node library function call and click on "File Create.c", I would be able to create the prototype of function even that above? I tried this but no luck. Was the closest I came:

    int32_t RepRateConfigurationListGet (char sConfigurations [], uint8_t MAX_CONFIGURATIONS, uint8_t MAX_LEN);

    Thank you very much in advance for any help!

    D

    Hello!

    I tried once using an array of U8, converting it to a string and then split into an array.

    Here is my old piece of code (the split part can be cleaner ;=))

    Kind regards

    Marco

Maybe you are looking for

  • Spectrum of HP 13-3010ea: bluetooth receive do not

    This is a last resort, after using HP Supportr cat, to solve a problem of bluetooth without having recourse to the system recovery! I used bluetooth to transfer files from my phone to the HP spectrum (especially photos) in the past. Always worked ver

  • Extrinsic parameters (rotation matrix)

    I wonder how the extrinsic parameters of a camera can be constant? I know that the rotation matrix aligns the landmark World axes toward the camera Locator, and the translation vector/matrix aligns the origo on each other. But how parameters can be c

  • Internet browsing using memory

    This morning, my computer showed 4.5 GB of free memory.  My daughter was on the internet for about 45 minutes and after that, our memory had fallen to 5.7 MB.  No music or pictures have been uploaded.  This may be the cause?  Let me know any other in

  • Compatibility of the video card?

    I just got a Dell Optiplex 745 of Amazon of an official repairer and want to upgrade to 64-bit. I need a video card that is compatible with this computer. If I get one and then change the OS sytems from 32 to 64 bits after installing the video card w

  • Why not save a vector file in creative cloud?

    As a professional Illustrator, I've been a fan of Adobe ideas: work completed, just sent me a vector file and... Ok. Or instead, it was recorded at my creative cloud like a .ideas backed up by file. Perfect.Draw came with large additions to the ideas