How to assign values in the first array 2D array

Hi in my 2D array, I would like to store the Sessions in the first table and identifiers reserved for these sessions in the second table. I want to accept three booking by session and there are altogether 4 sessions. And I want to name the session as "session1", "session2" and "session3" but I don't want to set the value of the user ID since they are going to be some user input. So I have this table 2D.
String [] [] booking = new reservation [4] [3];
How can I assign the first table (the part of session), with values session1... pleniere4 please? Hope that makes sense for you.
I tried
Reservation [0] = "session1". but it showed an error.
Thank you.

Reservation [0] = "session1". but it showed an error.

Won't work because your table looks like this.

String[][] booking = new booking[4][3];
/*
 * booking[0][0]
 * booking[0][1]
 * booking[0][2]
 *
 * booking[1][0]
 * booking[1][1]
 * booking[1][2]
 *
 * booking[2][0]
 * booking[2][1]
 * booking[2][2]
 *
 * booking[3][0]
 * booking[3][1]
 * booking[3][2]
 */

If you use both indices to define each reservation

booking[0][0] = "session 1";

Tags: Java

Similar Questions

  • How to assign values to the nested table and passes as a parameter for the procedure?

    How to assign values to the nested table and passes as a parameter for the procedure?

    Here are the object and its type

    create or replace type test_object1 as an object
    (
    val1 varchar2 (50).
    val2 varchar2 (50).
    VARCHAR2 (50) val3
    );


    create or replace type test_type1 is table of the test_object1;


    create or replace type test_object2 as an object
    (
    val1 varchar2 (50).
    val2 varchar2 (50).
    VARCHAR2 (50) val3
    );


    create or replace type test_type2 is table of the test_object2;


    GRANT ALL ON test_object1 to PUBLIC;


    GRANT ALL ON test_type1 to PUBLIC;


    GRANT ALL ON test_object2 to PUBLIC;


    GRANT ALL ON test_type2 to PUBLIC;

    Here is the table object type:

    create the table test_object_tpe
    (
    sl_num NUMBER,
    Description VARCHAR2 (100),
    main_val1 test_type1,
    main_val2 test_type2
    )


    NESTED TABLE main_val1 STORE AS tot1
    NESTED TABLE main_val2 STORE AS earlier2;


    -----------------------------------------------------------------------------------------------------------

    Here is the procedure that inserts values into the nested table:

    PROCEDURE INSERT_TEST_DATA (sl_num in NUMBER,
    Description in VARCHAR2,
    p_main_val1 IN test_type1,
    p_main_val2 IN test_type2
    )
    IS
    BEGIN

    FOR rec in p_main_val1.first... p_main_val1. Last
    LOOP

    INSERT INTO xxdl.test_object_tpe
    (
    sl_num,
    Description,
    main_val1,
    main_val2
    )
    VALUES
    (
    sl_num
    description
    test_type1 (test_object1)
    p_main_val1 .val1 (CRE),
    p_main_val1 .val2 (CRE),
    p_main_val1 .val3 (rec)
    )
    )
    test_type2 (test_object2 (p_main_val2 .val1 (CRE),
    p_main_val2 .val2 (CRE),
    p_main_val2 .val3 (rec)
    )
    )

    );

    END LOOP;

    commit;

    END INSERT_TEST_DATA;

    -------------------------------------------------------------------------------------------

    Here are the block anonymoys what values attributed to the object type and pass values in the procedure:

    Set serveroutput on;

    declare

    p_sl_num NUMBER: = 1001;
    p_description VARCHAR2 (50): = 'Test Val1;

    inval1 test_type1: = test_type1();
    inval2 test_type2: = test_type2();

    Start


    inval1 (1) .val1: = "testx1";
    inval1 (1) .val2: = "testx2";
    inval1 (1) .val3: = "testx3";

    inval2 (1) .val1: = "testy1";
    inval2 (1) .val2: = "testy2";
    inval2 (1) .val3: = "testy3";

    CSI_PKG. INSERT_TEST_DATA (sl_num = > p_sl_num,)
    Description = > p_description,
    p_main_val1 = > inval1,
    p_main_val2 = > inval2
    );

    end;
    /
    Someone can correct me.

    Thank you
    Lavan

    Thanks for posting the DOF and the sample code but whenever you post provide your Oracle version 4-digit (result of SELECT * FROM V$ VERSION).
    >
    How to assign values to the nested table and passes as a parameter for the procedure?
    >
    Well you do almost everything bad that could be hurt.

    Here is the code that works to insert data into your table (the procedure is not even necessary).

    declare
    p_sl_num NUMBER := 1001;
    p_description VARCHAR2(50) := 'Testing Val1';
    inval1 test_type1 := test_type1();
    inval2 test_type2 := test_type2();
    begin
    inval1.extend();
    inval1(1) := test_object1('testx1', 'testx2', 'testx3');
    inval2.extend();
    inval2(1) := test_object2('testy1', 'testy2', 'testy3');
    
    INSERT INTO test_object_tpe
    (
    sl_num,
    description,
    main_val1,
    main_val2
    )
    VALUES
    (p_sl_num, p_description, inval1, inval2);
    commit;
    end;
    /
    

    See example 5-15 making reference to an element of nested Table Chapter 5 using PL/SQL collections and records in the PL/SQL doc
    http://docs.Oracle.com/CD/B28359_01/AppDev.111/b28370/Collections.htm#CJABEBEA

    1. you don't even have the procedure because it is a simple INSERTION in the table you can do directly (see my above code)

    inval1(1).val1 := 'testx1';
    

    Since you have not yet created all the elements, there is no element 1 "inval1". You need EXTEND the collection to add an element

    inval1.extend();
    

    And then, there is an empty element, but "inval1" is a container for objects of type 'test_object1' not for scalars as "val1", "val2", and "val3".
    If you can not do

    inval1(1).val1 := 'testx1';
    

    You must create an instance of 'test_object1 '.

    inval1(1) := test_object1('testx1', 'testx2', 'testx3');
    

    And so on for the other collection

    You don't need the procedure (as my code example shows), but once you fill in the variables correctly it will work.

  • How to assign values to the application points to leave on a table

    Hello

    I have a FORM on a table with two or three elements. How to assign values to the elements of the application with the values in the elements of form, every time the value of the element is entry, change or page is sent?

    I created a dynamic action to the region level with Event - change to run the suite of PL/SQL, I tried with 3 different ways in PL/SQL, as shown below, but it didn't work.

    BEGIN

    : APP_FY: =: P1_FY;

    END;

    BEGIN

    APEX_UTIL. SET_SESSION_STATE ('APP_FY', v ('P1_FY'));

    : APP_FY: =: P1_FY;

    END;

    BEGIN

    APEX_UTIL. SET_SESSION_STATE ('APP_FY', v: P1_FY);

    END;

    Then I created an action dynamic at the ITEM level with change event to run the suite of PL/SQL and tried with PL/SQL, as shown below, but it didn't work.

    I need to assign values to the elements of the request form as these elements of the application will be used in many other pages in the application. How to I get there?

    Thank you.

    If a dynamic action of PL/SQL execution, you must send your list of page elements in the parameter "Elements of Page to submit.

    See the section 'run pl/sql' for this post.

    If the page is submitted, the elements of the page will be automatically set to session state, and you can have a page process make the code you have.

  • How to set values in the 2D array?

    Hello

    I need help in creating a 2D of some entries of the tables table

    (1) the table of chains with three values should be in first position

    (2) then there's another table 2D containing 3 times 10 values.

    I want to show now these ten values of the three columns.

    How is that possible?

    Thank you

    Hello

    using "Build-table", values range from left to right. Besides, they are not under the column names.

    You must use BuildArray in the right order!

    Sometimes it can be so easy:

  • How to assign values to the current element where the cursor is?

    Hi all

    I have a block of "tabular" data, B_Emp (from the Employee table) and the other non-database & non tabular block consisting of a text_items B_Test.

    'Emp_id' is one of the column in the Employee table and I want to attribute all the values of the Emp_id in all text_items of the B_Test in order, when you press a particular key.

    Here's what I wrote in the trigger

    Declare

    i the number;

    number of l_last_record;

    next varchar2 (40); -to hold the values of cursor system of the next item in the block of B_Test

    next_r varchar2 (40); -to hold the values of cursor system of the next record in the block of B_Emp

    Begin

    go_block ('B_Emp');

    Set_Block_Property ('B_EMPLOYEES_ALL', DEFAULT_WHERE, "Emp_id is not null");

    execute_query (no_validate);

    last_record;

    l_last_record: =: system.cursor_record;

    premier_enregistrement;

    next_r: =: SYSTEM. CURSOR_ITEM;

    go_block ('B_Test');

    Next: =: SYSTEM. CURSOR_ITEM;

    because me in 1.l_last_record

    Loop

    go_item (Next);

    : next: =: B_Emp.Emp_id;-here is the problem

    next_item;

    Next: =: SYSTEM. CURSOR_ITEM;

    go_item (next_r);

    next_record;

    next_r: =: SYSTEM. CURSOR_ITEM;

    WHEN THE OUTPUT: SYSTEM. LAST_RECORD = "TRUE";

    End loop;

    End;

    Now, this gives me the expected bad Bind Variable error as there is no block of data with the name "next".

    However, I checked the value of 'next' and 'next_r' (message (' value = ' | next)) and I'm getting the expected values.

    So if somewhere, I am able to put my value in the current item the cursor (because at the beginning of the loop, my cursor system is exactly to the text element where I need to insert the value) so I did not have to use this " : next: =: B_Emp.Emp_id;"

    OR

    If somewhere, I am able to return the items in my B_test block dynamically so I can simply use

    Loop

    ": B_test." dynamic reference for the element ": = : B_Emp.Emp_id;

    next_record;

    WHEN THE OUTPUT: SYSTEM. LAST_RECORD = "TRUE";



    Please help me out of this!

    Guy! I found a solution for the same thing.

    We can use integrated a 'copy' to set the values of the element where currently is cursor system.

    The syntax will be

    Copy ((new_value): System.Cursor_Item);

    -where new_value is the variable that contains the data to be assigned.

    In addition, we can assign the values from the system cursor to any variable.

    The syntax will be '

    new_value: =: System.Cursor_Value;

    Thanks a lot guys for your help and concern

    See you soon!

  • How to assign values to the fields (topic-one under the other) in multiple output forms (cursor)?

    Hi all

    I have a form that has text_field columns below, from the RECEIVED_FORM_15G table. This table is empty.

    (1) CUST_CODE with 1 line item. (Number of items displayed = 1)

    (2) ACCT_FD_NO with 10 line items. (Number of displayed items = 10)

    There is more than 1 ACCT_FD_NO to 1 CUST_CODE.

    When I enter the CUST_CODE and press tab, all ACCT_FD_NO values should appear. I take values in another table called KEC_FDACCT_MSTR ACCT_FD_NO

    and in the ACCT_FD_NO, one under the other (topic). So I put in the following code:

    BEGIN

    PREMIER_ENREGISTREMENT;

    FOR CUR_R IN (SELECT ACCT_FD_NO FROM KEC_FDACCT_MSTR WHERE STAUS = 'E' AND ACCT_CUST_CODE =: CUST_CODE)

    LOOP

    NEXT_RECORD;

    : ACCT_FD_NO: = CUR_R.ACCT_FD_NO;

    END LOOP;

    END;

    But the problem is that I'm not able to view the value captured in the next consecutive line items.

    It appears in the first and second line item only.

    The first value gets displayed in the first column, then the cursor moves to the first line item in the second line of command,

    the second value is shown in the second line of billing, (it's because of NEXT_RECORD in my code)

    more later all the values displayed in the second line item only. (I checked with message call.)

    I want it to display one under the other.

    The problem is that the cursor does not move to the third line item after the second line item.

    If the remaining values gets displayed in the second line item only.

    So what is the problem in my code?

    Where should I put the next_record to move the cursor from one line to the next line item item IE the second line item to the third line item

    & the third line item in the fourth line of billing and so on...  Please let me know.

    Thank you.

    Is Oracle Designer 6i

    Oracle 9i.

    The above code is just...

    The only error was in the palette property of CUST_CODE, 'required' was not set to 'Yes'.

    So after the setting for the 'YES', this has worked perfectly well.

  • How better to insert a subarray (line) in a 2D array to the correct index which is based on the value of the first column

    Hello

    I would like to insert a subarray (line) in a 2D to the correct index table. The position is to say the index value depends on the value of the first column of the table 2d.

    As an examlple my 2d array would look like this

    230 50 215 255

    300 60 270 330

    360 20 350 370

    And I would like to insert another line (subarray) with the following values

    320 40 300 340

    This new line should be placed between the second and third rows (this is based on the first column only).

    I tried the threshold 1 d function table by taking an 1Dsub array of my 2d array (first column), then using the first of the new line (320) as the threshold. It sort of work, but it does not work when I start the table (IE there is only 1 row) and it seems to not work properly on other occasions (as explained in the help of Labview).

    Hopefully the explanation is clear enough for any suggestion. Thanks in advance for the help!

    JTRI wrote:

    The idea is I have start with a new table and add these lines in the right order every time that the user sets the values Jack

    Ahh, so try this.

    This will also work with an empty array.

    You want to do with this function it is a Subvi.

    Make the entries 'table' and 'subarray"on the connector, then 'new array' output.

    You can then put this Subvi in a loop with a registry to shift and it will help to add new lines in a sorted order, when they are added.

    That is what you were aiming for?

  • How can you specify the default value for the undefined array elements

    According to aid LV, the tables have two default values, the normal default value and the default value for the undefined array elements.

    I assume that there must be a way to specify the default value for later, but I can't find it anywhere.  Any ideas?

    I know that you can drag the item out of the table container.  Change the default value on this scalar element.  Then drag the item in table tank.

  • Before the process of pl/sql header to assign values to the elements on the page

    How can I assign values to the elements of a page based on the data structure returned by a pl/sql procedure in the front header process? I think execution of a pl/sql procedure based on a URL parameter value and then assign values to the page elements. Is this really possible using Apex 4.0.2? If so, how can it be done?

    Thank you

    Salome

    The question is not really clear. What kind of "data structure returned by a procedure from pl/sql? Please be much more accurate.

    For a data structure of PL/SQL such as records containing 2 elements (x and there) returned as output parameter for a procedure to be assigned to 2 items p1_x and p1_ypage, all that is necessary in the header before process is something like

    declare
    ...
      l_rec rec_type;
    ...
    begin
    ...
      the_proc(..., p_out => l_rec, ...);
    
      :p1_x := l_rec.x;
      :p1_y := l_rec.y;
    ...
    end;
    
  • I just bought an iphone 6 more, how long should I charge the first time?

    IPHONE 6 MORE

    64 GB

    I just bought an iphone 6 more. How long can I collect the first time thank you!

    You can load for however long you want or have time for. Lithium-ion batteries must be completely loaded or empty completely before using it.

    See this article for more information support:

    http://www.Apple.com/batteries/maximizing-performance/

  • values based on the following logic 'values after the first values of two '_' and before last '_' values '.

    Hi all

    I need the values according to below 2logics in a single select query using instring and substring

    1 values based on the following logic 'values after the first values of two '_' and before last '_' values '.

    2 values based on the following logic 'values after the first values of two '_' and before last'-'values '.

    EXM:

    Entry: ABCD_EFGH_IJKLM - NOPQ_XYZ output: IJKLM - NOPQ

    Entry:. ABCD_EFGH_IJKLM - NOPQ output:IJKLM

    Thank you.

    Check the following

    WITH DATA1 AS

    (SELECT "ABCD_EFGH_IJKLM - NOPQ_XYZ" double val)

    UNION ALL

    SELECT 'ABCD_EFGH_IJKLM - NOPQ' double val

    )

    SELECT SUBSTR (VAL, INSTR(VAL,'_',1,2) + 1, DECODE (BIGGER (INSTR (VAL, '_',-1, 1), INSTR(VAL,'-',-1,1)), INSTR (VAL,'-', - 1, 1), LENGTH (VAL) + 1, INSTR (VAL, '_',-1, 1))-(INSTR (VAL, '_', 1, 2) + 1))

    OF DATA1;

    Concerning

    Salim

  • How to transfer values to the popup while the bean in application scope?

    Hi all

    I use JDeveloper 11.1.1.4

    My scenario is that I have a < af:popup > with a component of < af:outputText >.

    I need pass values of output text dynamically according to the scenarios.

    My grain of support is application scope . So I'm not able to pass values using get and methods.

    My Design as,

    < af:popup id = "p1" contentDelivery = "lazyUncached" >

    < af:outputText value = "#{managedBean.getDynamicText}" id = "ot1" / > "

    < / af:popup >

    Now I run the application I'm not get all values in text during debugging output, I am able to set the value, but it didn't reflect on the page.

    How to transfer values to the popup while the bean in application scope?

    Thank you...

    At the bean, why don't you set the value to a variable pageflowscope and point the outputtext popup to the pageflowscope variable?

    () .getpageflowscope, set AdfFacesContext.getCurrentInstance ("nomvar", value);


    Thank you

    Alisson

  • Data mining - error on the insertion of the TREE_TERM_MINPCT_MODE value in the parameter array

    Hello

    In Data mining when I tried to insert some values into the parameter array. I get the error by trying to introduce TREE_TERM_MINPCT_MODE in the table.

    The model who was on trial for create was decision tree.

    BEGIN

    INSERT INTO DT_CA_SETTINGS_TEST (SETTING_NAME, SETTING_VALUE) VALUES

    (dbms_data_mining. TREE_TERM_MINPCT_MODE, to_char (1));

    END;

    Error report:

    ORA-06550: line 3, column 22:

    PLS-00302: component 'TREE_TERM_MINPCT_MODE' must be declared.

    ORA-06550: line 3, column 22:

    PL/SQL: ORA-00984: column not allowed here

    ORA-06550: line 2, column 4:

    PL/SQL: SQL statement ignored

    06550 00000 - "line %s, column % s:\n%s".

    * Cause: Usually a PL/SQL compilation error.

    * Action:

    Thank you
    Srikanth.

    Hello

    BEGIN

    INSERT INTO DT_CA_SETTINGS_TEST (SETTING_NAME, SETTING_VALUE) VALUES

    (dbms_data_mining. TREE_TERM_MINPCT_NŒUD,to_char (1));

    END;

    This isn't 'Mode' his 'NŒUD '.

    Run now.

    See you soon...

  • How to go back to the first image of a directory

    Hello!

    I tried the HOME button, but nothing happened.

    How can I go to the first or the last image without pressing on for many minutes right or left arrow?

    Best regards

    'Ctrl-Home to go to the first image' or Ctrl-End works, if you are in the library Mode AND have enabled grid display. But it also to change only the display of grid, not the big picture on the background.

  • Need to use values from the first query in other queris to the data model

    Hello
    Here is my requirement-

    I use the data model to run multiple queries. The first query, I get 10 records. Now, I want to use these 10 records in the second query to get my final result. I am not able to use the sub query as the two motions are quite long and complex.

    Select distinct Bishop of emp

    Select empno, emp where Bishop in (: Bishop)

    I can't use: Bishop because it will give only the last value stored at Archbishop. Is it possible to be able to use all the values from the first query in the second query using the data model?

    Hello

    Are you sure that you have your "dataStructure" configured correctly? Try this simple example:

                                                                          
    

    Hope this helps

    Andy

Maybe you are looking for

  • Firefox sends reports of incident without my permission

    I noticed that Firefox was to send crash reports to Mozilla without my permission several times lately.Under "data selection", I see crash unchecked, but the notification window appears now and then after a crash.I have never checked "notify Mozilla

  • Lenovo B5400 CPU update

    Hello. I'm just here on a small issue. Is that what the CPU B5400 Lenovo's extensible? The best would be like... I5 or I7... If possible. I have already 8 GB of Ram, enough good graphics card and processor is the only thing that slows down the comput

  • Table of cleavage according to its index

    Hi all I want to have a 'demux' block which, having a table (2Nx1) as input, splits the data into two tables (Nx1) as output the first array index is even or odd... At first, I tried to implement this with a structure matter in a while loop: But this

  • stopped updating Windows Installer

    Hi, I have just notced my computer has ceased to install the automatic updates of windows. I now need to install the most recent update and I can't download it, can help me please in the easiest way possible

  • Cannot update Windows 7 x 64 Home edition

    Have been away from home for more than a month so the computer is turned off.  Just come home and turned on the computer.  Any fine.  Went on the web and update my programs of virus with no problems.  Go to Windows update and it keeps looking for upd