Receive array of record as a storeprocedure parameter

Hello!
Can I receive an array of record in a storeprocedure?
I have seen that in C sharp you can receive an array of varchar, for example, but I don' t know if it's possible to receive a complex type array like a record or you can only receive a simple type array like output parameter.
I work with this record:
TYPE prueba IS RECORD
TIPO VARCHAR2(30),
CODIGO varchar2(10),
DENOMINACION VARCHAR2(55),
COD_TIPO NUMBER,
DENOMINACION2 VARCHAR2(55)
Thanks!!

Hi, you can't pass array of record to stpred procedure, inside use UDT.
[See.|http://forums.oracle.com/forums/thread.jspa?messageID=3606898&#3606898]
Roberto
Edited by: rober584812 on Sep 19, 2009 5:26 PM

Similar Messages

  • ARRAY and records at multiple level ? please help

    Hi experts!!
    I am struck up with a problem. If u can please help me.
    I need a structure of this type.
    create type GRADE as object(
    grade varchar2(30)
    / -- works fine , creates
    create type GRADE_ARRAY as VARRAY(10) of GRADE;
    / -- works fine and creates
    create type SPECIES as object
    Species_number number,
    array_of_grade GRADE_ARRAY
    / works fine
    create type SPECIES_ARRAY as VARRAY(20) of SPECIES;
    -- error comes here.. Can not have multiple level..type error
    and so can not go ahead. In fect I wanted to use next level also. like this.
    The next command remains my dream only then because I could not create the SPECIES ARRAY it self..
    create type TIMBER as object
    timber_mark varchar2(6),
    no_species number,
    array_of_species(20) SPECIES_ARRAY
    the problem is for multiple level ARRAY AND RECORD/object combination..
    I tried with OBJECT AND VARRAY it does only for one level.. not even two level.
    my Mail ID:
    [email protected]
    Thanks and Regards..
    Virendra chauhan

    I think multi-level collections was first implemented in 9.2. You failed to mention what version of the DB you are using.

  • Create Array from Record

    Hi
    Somebody have a example how can I to create a Array from record ?
    tks

    Hi!
    Pls go through the followinglink --
    [url http://download-west.oracle.com/docs/cd/B14117_01/appdev.101/b10807/05_colls.htm]VArray From Record In Oracle
    Hope that will help u.
    Regards.
    Satyaki De.

  • Initializing a varying array of records?

    Hi everybody,
    Given below is a sample code. I have created a varying array of records. However I am unable to initialize the same. Can anybody help me out?
    DECLARE
    TYPE XRECORD IS RECORD(x NUMBER, y VARCHAR2(12));
    TYPE VARRAYTYPE IS VARYING ARRAY(10) OF XRECORD;
    xvartab VARRAYTYPE;
    BEGIN
    ----How do I populate/initialize the varying array
    --The following line gives me an error
    --xvartab := VARRAYTYPE(2,'XXXX');
    NULL;
    END;

    declare
       type xrecord is record(x number, y varchar2(12)); -- declare record type
       xrec xrecord; -- declare working record of type xrecord 
       type varraytype is varying array(10) of xrecord; -- declare varray type
       xvartab varraytype := varraytype(); -- declare and initialise varray of type varraytype   
    begin
       -- populate working record 
       xrec.x := 1;
       xrec.y := 'XXXX';
       -- make room for one new record in varray 
       xvartab.extend(1);
       -- insert record into element one of varray
       xvartab(1) := xrec;
       -- populate working record  
       xrec.x := 2;
       xrec.y := 'XXXX';
       -- make room for one new record in varray 
       xvartab.extend(1);
       -- insert record into element two of varray
       xvartab(2) := xrec;
       -- display record in element one of varray
       dbms_output.put_line('ELEMENT ONE : x='||xvartab(1).x||' and y='||xvartab(1).y);  
       -- display record in element two of varray  
       dbms_output.put_line('ELEMENT TWO : x='||xvartab(2).x||' and y='||xvartab(2).y);  
    end;
    SQL> /
    ELEMENT ONE : x=1 and y=XXXX
    ELEMENT TWO : x=2 and y=XXXX
    PL/SQL procedure successfully completed.
    SQL>

  • Array of records registerOutParameter

    Hi !!
    I have a Pl/SQL function that returns an array of records. I want to call this procedure doing the following:
    st =conn.prepareCall("{? = call partes.PROYECTOS_DISPONIBLES(?,?,?)}");
    st.registerOutParameter(1, oracle.jdbc.driver.OracleTypes.ARRAY);
    but i don4t know how to cast the oracle array that return this function to i can access to this data.
    could anyone help me???
    Thanks in Advance

    I have the following:
    Type PROYECTO_REC
    AS OBJECT
    fat_pry_codig varchar2(10),
    fat_pry_pro_are_div_soc_codig number(3),
    fat_pry_pro_are_div_codig number(3),
    fat_pry_pro_are_codig number(3),
    fat_pry_pro_codig number(3),
    fat_pry_nrevi number(3),
    fat_codig varchar2(10),
    icate varchar2(1),
    cod varchar2(10),
    dproy varchar2(50),
    denom varchar2(50),
    drazas varchar2(100),
    horasl number,
    horasm number,
    horasx number,
    horasj number,
    horasv number,
    horass number,
    horasd number);
    and a table of it:
    type tabla_proy is table of proyecto_rec;
    and i have a function in pl/sql that returns a table of this type and i want from jdbc to have access to the tabla that return this function.
    Could anyone help me????

  • What is the maximum number of records in a dynamic parameter list of values?

    In Crystal Reports Developer, I am attempting to add a dynamic parameter from a view.  The view has 6773 total records.  The field used for the parameter has 1819 distinct values, none of which are null.
    I have the parameter set to allow multiple values, and I have added
    field is equal to parameter
    in the select expert.
    However, when I refresh the report and tell it to prompt for new parameters, the list of values does not contain all the values, so about half of the records are dropped.
    Is there a way I can guarantee that all 1819 (or an unlimited number) records show up in the List of Values?

    This has been answered. Search forums for the results

  • Display 'No Data Found' if the records doesnot match the parameter

    Can anyone pls answer this question.
    I have just one parameter, if i select a value from the parameter and the results matches then the report shows records which is obvious but IF no data is matching to the value I selected in parameter, Can I didplay NO Data Found when I run the report??
    I want Display No Data found on my report, I just get a blank page with report title, date and PageNof M
    Someone pls suggest
    I am using CR 11.5

    hi,
    thanks for the suggestion but I am not clear about this part, i am sorry aboiut that:
    Create a text object with No Data Found in it.
    Conditionally suppress the text object with a formula similar to the following;
    {@countdbfieldformula} 0
    Where should i exactly drop my text box.
    I have parameter on 'Project Name'
    Pls suggest me something with steps...i would highly appreciate it

  • How to insert array of records in Storage table and  Nested table same time??

    Hi,
    I am using ProC++ ( Oracle 8i) . I want to insert a host array
    in a table. That table has a nested table in it. So for every
    record in my host array, there are muliple records to be
    inserted in Nested table. How is this possible using pro*C??
    Pls help.
    Thanks
    Nivedita

    Have a look at the Oracle 9i PL/SQL manual, which has an example.

  • Array of array of records

    hey, i have an array of twelve weeks, and each week is an array of 240 records which have a char for the status and an integer for the student number.
    I was wanting to store this structure to file, can anyone help me?
    preferably the data should be accessed randomly?
    thanks in advance!

    Hi.
    Take a look at the Java 2 API Documentation. The class RandomAccessFile should meet your demands.
    Regards,
    Kai

  • How to pass record set as procedure parameter.

    Hi All,
    I have a requirement, I want to pass the records that are fetched from a cursor to a procedure as a parameter.
    I dont want to use it inside the loop as we do it normally, as i might get huge volume of records using cursor, as a result the procedure also will be called number of times inside the loop.
    Can you suggest me the logic along with sample code?
    Thanks
    Suresh

    GSKumar wrote:
    I have a requirement, I want to pass the records that are fetched from a cursor to a procedure as a parameter.A cursor outputs rows - not "records".
    I dont want to use it inside the loop as we do it normally, as i might get huge volume of records using cursor, as a result the procedure also will be called number of times inside the loop.
    Can you suggest me the logic along with sample code?How else do you want to do it? If there are a million rows returned by the cursor, it means a million executions of that procedure - once for every row.
    This will be slow. And the primary reason is that executing a PL/SQL procedure (or any other code unit) for a million times, will be slow. Changing the cursor interface (from an implicit cursor to a ref cursor for example) does not change the fact there needs to be a million PL/SQL procedure executions - and does not make anything faster. To fetch rows from a cursor needs to a loop. Period.
    There are two basic ways to address this issue at hand.
    Use SQL and not PL/SQL. Instead of using PL/SQL code and logic, use SQL code and logic. This will be faster as the PL/SQL engine no longer plays a role and a million rows do not have to be send from the SQL engine to the PL/SQL engine. Instead that million rows are processed internally in the SQL engine - which will be faster. And which will provide scalable options such as using parallel query.
    Use "multi-threaded" PL/SQL. Assuming the PL/SQL code and logic are too complex to be done in SQL, the next best choice is PL/SQL. However, a single serialised PL/SQL process going through a million rows will be slow and will not scale. If parallel PL/SQL can be used, then 20 PL/SQL processes can each do 50,000 rows - as oppose to having to do a million rows.
    There are two options to "multi-thread" PL/SQL code. You can use DBMS_PARALLEL_EXECUTE (11g). You can use a parallel pipelined table function (10g and higher).

  • Using dynamic array as record selection criteria-performance issue

    Hi All,
    I have successfully passed an array to my subreport and using it as selection criteria. This subreport is embedded in a group and prints data recursively. Problem is the selection is happening locally which causes all the records to be brought and then filters them. Any solution/help will be greatly appreciated.
    Thanks, in advance.
    -Vishal

    Thanks Vinay. But I think I found my answer actually at the selection criteria I was creating an array from string as follows,
    stringvar array ConjugateLots = split( str, ",")
    in ConjugateLots* //this was causing the local fitration and then I switch to
    * in split( str, ",") // which worked.
    But once again thanks. But now I have another issue, I want the records to be sort in the array items. Any help with that also greatly appreciated.
    Thanks,
    -Vishal

  • Help: Stored procedure related problem: passing record data to a parameter?

    I am working a form and block A is based on a stored procedure. Assuming it contains customer information and in a tab form contains 20 customer's info. When the mouse cursor pointing to any one of the record, I'd like to pass the record, just one info to a parameter list. It is like: in a when_mouse_click
    :parameter.customer_name := :a.customer_name etc.,
    Thank you in advance.
    Jimmy

    Nobody can guess what your are doing and what error you are facing. You need to provide more details, like the code, calling method and the exact error message.
    Use tag to post your code.                                                                                                                                                                                                                                                                                                                                                                                                       

  • Records returned with static parameter, but don't when using dynamic

    Hello,
    I am using CR Developer, Version 11.0.0.1282   (BTW, I keep seeing references to Release 1 and Release 2, and I'm not sure which my version is.)
    I have a large database (500,000 land records) and each record has a value for Management Program and for Project Name. Within each Management Program there are many Project Names.
    If I set up a static parameter for Management Program, users are able to select a single Management Program (i.e. WMA, for Wildlife Management Area) from the dropdown list. This returns all records that have WMA listed as the Management Program, which thus includes all Project Names. This works fine, but I want to return just those records that are for a single Project Name.
    So I got rid of the static parameter and instead created a dynamic parameter, where the user first selects a Management Program, and then a single Project Name.
    I think I set up the parameters correctly, and the select formula (see below) includes those parameters. When I then try to run the report, I successfully get the expected drop down boxes, where I can first pick out the Management Program I want, then the Project Names that apply just to that Management Program.
    That part seems to work fine, but no data gets returned.
    The SQL query seems fine:
    SELECT "LAND_RECORDS"."TOWNSHIP",
    "LAND_RECORDS"."TOWNSHIP_DIR",
    "LAND_RECORDS"."RANGE",
    "LAND_RECORDS"."RANGE_DIR",
    "LAND_RECORDS"."SECTION",
    "LAND_RECORDS"."FORTY_DSC",
    "LAND_RECORDS"."GOVT_LOT",
    "LAND_RECORDS"."GROSS_ACRES",
    "LAND_RECORDS"."LAND_TYPE",
    "LAND_RECORDS"."PUBLIC_USE_ADMINISTRATOR",
    "LAND_RECORDS"."PUBLIC_USE_MGMT_PROG_CODE",
    "LAND_RECORDS"."PUBLIC_USE_PROG_PROJ",
    "LAND_RECORDS"."PUBLIC_USE_PROJECT_CODE",
    "LAND_RECORDS"."SURFACE_OWNED_CODE",
    "LAND_RECORDS"."PUBLIC_USE_MGMT_PROG"
    FROM   "LNDREC"."LAND_RECORDS" "LAND_RECORDS"
    WHERE  "LAND_RECORDS"."SURFACE_OWNED_CODE"='Y' AND "LAND_RECORDS"."PUBLIC_USE_MGMT_PROG"='WILDLIFE MANAGEMENT AREA' AND "LAND_RECORDS"."PUBLIC_USE_PROG_PROJ"='AGDER'
    ORDER BY "LAND_RECORDS"."PUBLIC_USE_MGMT_PROG_CODE",
    "LAND_RECORDS"."PUBLIC_USE_PROG_PROJ"
    And here is the selection formula:
    {LAND_RECORDS.SURFACE_OWNED_CODE} = "Y" and
    {LAND_RECORDS.PUBLIC_USE_MGMT_PROG} = {?Management Program - PUBLIC_USE_MGMT_PROG} and
    {LAND_RECORDS.PUBLIC_USE_PROG_PROJ} = {?Management Program - PUBLIC_USE_PROG_PROJ}
    Can anyone tell me why no records get returned when I use the dynamic parameter, while those same records (as well as the other records for that Management Program) get returned when I use the static parameter?
    Thanks in advance for any help you can give me.

    Hi Sanjay,
    When I wrote "glitch", I was pretty sure that was more likely indicative of a glitch in my primitive SQL skills than the software itself...     
    There is indeed a unique ID# associated with each Project. The problem is that there are thousands of projects, and people in the field are much more likely to remember the project name than the 8-digit long ID#.
    However, I found a way to make it work...
    I retained my first two parameters (Management Program, and Project Name), but then added a 3rd parameter for Project Code. The use first selects the Management Program, then the Project Name, and then the project code. But the only project code that appears as an option is the single one associated with the project name, and when they click on that, only the correct results gets returned.
    That one extra mouse click seems like a small price to pay so that you don't get extraneous results returned (i.e. getting results for both ANDERSON and ANDERSON LAKES when you ONLY request ANDERSON LAKES.)
    So, problem solved...thanks again for your help.
    Jon

  • How to get RECORD data in output parameter of stored procedure

    I would like to return some data through RECORD structure from stored procedure.
    I have defined the RECORD as below:
    type ShipmentStatus is record(
    Booked integer,
    OnWater integer,
    OnRoad integer,
    InAir integer,
    OnRail integer,
    InWarehouse integer,
    Idle integer);
    the stored procedure is defined as
    create or replace procedure SP_MC_GET_SHIPMENT_STATUS
    iCustId in nvarchar2,
    oResult out ShipmentStatus
    I can get result in Sql*plus or PL/SQL developer, but I failed in get the result in Toplink.
    How can I get the output result, and convert it to an ENTITY by Toplink?
    Could you give me some advices on how to do mapping, how to call the stored procedure etc.., or code snip?
    Your answer is deeply appreciated. :)

    I'm not sure it is possible to get the PL/SQL record type through JDBC. Please try to access this procedure through JDBC to see if it is possible.
    You may need to convert the record type, to an object-type, i.e. wrap the procedure in another procedure that converts the record type. You could also just wrap the procedure in another that expands the record values into individual output parameters.

  • Received [Microsoft][ODBC SQL Server Driver]Invalid parameter type

    Hi,
    This error happened when I am using CallableStatement
    to call a stored procedure.
    =====================
    cstmt.registerOutParameter(3, java.sql.Types.INTEGER);
    myResultSet = cstmt.executeQuery();
    =====================
    I am sure my stored procedure is returning 'int'.

    Hi,
    Here is the string:
    String procCallstmt = "{?=call stp_CheckLogon(?,?,?)}";
    the last parameter is the OUT parameter, it takes 'int' data type in the stored procedure
    CallableStatement cstmt = Conn.prepareCall(procCallstmt);
         cstmt.setString(1,vStr1);
         cstmt.setString(2,vStr2);
         cstmt.registerOutParameter(3, java.sql.Types.INTEGER);
         myResultSet = cstmt.executeQuery();
    ----------------------------------

Maybe you are looking for

  • Binding between Task and method dissappears

    The binding between task and method is dissappearing . I tried creating a new task altogether but still not working kindly help Edited by: kittu reddy on May 6, 2008 3:19 PM

  • My MS IE does not use J2RE 1.4.2_05

    I have some couple questions and a problem concerning installation of J2SDK SE 1.4.2_05 and J2RE SE 1.4.2_05. I am running WindowsME and Internet Explorer 6.0.2800, and have updated my Java several times. 1. In the Add/Remove Programs listing, I have

  • IDVD/Macbook/external DVD Burner

    Hi All, There are several threads already relating to this subject. I have read them, but am having a little trouble fathoming a straight answer to my query. I have a Macbook - 2GHz Intel Core Duo - 1GB 667 MHz DDR2 SDRAM with Leopard operating syste

  • I really dislike iTunes 11. How do I revert to an earlier version?

    I really dislike iTunes 11. How do I revert to the previous version (v10.6)?

  • The new guide: change just because, STILL CAN'T SEE CURRENT TV REMINDERS!!

    WHoever designed the NEW guide SHOULD BE FIRED IMMEDIATELY. WHY DOES IT STILL TAKE a dozen clciks to see a list of reminders OF CURRENT TV STATIONS THAT I HAVE SET A REMINDER FOR, but it's only a REMINDER LIST FOR FUTURE SHOWS?? DO you people actuall