table.getSelectedRowKeys () is null

Hello experts, I display table in the iterator.   Jdev worm is 12 c.

The myList list shows 3 tables, because it has 3 child lists.    When I select a line and click on submit, in the bean method, I get getSelectedRowKeys() with a null value.

< af:iterator id = value = "#{viewScope.myBean.myList 'i1'} ' var = 'row' ranks = '0' >"

< af:table var = 'trow' rowBandingInterval = '1' id = 'tApprove '.

columnStretching = "column: c1" width = "600 x;"

value = "#{row.childListLevel1} '"

"emptyText =" no data Found ".

rowSelection = 'single '.

Binding = "#{viewScope.myBean.MyTable}" >

< af:column headerText = "" id = "c1" > "

< af:outputText value = "#{trow.childNameLevel1}" id = "ot6" / > "

........................................

< / af:table >

< / af:panelHeader >

< / af:iterator >

RowKeySet rksSelectedRows = myTable.getSelectedRowKeys ();

I have rksSelectedRows with a null value.

Appreciate your help.

Thank you.

Since your table is in the iterator, the binding 'myTable' hold not the refrence to your table as it would create several tables and all will have the same binding.

Instead, you can write code for selectionListener to enter online id and when the click on the button "submit" this line id can be accessed.

Tags: Java

Similar Questions

  • Add the constraint not NULL in the existing table that has null values

    Hello

    I want to add a constraint not null to and an existing table, but the table already contains values null in this column.

    EMP

    Emp_id name

    1 axada

    2

    3 sdkdd

    Here is already the data IE 2 empid is Null as name. I must add a fool of constraint not null which new values will not be null, but I don't want to change the data of exisitng alreadt which is null.

    Hello

    "The opposite": NOVALIDATE does not validate the data that is ALREADY in the table, but do not allow the insertion of a NULL value.

    Have you tried my sample code?

    CREATE TABLE MaTable (x NUMBER PRIMARY KEY, y NUMBER);

    INSERT INTO myTable VALUES (1, 123);

    INSERT INTO myTable VALUES ( 2, NULL );

    INSERT INTO myTable VALUES (3, 456);

    ALTER TABLE mytable MODIFY (y NOT NULL NOVALIDATE );

    INSERT INTO myTable VALUES (4, 678);

    INSERT INTO myTable VALUES ( 5, NULL );

    SELECT * FROM MyTable;

    '2' line was inserted with null before the creation of the NOT NULL constraint, this line remains "as what" at the end of the trial.

    '5' line trying to insert a NULL value after creating the NOT NULL constraint, which is denied.

    Best regards

    Bruno.

  • Insert XML data from the Table-&gt; back to null

    Dear Experts,

    -I have table xml as below:

    Example of CREATE TABLE (XML_spec XMLTYPE);

    Insert in the example
    Select ' < name of Message = "dataStaticInvestor" type = "IncomingMessage" >
    < name of field = "batchReference" > OPENINGBATCH000000 < / field > < List name = "data" >
    < = record name "data" >
    < name of field = "externalReference" > 01234567890aaaaaaa < / field >
    < name of field = "participantID" > OD001 < / field >
    < name of field = "participantName" > EQUITY SECURITIES INDONESIA, PT < / field >
    < / recording >
    < = record name "data" >
    < name of field = "externalReference" > 01234567890aaaaaaa < / field >
    < name of field = "participantID" > OD001 < / field >
    < name of field = "participantName" > EQUITY SECURITIES INDONESIA, PT < / field >
    < / recording >
    < = record name "data" >
    < name of field = "externalReference" > 01234567890aaaaaaa < / field >
    < name of field = "participantID" > OD001 < / field >
    < name of field = "participantName" > EQUITY SECURITIES INDONESIA, PT < / field >
    < / recording >
    < / list >
    < / message > ' double.

    Select * example;

    create table hasil1 (c1 varchar2 (500), c2 varchar2 (500), c3 varchar2 (500));

    -This step I create the procedure to insert xml data into the table as the batch.

    DECLARE
    x XmlType;
    BEGIN
    Select XML_SPEC in x for example;

    insert into hasil1
    SELECT
    p.Extract('/Record/Field/@externalReference').getstringval (C1),
    p.Extract('/Record/Field/@participantID').getstringval (C2),
    p.Extract('/Record/Field/@participantName').getstringval () as c3
    TABLE (XMLSequence (Extract(x,'Message/List/Record'))) p;
    commit;
    END;
    /

    -when the result of select hasil1, the output is back 3 rows and 3 columns, but all data is a null *.

    Best regards
    Sigcle

    You don't explain what output you need, but I guess something like this:

    SQL> insert into hasil1 (c1, c2, c3)
      2  select x.c1, x.c2, x.c3
      3  from example t
      4     , xmltable(
      5         'Message/List/Record'
      6         passing t.xml_spec
      7         columns c1 varchar2(500) path 'Field[@name="externalReference"]'
      8               , c2 varchar2(500) path 'Field[@name="participantID"]'
      9               , c3 varchar2(500) path 'Field[@name="participantName"]'
     10       ) x
     11  ;
    
    3 rows inserted
    
    SQL> select * from hasil1;
    
    C1                     C2        C3
    ---------------------- --------- --------------------------------
    01234567890aaaaaaa     OD001     EQUITY SECURITIES INDONESIA,PT
    01234567890aaaaaaa     OD001     EQUITY SECURITIES INDONESIA,PT
    01234567890aaaaaaa     OD001     EQUITY SECURITIES INDONESIA,PT
     
    
  • Copying recordings to another column in the table that has NULL values

    Hello

    I am trying to copy the email address from one table to another table that has the NULL value in the column email
    SQL> select
      2     count(*)
      3  from
      4     users a, cvProperties b, cvDetails c
      5  where
      6     a.user_id=b.user_id and b.cv_id=c.cv_id and a.userType like '1'
      7  and
      8     c.email is NULL
      9  /
    
      COUNT(*)
    ----------
             7
    
    SQL> insert into cvDetails(email)
      2  VALUES(
      3  (select
      4     a.login
      5  from
      6     users a, cvProperties b, cvDetails c
      7  where
      8          a.user_id=b.user_id and b.cv_id=c.cv_id and a.userType like '1'
      9  and
     10          c.email is NULL)
     11  );
    (select
     *
    ERROR at line 3:
    ORA-01427: single-row subquery returns more than one row
    Please notify

    Thank you in anticipation

    Check to see if that helps...

    MERGE INTO cvdetails c
         USING (SELECT a.login, b.cv_id
                  FROM users a, cvproperties b
                 WHERE a.user_id = b.user_id AND a.usertype = 1) xx
            ON (xx.cv_id = c.cv_id)
    WHEN MATCHED
    THEN
       UPDATE SET email = xx.login
               WHERE c.email IS NULL;
    

    Vanessa B.

  • Joint of two tables to get null output values

    Hello
    I have two tables with structure and values as shown below.

    CREATE TABLE 'OMPODI '. "" DETAIL_RECORD_BUR ".
    (
    'PRCS_DATE' CHAR (8 BYTES),
    'PLANT' FLOAT (4 BYTES),
    "IPC" TANK (6 BYTES),
    'PRODWEEK' CHAR (8 BYTES),
    'QUANTITY' CHAR (9 BYTES)
    )

    values

    "PRCS_DATE" 'FACTORY' "IPC" 'PRODWEEK', 'AMOUNT '.
    "20120322" "MES2" "75921" "20120305" "000000000"
    "20120322" "MES2" "75921" "20120306" "000000000"
    "20120322" "MES2" "75921" "20120307" "000000000"
    "20120322" "MES2" "79110" "20120324" "000000000"
    "20120322" "MES2" "79110" "20120326" "000000000"
    "20120322" "MES2" "79110" "20120327" "000000000"
    "20120322" "MES2" "79111" "20120313" "000000000"
    "20120322" "MES2" "79111" "20120314" "000000000"
    "20120322" "MES2" "79111" "20120315" "000000000"
    "20120322" "MES2" "79111" "20120316" "000000000"
    "20120322" "MES2" "79111" "20120317" "000000000"
    "20120322" "MES2" "01667" "20120321" "000000000"
    "20120322" "MES2" "01667" "20120322" "000000000"
    "20120322" "MES2" "01667" "20120323" "000000000"
    "20120322" "MES2" "01667" "20120324" "000000000"

    And another table
    CREATE TABLE 'OMPODI '. "" DETAIL_RECORD_BUR1 ".
    (
    'PRCS_DATE' CHAR (8 BYTES),
    'PLANT' FLOAT (4 BYTES),
    "IPC" TANK (6 BYTES)
    )
    With values such as
    "PRCS_DATE" 'FACTORY' "IPC".
    "20120322" "MES2" "75921.
    "20120322" "MES2" "79110.
    "20120322" "MES2" "01667.

    It has distinct values of the "PRCS_DATE", "PLANT" and "IPC" in the first table.

    What I want is to get out as

    "PRCS_DATE" 'FACTORY' "IPC" 'PRODWEEK', 'AMOUNT '.
    "20120322" "MES2" "75921" "20120305" "000000000"
    NULL NULL NULL "20120306'"000000000"
    NULL NULL NULL "20120307'"000000000"
    "20120322" "MES2" "79110" "20120324" "000000000"
    NULL NULL NULL "20120326'"000000000"
    NULL NULL NULL "20120327'"000000000"
    NULL NULL NULL "20120313'"000000000"
    NULL NULL NULL "20120314'"000000000"
    NULL NULL NULL "20120315'"000000000"
    NULL NULL NULL "20120316'"000000000"
    NULL NULL NULL "20120317'"000000000"
    "20120322" "MES2" "01667" "20120321" "000000000"
    NULL NULL NULL "20120322'"000000000"
    NULL NULL NULL "20120323'"000000000"
    NULL NULL NULL "20120324'"000000000"

    Concept here is to not have that one value for PRCS_DATE, PLANT and CPI and next lines must be NULL instead of them.

    How could I achieve this?

    You can also use only one table or tables.
    Need SQl for this preference. Thisisto be used to create the text file in ODI.

    Published by: MaheshGx on March 27, 2012 10:58

    Like this

    select decode(rno, 1, prcs_date) prcs_date,
           decode(rno, 1, plant) plant,
           decode(rno, 1, ipc) ipc,
           prodweek,
           quantity
      from (
              select t.*, row_number() over(partition by prcs_date, plant, ipc order by prodweek) rno
                from detail_record_bur t
           )
    
  • Max (ID) of empty table evaluates to null

    Hello

    I'm an absolute beginner in oracle and sql. My supervisor gave me this script

    insert into country_property (id, country_id, name, value)
    values ((select max (id) + 1 country_property), (select country whose name country_code = "TURKEY"), 'some_property', 't');

    My problem is that the array is empty initially, such as max (id) is nothing that is prohibited by the constraint. Can fix this easily?

    TIA, Bastl.

    Edited by: 840314 the 28.02.2011 05:20 - forced NN

    Hello

    Well, you could do that...

    INSERT INTO country_property (id,
                                  country_id,
                                  name,
                                  VALUE)
      VALUES   ( (  SELECT  NVL(MAX (id),0) + 1 FROM country_property),
                (SELECT   country_code
                   FROM   country
                  WHERE   name = 'TURKEY'),
                'some_property',
                't');
    

    But you'd better create a sequence and use it to complete your primary key unless you can not tolerate the shortcomings.

    In addition, you shouldn't really be using ID or NAME as column names...

    See you soon

    Ben

  • Query for a list of null columns in the table

    Hello experts!

    It may be a silly question but I'm stuck in a this simple query:

    Question: I have a table with 10 columns and 10000 records, I want a query which can only show me the names of columns that contains null values. I just want to know the number of columns is there in my table that contains null values.

    Thank you!

    Hello
    You can query user_tab_columns:

    select column_name from user_tab_columns where table_name= and num_nulls>0
    

    HTH

  • ALTER Table Add column not null, no default

    I want to add two columns in a table with not null, and the default value 0 for two columns
    Can I write everything in a single statement or do I have to divide the declaration
    I tried, but didn't work

    ALTER table DWSODS01. DWT00301_ORD_DTL_OMS add)
    COMB_ORD_FLG NUMBER (5.0) default null, 0
    COMB_ORD_NO NUMBER (12.0)
    by default, 0 not null);

    How can I change the code?

    user10390682 wrote:
    OK, so if it is NOT NULL, while there should be a value.

    Yes.

    So, when I set these two columns as NOT NULL will only future data must be NON NULL.
    What of the old and present data if I defined as NOT NULL

    NOT NULL mean value of eachcolumn + line (current or future) _ must not be null. That's why always adding NOT NULL column to a non-empty table fails - the column value for existing lines will be NULL which does NOT violate the constraint nullability. If you add the NON NULL column with a default value, the column will be added and all lines existing column value will be defined by specified default (0 in your case). As a result Oracle will be able to settle forced to null for this newly added column from the value of this column in all the existing lines will be not not null (0 in your case).

    SY.

  • How to reset the table selection

    Hello

    JDev 11.1.2.4

    I displays a table with the unique selection of lines. The first line is selected by default. I would like to reset this selection, so no row is selected. I wrote that code but it does not work:

    RKS RowKeySet = table.getSelectedRowKeys ();

    _logger.info ("RKS" + rks.getSize ());

    rks.removeAll ();

    _logger.info ("RKS" + rks.getSize ());

    RKS. Clear();

    _logger.info ("RKS" + rks.getSize ());

    table.setSelectedRowKeys (rks);

    Whenever rks.getSize () returns the value 1. It seems the removeAll or clear do not work.

    I also try to the current line of the null value, but it does not work either.

    Thank you

    The first line is selected by default. I would like to reset this selection, so no row is selected.

    Well, components interface user are related to the default line set so they will always be 'select' some row.

    You can try to remove selectedRowKeys property of your table (so this should remove selection effect), but the iterator will probably continue to point to the first line in all lines.

    Dario

  • table cell color dynamically and programmatically based on a condition of entry

    Hello
    We use Jdev 11.1.1.6.0 for my ADF development.
    In our page Jspx, we have three components:
    1. a reading table used with an additional column "Error box" in the form of input text
    2. a text entry accepts employeeID running,
    3. a command button on the occasion of the red cell in the column of the error box against the received EmployeeID

    Required functionality:
    1. the user will be entered EmployeeID (which has the error of data) in the input text and press the command button
    2.internally, by programming, there is a bean method call from IE button which will accept the entry and check the rowKey in the table corresponding to the EmployeeID using the Iterrator function and retrieve the exact id of this cell in the column ErrorBox.
    3. after obtaining the id, highlight the cell in the column of the error in red box.

    I used the following excerpt from the bean to have the feature but does not work and also there is no error indicating that:

    * if (row.getAttribute ("EmployeeId")! = null) {*}
    * if (row.getAttribute("EmployeeId").toString () .equalsIgnoreCase ((String) component.getValue ())) {*}
    RowSetIterator empRSIter = iter.getRowSetIterator ();
    Line currentRow = empRSIter.getRowAtRangeIndex (i);
    String tableId = table.getClientId (facesContext);
    RKS RowKeySet = table.getSelectedRowKeys ();
    inputId tableId = + ': ' + i + ': ' + 'ot10;
    org.apache.myfaces.trinidad.render.ExtendedRenderKitService service;
    Service = org.apache.myfaces.trinidad.util.Service.getRenderKitService (facesContext, ExtendedRenderKitService.class);
    service.addScript (facesContext, "field var = AdfPage.PAGE.findComponentByAbsoluteId (" "+ inputId +"'");") field.style.backgroundColor = "red"; ») ;

    We strive to highlight the error in the table in the column of the error against the EmployeeId box has received. But we cannot get the functionality. Please suggest.
    Thank you
    Charrier

    Hello

    1. you must maintain the value of the string in a bit more broad (try pageFlowScope, for example) IE - value = "#{pageFlowScope.myBean.empId} '"
    2. Add a partialTriggers for the score table the ID of the text input.
    3.

    #{row.EmployeeId == backingBeanScope.myBean.empId ?'backgroundcolor:red;':'backgroundcolor:black;'}">
    {code}
    should be
    {code}
    #{row.EmployeeId == pageFlowScope.myBean.empId ?'background-color:Red;':''}"> 
    

    Arun-

  • Table (ADF 11 g) does not get updated on the selection of lines...

    Hi all

    I have a table element (ADF 11 g) in my page with the selection of multiple lines. I have my own row selection listener. Whenever I have select several lines with the CTRL key, the table is getting updated. It is fetching the data again for each selection. I don't want the table to get updated whenever I select a line. In the im listener manually selected do the line current. The code below is the table row selection listener.

    public void tableRowSelectionListener (SelectionEvent selectionEvent)
    {
    Add the code in the event here...
    String tableRowSelectionListener = "tableRowSelectionListener";
    Table richeTableau = (RichTable) selectionEvent.getComponent ();
    Set of keys to RowKeySet = table.getSelectedRowKeys ();
    Txn_id = number ((Number) ((Key) ((List) keySet.toArray () [0]) .get (0)) .getAttribute (0));
    int noRowsSelected = ((List) keySet.toArray () [0]) .toArray () .length;
    Rank [txnrows] = null;
    if(noRowsSelected == 1)
    {
    PscTransactionsViewImpl txnVO = (PscTransactionsViewImpl) amImpl.getPscTransactionsView2 ();
    if(txnVO!=null)
    txnrows = txnVO.findByKey (new Key (new Object [] {txn_id}),-1);
    If (txnrows! = null & & txnrows.length > 0)
    {
    SelectedRow PscTransactionsViewRowImpl = (PscTransactionsViewRowImpl) txnrows [0];
    txnVO.setCurrentRow (selectedRow);
    }
    }
    }

    How to select a row in the table easily (without the table is refreshed). ?

    Thanks in advance,
    Swathi

    Hi swati,

    Set property of 'changeeventpolicy' on 'none' & 'useRowHints' to 'default' for the list that you iterate.

    YP.

  • How to get the values of the modified line of table of the ADF?

    JDev 11.

    I have a table that is filled with bean data.
    I need to save changes after the user makes changes in any table cell. InputText is defined for the table column component.
    I've defined ValueChangeListener for inputText field and AutoSubmit = true. So when the user change the value field inputText, the method is called:

    public void SaveMaterial (ValueChangeEvent valueChangeEvent) {}
    getSelectedRow();
    SaveMaterial (material);
    }

    This method must call getSelectedRow that take values of the selected table row and save them in object:

    private line {} getSelectedRow()

    Table richeTableau = this.getMaterialTable ();
    Selection of the iterator = table.getSelectedRowKeys () .iterator ();
    While (selection.hasNext ())
    {
    Key of the object = next ();
    table.setRowKey (key);
    Object o = table.getRowData ();
    material = o (HARDWARE);
    }
    System.out.println ("selected hardware Desc =" + material.getEnumb ());
    Returns a null value.
    }

    Problem is that getSelectedRow method is not new (edited) values, old values are still used.

    I tried to use ActiveButton with the same method and it works very well in this case. New values are inserted and active line in the object selected.

    JSF:

    < af:table var = 'row' rowSelection = "single" columnSelection = "unique."
    value = "#{ManageWO.Material}" binding = "#{ManageWO.materialTable}" > "

    < af:column sortable = "false" headerText = "E-number" >
    "< af:inputText value =" #{row.enumb} "valueChangeListener =" #{ManageWO.SaveMaterial} "autoSubmit ="true"/ >
    < / af:column >

    < af:column sortable = "false" headerText = "Description" >
    "< af:inputText value =" #{row.desc} "valueChangeListener =" #{ManageWO.SaveMaterial} "autoSubmit ="true"/ >
    < / af:column >
    ......
    < / af:table >

    < af:activeCommandToolbarButton text = "Save" action = "#{ManageWO.EditData}" / >


    What is a good place where Save method must be called to get the new values (edited) table of the ADF?

    Thank you.

    Have you looked into the valueChangeEvent?

    There oldValue and newValue attributes.

    public void SaveMaterial(ValueChangeEvent valueChangeEvent) {
    Object oldVal = valueChangeEvent.getOldValue();
    Object newVal = valueChangeEvent.getNewValue();
    // check if you see what you are looking for.....
    getSelectedRow();
    SaveMaterial(material);
    }
    

    Timo

  • Center a table in Word LabWindows

    Hi all!

    I create a table in Word using Microsoft Word 9.0 Object Library (word2000.fp) and I have a problem with a table in the document of centering. I have created table correctly but I can't focus on a table in the page of my document. I tired possible all means to Center a table but no result. I don't know what I'm doing wrong. Please help on the issue. Below, I add a piece of my code written in Labwindows/CVI:

    (DocHandle, NULL, Word_DocumentApplication, Word_GetProperty
    CAVT_OBJHANDLE, & appHandleL);
      
    Word_GetProperty (appHandleL, NULL, Word_ApplicationSelection,
    CAVT_OBJHANDLE, & currSelHandleL);
    addition of provision
    Word_SelectionTypeParagraph (currSelHandleL, NULL);
      
    Word_GetProperty (currSelHandleL, NULL, Word_SelectionRange,
    CAVT_OBJHANDLE, & rangeHandleL);
    creating a table
    Word_GetProperty (docHandle, NULL, Word_DocumentTables, CAVT_OBJHANDLE, & tablesHandleL);
       
    Word_TablesAdd (tablesHandleL, NULL, rangeHandleL, 5, 6, CA_VariantInt (1),)

    CA_VariantInt (0), & tableHandleL);
    Word_TableSelect (tableHandleL, NULL);
      
    a table of centering
    Word_GetProperty (currSelHandleL, NULL, Word_SelectionTables, CAVT_OBJHANDLE, & tablesHandleL);
    Word_SetProperty (tablesHandleL, Word_RowsWrapAroundText, CAVT_BOOL, NULL, FALSE);
    Word_SetProperty (tablesHandleL, NULL, Word_RowsAlignment, CAVT_LONG,

    WordConst_wdAlignRowCenter);

    What I am doing wrong? How must be properly it?

    I welcome Theodore

    Hi Tamas Simon,

    My version of the CVI and OS that I use it of: CVI 8.5 and Windows XP Professional SP3, but those who are well. I found the solution to my problem. The issue was lying in an incorrect use of objects (function called Word_SetProperty). I used the syntax:

    Word_SetProperty (tablesHandleL, WordConst_wdAlignRowCenter, CAVT_LONG, Word_RowsAlignment, NULL);

    and it should be like:

    Word_SetProperty (WordObjRows, NULL, Word_RowsAlignment, CAVT_LONG, WordConst_wdAlignRowCenter);

  • joining several tables to generate data

    with itemlist as

    (select 1 cid, listname 'test', 'r' flg Union double all the)

    Select 2 cid, listname 'test2', ' not flg double

    ),

    category 1)

    Select 1 cid, 122 k' sub '123' catcode, of any double Union

    Select 1 cid, '234i' catcode, sub '124' all Union double

    Select 1 cid, 238 k' void '124' catcode, double

    )

    void)

    Select 1 cid, sub '123' of any union double

    Select 1 cid, sub ' 124' double

    )

    I want to write a static query that gathers all the tables and produces the following output assuming that

    CID is you pass as a parameter

    CID listname flg topic catcode

    1 123 122 k r test

    1 test of r 234i 124

    1 124 238 k r test

    Suppose the data as changes to follow and even cid 1 is to pass as a parameter:

    with itemlist as

    (select 1 cid, listname 'test', 'r' flg Union double all the)

    Select 2 cid, listname 'test2', ' not flg double

    ),

    category 1)

    Select 1 cid, 122 k' sub '123' catcode, of any double Union

    Select 1 cid, '234i' catcode, sub '124' all Union double

    Select 1 cid, 238 k' void '124' catcode, double

    )

    void)

    Select 2 cid, sub '123' of any union double

    Select 2 cid, sub '124' double

    )

    then the output should be

    CID listname flg topic catcode

    1 r test 123

    1 test of r 124

    1 test of r 124

    for a final example, suppose the data now as to user 1 as cid

    with itemlist as

    (select 1 cid, listname 'test', 'r' flg Union double all the)

    Select 2 cid, listname 'test2', ' not flg double

    ),

    category 1)

    Select 2 cid, 122 k' sub '123' catcode, of any double Union

    Select 2 cid, catcode '234i', '124' void in any union double

    Select 2 cid, 238 k' void '124' catcode, double

    )

    void)

    Select 1 cid, sub '123' of any union double

    Select 2 cid, sub '124' double

    )

    output must be

    CID listname flg topic catcode

    1       test            r                 123

    Basically, the user will pass a cid, in this case 1. I'll read the itemlist where cid = 1 and I want to join all the other tables

    to itemlist in such a way that I can generate extra lines.  If no entry is found for cid 1, for example, in category 1 or auxiliary table

    then the beloging column of this table must be null in the result

    can someone help me write a query to produce the output above

    Hello

    elmasduro wrote:

    ...

    Here is an explanation of the output.  a user will have a front screen where it can enter itemlist info.
    then in a submenu may enter a category or sub or both or none of them. the user can select multiple categories or sub
    When the user presses the button Save, an entry will be made in the itemlist table, for example the cid = 1.
    If he choose a category but without Subs, then will be entered into the table at say cid = 1


    but no entries will be made for sub because he chose not to all values.  If he chooses void instead of category values
    then sub taable will fill and category is not. If he chooses the category and under, then both will be filled.

    what I want to do is to join the itemlist with table category and sub table and get the data to the Scriptures, this intervention of the user.
    These entries not found will be the null value column in the result.
    for example, the cid = 1 itemlist, if user enter category but not void, itemlist will be the join with the table category and sub
    but since sub has no entry for the cid = 1, the column object will be empty in the output, but catcode will fill

    I'm so confused.

    It is a query (that is, just a SELECT statement, which shows the data already present in the tables), or is this a DML statement, that will add data to the tables?  If it's just a query, then do not say things like "entries will be taken" or "filled with tables.

    Assuming you want a request maybe you want something like this:

    WITH c_and_s AS

    (

    SELECT NVL (c.cid, s.cid) AS cid

    NVL (c.sub, s.sub) AS topic

    , NVL2 (s.cid, c.catcode, NULL) AS catcode

    CATEGORY 1 c

    FULL OUTER JOIN void s ON c.cid = s.cid

    AND c.sub = s.sub

    )

    SELECT i.cid, i.listname, i.flg

    cs.subject, cs.catcode

    Itemlist I have

    LEFT OUTER JOIN c_and_s ON cs.cid = i.cid cs

    WHERE the i.cid (1) - you can do the cids 2 or several at the same time, if you want to

    ORDER BY i.cid, cs.subject, cs.catcode

    ;

    This example gets the output you asked data sample you posted.

  • Clarification on NULL or behavior LEFT JOIN behavior

    Good day ladies------Gentlemen\ gurus-Experts-and Al:

    Just when I thought I got my mind wrapped around the notion of NULL value, as defined by Oracle, I met what follows below.  Basically, what you are watching is how our employees of the human resources tables are set up (for the most part).  We have the employees, employee contracts table and the tables of positions.  When I want to make a list of active staff, I always use the filter end date, you will see below in the Super request, essentially looking for staff who do not have a contract AND a position end date entered in the DB.  It works like a charm.  However, today, I noticed an official on the list, who has never had a position is entered in the comic book, and he had an 'open' contract  In my example below, why would "Hal Jordan" appear on the active staff list?  Yes, he spends the first part of my predicate (contract_end is null), but it does not work (at least by my understanding) past the second part of the predicate which is position_end has the value NULL because there not even a record is entered in the comics!  Why would he appear?  Is it because of the LEFT JOIN or a NULL rule type, I'm not aware of?  Thanks for your help!

    Aqua

    EMPLOYEES AS

    (

    SELECT '10' AS emp_id, 'Banner' last_name, 'Robert' NAME FROM dual

    UNION ALL

    SELECT '20', 'Wayne', 'Bruce' OF THE double

    UNION ALL

    SELECT '30', 'Kent', 'Clark' FROM dual

    UNION ALL

    SELECT "40", "Parker", "Peter" OF THE double

    UNION ALL

    SELECT '50', 'Last', 'Tony' FROM dual

    UNION ALL

    SELECT '60', 'Jordan', 'Hal' OF THE double

    ),

    emp_contracts AS

    (

    SELECT '10' AS emp_id, to_date (January 1, 2011 ',' MON-DD-YYYY "") LIKE contract_start, to_date (1 January 2012 ',' MON-DD-YYYY') AS contract_end FROM dual

    UNION ALL

    To_date '10', SELECT (January 1, 2010 ',' MON-DD-YYYY ""), to_date (December 31, 2011 ',' MON-DD-YYYY') OF double

    UNION ALL

    To_date '10', SELECT (January 2, 2012 ',' MON-DD-YYYY ""), double NULL

    UNION ALL

    To_date '20', SELECT (January 1, 2011 ',' MON-DD-YYYY ""), to_date (1 January 2012 ',' MON-DD-YYYY') OF double

    UNION ALL

    To_date '20', SELECT (January 1, 2010 ',' MON-DD-YYYY ""), to_date (December 31, 2011 ',' MON-DD-YYYY') OF double

    UNION ALL

    To_date '20', SELECT (January 2, 2012 ',' MON-DD-YYYY ""), double NULL

    UNION ALL

    To_date '30', SELECT (January 1, 2011 ',' MON-DD-YYYY ""), to_date (1 January 2012 ',' MON-DD-YYYY') OF double

    UNION ALL

    To_date '30', SELECT (January 1, 2010 ',' MON-DD-YYYY ""), to_date (December 31, 2011 ',' MON-DD-YYYY') OF double

    UNION ALL

    To_date '30', SELECT (January 2, 2012 ',' MON-DD-YYYY ""), double NULL

    UNION ALL

    To_date '40', SELECT (January 1, 2011 ',' MON-DD-YYYY'), to_date (1 January 2012 ',' MON-DD-YYYY') FROM dual

    UNION ALL

    To_date '40', SELECT (January 1, 2010 ',' MON-DD-YYYY'), to_date (December 31, 2011 ',' MON-DD-YYYY') FROM dual

    UNION ALL

    To_date '40', SELECT (January 2, 2012 ',' MON-DD-YYYY ""), double NULL

    UNION ALL

    To_date '50', SELECT (January 1, 2011 ',' MON-DD-YYYY ""), to_date (1 January 2012 ',' MON-DD-YYYY') OF double

    UNION ALL

    To_date '50', SELECT (January 1, 2010 ',' MON-DD-YYYY ""), to_date (December 31, 2011 ',' MON-DD-YYYY') OF double

    UNION ALL

    To_date '50', SELECT (January 2, 2012 ',' MON-DD-YYYY ""), double NULL

    UNION ALL

    To_date '60', SELECT (January 1, 2011 ',' MON-DD-YYYY ""), to_date (1 January 2012 ',' MON-DD-YYYY') OF double

    UNION ALL

    To_date '60', SELECT (January 1, 2010 ',' MON-DD-YYYY ""), to_date (December 31, 2011 ',' MON-DD-YYYY') OF double

    UNION ALL

    To_date '60', SELECT (January 2, 2012 ',' MON-DD-YYYY ""), double NULL

    ),

    emp_positions AS

    (

    SELECT '10' AS emp_id, '43XY' AS title_id, to_date (January 1, 2011 ',' MON-DD-YYYY "") LIKE position_start, to_date (1 January 2012 ',' MON-DD-YYYY') AS position_end FROM dual

    UNION ALL

    SELECT ' 10', '47NT', to_date (January 1, 2010 ',' MON-DD-YYYY ""), to_date (December 31, 2011 ',' MON-DD-YYYY') OF double

    UNION ALL

    SELECT ' 10', '41JE', to_date (January 2, 2012 ',' MON-DD-YYYY ""), double NULL

    UNION ALL

    SELECT ' 20', '48AW', to_date (January 1, 2011 ',' MON-DD-YYYY ""), to_date (1 January 2012 ',' MON-DD-YYYY') OF double

    UNION ALL

    SELECT ' 20', '42KD', to_date (January 1, 2010 ',' MON-DD-YYYY ""), to_date (December 31, 2011 ',' MON-DD-YYYY') OF double

    UNION ALL

    SELECT ' 20', '46LD', to_date (January 2, 2012 ',' MON-DD-YYYY ""), double NULL

    UNION ALL

    SELECT ' 30 ', 45 MI', to_date (January 1, 2011 ',' MON-DD-YYYY'), to_date (1 January 2012 ',' MON-DD-YYYY') FROM dual

    UNION ALL

    SELECT ' 30', '44KH', to_date (January 1, 2010 ',' MON-DD-YYYY ""), to_date (December 31, 2011 ',' MON-DD-YYYY') OF double

    UNION ALL

    SELECT ' 30', '43LL', to_date (January 2, 2012 ',' MON-DD-YYYY ""), double NULL

    UNION ALL

    SELECT ' 40', '41', to_date (January 1, 2011 ',' MON-DD-YYYY ""), to_date (1 January 2012 ',' MON-DD-YYYY') OF double

    UNION ALL

    SELECT ' 40', '40', to_date (January 1, 2010 ',' MON-DD-YYYY ""), to_date (December 31, 2011 ',' MON-DD-YYYY') OF double

    UNION ALL

    SELECT ' 40', '42DX', to_date (January 2, 2012 ',' MON-DD-YYYY ""), double NULL

    UNION ALL

    SELECT ' 50', '48IB', to_date (January 1, 2011 ',' MON-DD-YYYY ""), to_date (1 January 2012 ',' MON-DD-YYYY') OF double

    UNION ALL

    SELECT '50 ', 47 DL', to_date (January 1, 2010 ',' MON-DD-YYYY'), to_date (December 31, 2011 ',' MON-DD-YYYY') FROM dual

    UNION ALL

    SELECT ' 50', '42A', to_date (January 2, 2012 ',' MON-DD-YYYY ""), double NULL

    )

    SELECT

    1. ES.emp_id,
    2. ES.last_name,
    3. ES.first_name,
    4. EP.title_id,
    5. EP.position_start,
    6. EP.position_end

    Employees are

    LEFT JOIN emp_contracts ec

    ON ec.emp_id = es.first_name

    LEFT JOIN emp_positions ep

    ON ep.emp_id = es.emp_id

    WHERE ec.contract_end IS NULL AND ep.position_end IS NULL

    Hello

    AquaNX4 wrote:

    Good day ladies------Gentlemen\ gurus-Experts-and Al:

    Just when I thought I got my mind wrapped around the notion of NULL value, as defined by Oracle, I met what follows below.  Basically, what you are watching is how our employees of the human resources tables are set up (for the most part).  We have the employees, employee contracts table and the tables of positions.  When I want to make a list of active staff, I always use the filter end date, you will see below in the Super request, essentially looking for staff who do not have a contract AND a position end date entered in the DB.  It works like a charm.  However, today, I noticed an official on the list, who has never had a position is entered in the comic book, and he had an 'open' contract  In my example below, why would "Hal Jordan" appear on the active staff list?  Yes, he spends the first part of my predicate (contract_end is null), but it does not work (at least by my understanding) past the second part of the predicate which is position_end has the value NULL because there not even a record is entered in the comics!  Why would he appear?  Is it because of the LEFT JOIN or a NULL rule type, I'm not aware of?  ...

    It's the outer join.

    When you say

    Employees are

    LEFT JOIN emp_positions ON ep.emp_id = es.emp_id ep

    then, at the time when the WHERE clause is evaluated, the result set contains at least 1 row for each line of employees.  If there is no line in emp_postitions that meet the join condition, then all the columns that should be provided by the emp_positions table will be NULL. This is precisely what concerns the outer join.

    Think about it for a minute.  NULL means the absence of any value.  Is there is no corresponding row in the emp_positions table, then there is no value for emp_position.position_end.  If so doesn't; "have a value, then, by definition, it is NULL.

    It if were not NULL, then this would mean that it had a value.  Would what value?  Why the request would give him one value rather than another?

    Thanks for the display of the data of the sample; It's always useful!

Maybe you are looking for

  • iMac slow start was fast

    My iMac, with 1 disk of merger to, was very quick to open the OS since multinational April 2015, then suddenly became very very slow to open recently.  For example the Apple logo appears in a few seconds and the load in a few seconds more.  Now the A

  • Satellite M115-S1061 is overwritten with an error - NTLDR missing

    My laptop crashed with an error of press lack NTLDR CTRL + ALT + DELETE Tried to recover with the recovery toshiba and dvd applications. 6 minutes after the resumption to get a 10e7160017 error message. then stops can not get anywhere. Have I had a c

  • Series HP - Print - 8 d - Deskjet 3520 requires a WPA2 password

    Hello.  I have a new MacBook Air, and although I scanned fine with my Deskjet 3520e with my old... now to implement it asks a password WPA2... I don't know. I do not know my password for adding applications on the Mac, but it's different. In addition

  • XPS 17 (L702X) - JMicron card reader install driver fails on windows 8

    Hello I downloaded all the driver for windows 8 by using the serial number of my laptop. When I installed the driver from JMicron card reader, I always get an error: "failed to install! Tell me please to know how to fix it. Thank you the error image

  • Lost all my contacts in email

    Lost all my contacts yesterday of a forced update Windows Live Mail? What can I do? Have a gmail account