Nulls in a row clubing

Hi friends,

I have a query, below, which returns details of the following courses completed by him and the year of completion for each course.
SELECT distinct PERSON_ID,DECODE (NAME, 'School Certificate',START_DATE) S_START_DATE,
DECODE (NAME, 'School Certificate',END_DATE) S_END_DATE,
DECODE (NAME, 'School Certificate', TITLE) SCHOOL_CERTIFICATE,
DECODE (NAME, 'Bachelors Degree', TITLE) BACHELORS,
DECODE (NAME, 'Bachelors Degree',START_DATE) B_START_DATE,
DECODE (NAME, 'Bachelors Degree',END_DATE) B_END_DATE,
DECODE (NAME, 'Masters Degree', TITLE) MASTER,
DECODE (NAME, 'Masters Degree',START_DATE) M_START_DATE,
DECODE (NAME, 'Masters Degree',END_DATE) M_END_DATE,
FROM PER_QUALIFICATIONS_V
WHERE NAME IN
('School Certificate','Bachelors Degree', 'Masters Degree')
AND PERSON_ID = :PER_ID
If im running the above query means, im getting the results as lower


PERSON_ID---S_START_DATE---S_END_DATE---SCHOOL_CERTIFICATE---BACHELORS---B_START_DATE---B_END_DATE---MASTER---M_START_DATE---M_END_DATE
79 - Null Null - Science Business - 31413-32509 null - Null - Null Null.
79---null---null---null---null---null---null---science man - 34335-35065
79---NULL---NULL---NULL---NULL---NULL---NULL---Research---34335---35065 deg


But im get three lines for the same number of employees, in spite, he holds a Bachelor's degree and two master's degree.

I need to get a result comparable to the below,

PERSON_ID---S_START_DATE---S_END_DATE---SCHOOL_CERTIFICATE---BACHELORS---B_START_DATE---B_END_DATE---MASTER---M_START_DATE---M_END_DATE
79 null - Null Null - Science Business - 31413-32509 - Humanities - 34335 - 35065-
79------------------------------Null-------------------Null---------------------------Null-------------------Null---------------------------Null-----------------Null-----------Research Deg-------------------------34335-----------------------35065

In this sense, means what I tried to say, if I have a Bachelor's degree and a master's degree means, I need to get only one line by clubbing the two rows that are returned in my query.

Assume that if the employee has a Bachelor's degree and master two ways, then it should not return as three rows as I mentioned earlier, it must return two lines like the one I mentioned second.

How it is possible to reach those clubbing of records.

Hope you understand my scenario, well. Sorry could not provide DDL and DML as these tables are my seeded tables which returns lines more.

Thanks in advance.

Kind regards
Vel

Hi, Vel,

You can change the Nicosa solution like this:

WITH     got_r_num  AS
(
     SELECT     person_id, name, start_date, end_date, title
     ,     ROW_NUMBER () OVER ( PARTITION BY  person_id, name
                               ORDER BY          start_date, end_date
                       )          AS r_num
     FROM    emp_qualification
)               -- Everything up to this point is new
SELECT
     PERSON_ID,
     max(DECODE (NAME, 'School Certificate',START_DATE)) S_START_DATE,
     max(DECODE (NAME, 'School Certificate',END_DATE)) S_END_DATE,
     max(DECODE (NAME, 'School Certificate', TITLE)) SCHOOL_CERTIFICATE,
     max(DECODE (NAME, 'Bachelors Degree', TITLE)) BACHELORS,
     max(DECODE (NAME, 'Bachelors Degree',START_DATE)) B_START_DATE,
     max(DECODE (NAME, 'Bachelors Degree',END_DATE)) B_END_DATE,
     max(DECODE (NAME, 'Masters Degree', TITLE)) MASTER,
     max(DECODE (NAME, 'Masters Degree',START_DATE)) M_START_DATE,
     max(DECODE (NAME, 'Masters Degree',END_DATE)) M_END_DATE
FROM      got_r_num         -- changed
WHERE
     NAME IN ('School Certificate','Bachelors Degree', 'Masters Degree')
group by person_id
,           r_num          -- This line and everything after is new
ORDER BY person_id     -- if wanted
,           r_num
;

Tags: Database

Similar Questions

  • ADF: row.getAttribute (): Null pointer exception

    Hello

    When I click on a row in table on the page of the ADF - > I should see the contents of the selected line, to make me do row.getAttribute ("abc") for that particular line,.

    If I say row.get ("abc") attribute. = null, this statement to throw null pointer exception then, how can I check if this attribute is not null?

    Thanks in advance.

    To find if the value of the attribute 'abc' is null.

    {if(Row!=null)}

    {if (Row.getAttributeIndexOf ("ABC")! =-1)}

    int index = row.getAttributeIndexOf ("abc");

    Object [] values is row.getAttributeValues ();.

    {if(values[index]!=null)}

    }

    }

    }

  • correct handling of foreign keys in unique constraints for operations ON DELETE SET NULL

    During my troubleshooting at a client site, I came across an interesting setup where I would like to ask your opinion.


    Consider two tables ADTB and TBLB.

    ADTB:

    INT COLA1

    COLA2 INT

    TBLB:

    COLB1 INT

    COLA2 is COLB1 as a foreign key ON DELETE SET NULL value.

    COLA1 and COLA2 are combined into a UNIQUE for the BATTERY constraint.

    I have two records of TBLB:

    (1)

    (2)

    and two DRUM recordings:

    (1, 1)

    (2, 2)

    so far, all the constraints are valid.

    During my research, I learned that I can not put COLA2 null in ADTB for two lines at the same time:

    TBLA UPDATE set COLA2 = NULL where COLA1 = 1;

    -> OK

    TBLA UPDATE set COLA2 = NULL where COLA1 = 2;

    -> VIOLATED UNIQUE CONSTRAINT

    Unfortunately, it's something my application needs, anyway. In order to get this resolved, but I try to understand, what would happen if I:

    REMOVE THE TBLB;

    ?

    It should set COLA2 in ADTB "Null" on the two lines, which is not allowed due to the UNIQUE CONSTRAINT.

    Can someone shed light on this issue? Thank you.


    Yours,

    Ronny

    Unfortunately, as you say, you can't not NULL values in such a unique constraint.  It would be the same as if you had a composite primary key and try to allow one of the columns will be null in several rows with the same value in the other column.  NULL is treated as an "unknown" value, it is possible that it could be the same value (it may or may not be, but Oracle does not know), so it must assume that it might be and that's why treat it as if there is the potential for a duplicate... so it's not unique.

    In short, do not allow null values in your unique constraints.

    The default is in the drawing, not in the way that Oracle is the treatment.  Fix the design if you do not have NULL values.

    In terms of relational database design, it seems that you are trying to transform the 1:M relations M:M relations, and which requires an intermediate table if you have M:1 and 1:M between 3 tables instead.

  • Make a selectOnechoice of null value.

    Hello

    I use Jdev 11.1.2.4

    I have two selectOneChoice soc1 and soc2 in the columns of the table. I want to make the soc2 null value based on a certain value of soc1. How to get the value of selectOneChoice to null?

    I tried to use the code below... but it does not work.

    < af:column sortProperty = "#{bindings." DownVO1.hints.ProductId.name}.

    sortable = "false".

    headerText = "#{bindings." DownVO1.hints.ProductId.label}"id ="c9">

    < af:selectOneChoice value = "If #{row.bindings.ReasonId}!" = 1

    #{row.bindings.ProductId.inputValue}

    on the other

    null; »

    label = "#{row." Bindings.ProductID.label}.

    required = "#{bindings." DownVO1.hints.ProductId.mandatory}.

    shortDesc = "#{bindings." DownVO1.hints.ProductId.tooltip}.

    ID = 'soc2' disabled = ' #{rank. " CatId == 1? {false: true} ">"

    < f: selectItems value = "#{row.bindings.ProductId.items}" id = "si2" / > "

    < / af:selectOneChoice >

    < / af:column >

    Thank you

    Hello

    try to follow this:

    1 let the value of soc2 because it is as

    2 - Open the viewobject--> java---> Java Classes--> generate view class (the class will be like ViewnameViewRowImpl).

    3 - Open class ViewnameViewRowImpl and in the accessor soc1 Set set soc2 with null:

      public void setReasonId(String value)
      {
        setAttributeInternal(REASONID, value);
         if(value != null && value.equals("1")
         {
              setProductId(null);
         }
      }
    

    3. in the .jspx soc1 set set autoSubmit = 'true '.

    
    

    4. in the .jspx soc2 set partialTriggers = 'soc1.

    
    
  • Updated column by max - not where it is null

    Hi all

    I have the following table and the date with I want to update the column containing NULL values
    different date, these data are the maxmium number in the same column.
    create table test (id number(9), name number(9));
    
    insert into test values(1,2);
    insert into test values(2,2);
    insert into test values(3,2);
    insert into test values(4,2);
    insert into test values(5,2);
    insert into test values(6,null);
    insert into test values(7,null);
    insert into test values(7,null);
    I used this but this update columns with same value. So, it's not what I want
    update test set name=(select max(name)+1) from test) where name is null;
    I want the result like this
    id     name
    1       2
    2       2
    3       2
    4       2
    5       2
    6       3
    7       4
    7       5
    Note: the Id column may double
    Thanks in advance

    Published by: Isabelle November 23, 2012 23:51
    SQL> select  *
      2    from  test
      3  /
    
            ID       NAME
    ---------- ----------
             1          2
             2          2
             3          2
             4          2
             5          2
             6
             7
             7
    
    8 rows selected.
    
    SQL> update  test t1
      2     set  name = (
      3                  select  name
      4                    from  (
      5                           select  rowid rid,
      6                                   max(name) over() + row_number() over(order by name nulls first,id,rowid) name
      7                             from  test
      8                          ) t2
      9                    where t2.rid = t1.rowid
     10                 )
     11    where name is null
     12  /
    
    3 rows updated.
    
    SQL> select  *
      2    from  test
      3  /
    
            ID       NAME
    ---------- ----------
             1          2
             2          2
             3          2
             4          2
             5          2
             6          3
             7          4
             7          5
    
    8 rows selected.
    
    SQL> 
    

    SY.

  • Browse the rows of the table

    Hi Experts,

    11.1.2 JDEV


    How can we browse richeTableau lines one by one...?

    If we have a 5 rows in a table, I need an iteration thorugh all the 5 ranks in order to check the attribute values... How can I implement this?


    Please give me a reference code...

    PMS

    Published by: pms on April 4, 2012 14:40

    Hello

    You can try this?

                 DCIteratorBinding xxIterator = ADFUtils.findIterator("XXUVO1Iterator");
                if (xxIterator.getViewObject().hasNext()) {
                    Row row = xxIterator.getViewObject().next();
                    if (row != null) {
                        String xx = row.getAttribute("value").toString();
                  }
                }
    

    ~ Abhijit

  • External table WHITE vs. NULL

    Hello

    I need help. I have create a portal with a load when the condition and most of the data appears in the external table except those with COL1 that blanks/null.
    First row is not in the external table that make sense.
    However, why second line isn't in the external table? How to put at the disposal of external table? I used load when col1 = BLANKS but no record.

    CSV file
    ABC, 1, 2, 3
    2,3,4
    VDB, 1, 2, 3
    Qwe, 1, 2, 3


    CREATE TABLE TEST
    (COL1 VARCHAR2 (50))
    COL2 VARCHAR2 (50).
    COL3 VARCHAR2 (50).
    COL4 VARCHAR2 (50))
    EXTERNAL ORGANIZATION
    (
    TYPE ORACLE_LOADER DEFAULT DIRECTORY 'INPUTS_DIR' (SETTINGS ACCESS
    RECORDS DELIMITED BY '\r\n' LOADING WHEN
    (
    Col1! = 'abc '.
    )
    NOBADFILE NODISCARDFILE COMPLETED FIELDS NOLOGFILE BY ',' OPTIONALLY
    BOX BY "" "
    AND ' "').
    LOCATION ("test1.csv")
    )
    REJECT LIMIT UNLIMITED;

    Thank you
    AL

    I have miissed OPTIONALLY ENCLOSED BY ' "', so that my solution will not load records as:"

    "", 5,6,7.

    Corrected table definition would be:

    {code}
    CREATE TABLE TEST
    (COL1 VARCHAR2 (50))
    COL2 VARCHAR2 (50).
    COL3 VARCHAR2 (50).
    COL4 VARCHAR2 (50))
    EXTERNAL ORGANIZATION
    (
    TYPE ORACLE_LOADER DEFAULT DIRECTORY ACCESS (SETTINGS TEMP
    RECORDS DELIMITED BY '\r\n' LOADING WHEN
    (
    Col1! = 'abc' OR (1 / 1) = ',' OR (1 / 3) = "" ","
    )
    NOBADFILE NODISCARDFILE COMPLETED FIELDS NOLOGFILE BY ',' OPTIONALLY
    BOX BY "" "
    AND ' "').
    LOCATION ("test1.csv")
    )
    REJECT LIMIT UNLIMITED;
    {code}

    SY.

  • UNIQUE KEY on 2 FIELDS and NULL

    Hello

    This is my table:

    create the table ARCH_FACT_PATH
    (
    Identification NUMBER not null,
    VARCHAR2 (1024) not null path.
    YEAR NUMBER not null,
    ACTIVE CHAR (1),
    NUMBER OF FREE_DISK_SPACE
    )

    Add unique constraint UK_ARCH_FACT_PATH (ASSETS, YEAR)

    When I insert this:
    YEAR: 2010 / ASSETS: 1 = > OK
    YEAR: 2010 / ASSETS: NULL = > OK
    YEAR: 2010 / ASSETS: NULL = > KO

    I wish I had only 1 year Active and many year NULL.

    Can you help me fix this please?

    Thank you

    Deleted

    Published by: 009 on March 31, 2010 23:57

    Or try trigger... *(No need to Create unique index) *.

    CREATE OR REPLACE TRIGGER TRG_ARCH_FACT_PATH
       BEFORE INSERT
       ON ARCH_FACT_PATH
       REFERENCING NEW AS NEW OLD AS OLD
       FOR EACH ROW
    DECLARE
       V_TEST               NUMBER    := 0;
       ERR_DT_ALREADY_EXT   EXCEPTION;
    BEGIN
       BEGIN
          SELECT DISTINCT 1
                     INTO V_TEST
                     FROM ARCH_FACT_PATH AFP
                    WHERE (NVL (:NEW.ACTIVE, 'NULL'), :NEW.YEAR) IN
                                          ((NVL (AFP.ACTIVE, 'NULL'), AFP.YEAR));
       EXCEPTION
          WHEN NO_DATA_FOUND
          THEN
             NULL;
       END;
    
       IF :NEW.ACTIVE IS NOT NULL AND V_TEST = 1
       THEN
          RAISE ERR_DT_ALREADY_EXT;
       END IF;
    EXCEPTION
       WHEN ERR_DT_ALREADY_EXT
       THEN
          RAISE_APPLICATION_ERROR (-20000, 'DATA SET ALREADY EXISTS IN TABLE');
    END;
    
    INSERT INTO ARCH_FACT_PATH(ACTIVE, YEAR)
    VALUES ('1',2010 )
    1 row inserted
    
    COMMIT
    Commit complete
    
    INSERT INTO ARCH_FACT_PATH(ACTIVE, YEAR)
    VALUES ('1',2010 )
    ORA-20000: DATA SET ALREADY EXISTS IN TABLE
    ORA-06512: at "TRG_ARCH_FACT_PATH", line 24
    ORA-04088: error during execution of trigger 'TRG_ARCH_FACT_PATH'
    COMMIT
    Commit complete
    
    INSERT INTO ARCH_FACT_PATH(ACTIVE, YEAR)
    VALUES (NULL,2010 )
    1 row inserted
    
    COMMIT
    Commit complete
    
    INSERT INTO ARCH_FACT_PATH(ACTIVE, YEAR)
    VALUES (NULL,2010 )
    1 row inserted
    
    COMMIT
    Commit complete
    
    SELECT *
    FROM   ARCH_FACT_PATH
    ID PATH
    -- -----------------------------------------------------------------------------
    
    3 rows selected
    
     
    

    * 009 *.

    Published by: 009 April 1, 2010 12:00 AM

  • How to search by null value for the numeric values in the filter of the fable in adf 11g?

    Method of substitution of applyViewCriteria?
    But what to put as the value for ViewCriteriaRow?

    Hello

    You can add following code to your actionListener or any method call when you want to perform this operation:

    ViewObject view = getViewObject();
    ViewCriteria criteria = view.createViewCriteria();
    
    ViewCriteriaRow row = criteria.createViewCriteriaRow();
    row.setAttribute(attrName, "IS NULL");
    
    criteria.addElement(row);
    view.applyViewCriteria(criteria);
    

    ~ Ahmed

  • Update statement using unique table with null values

    Hi all

    I want to update the table example table contain columns of c1.c2, c3 as below data

    tab1: -.
    ------------------------
    C1 c2 c3
    1 2 null
    3 null null
    4 5 null
    6 null null
    -----------------------------------------

    now, I want to update each value null to bellows value c3 c3
    for example, the data as below

    C1 c2 c3
    1 2 3
    4 5 6

    How can using the update statement update it please help me

    Thanks in advance
    Bala

    So you can never be sure of your order by...

    SQL> create table tab1 as
      2  (
      3  select 1 c1, 2 c2,  null c3 from dual union all
      4  select null, null, 3 from dual union all
      5  select 4 ,5, null from dual union all
      6  select null, null ,6 from dual
      7  );
    
    Table created.
    
    SQL>
    SQL> select *
      2    from tab1
      3  /
    
            C1         C2         C3
    ---------- ---------- ----------
             1          2
                                   3
             4          5
                                   6
    
    SQL>
    SQL> merge into tab1 t
      2  using (select rowid rid
      3              , c1
      4              , c2
      5              , c3
      6              , lead (c3) over (order by rowid) ld
      7           from tab1
      8        ) v
      9   on (t.rowid = v.rid)
     10   when matched
     11   then update set c3 = ld
     12   delete where c3 is null
     13  ;
    
    4 rows merged.
    
    SQL>
    SQL>
    SQL> select *
      2    from tab1
      3  ;
    
            C1         C2         C3
    ---------- ---------- ----------
             1          2          3
             4          5          6
    
    SQL> 
    

    @Peter: PTR, het is niet koud. Het zonnetje schijnt ;)
    for everyone: no, it's not cold. The Sun is shining.

  • How to create a large group of tables of all different lengths

    Hi all

    I want to create a 2D array that has two coloums and X number of rows (possibly in the hundreds). The first coloum must have a calculated average for this line. The second coloum should have a gap with the average assosiated. I struggle to get to this point. I know how to aqquire the set of values that should be considered for each mean and STD and I also know how to calculate the average and std.

    A loop will tell me what is the value of tag and which line in X put in. I want to be able to have the X number of tables each representing a row with values before calculating the avg and std. Each table would be of a different duration.

    I don't know how tag on the unique values of the loop to the appropriate line to create the Group of X tables.

    The only way I can think to do is the initialization of a 2D table large exessvly and replacing the first available null in the row with the value form the loop. Then only, I wouldn't consider zeros when I do the final 2D picture. What I don't love about it, is that it would be exesive and it is possible that there wouldn't be enough zeros for all the values that I wanted to consider in a specific line.

    I do not want to calculate averages and STDS for every line, every time I have add a value from the loop either. That would allow me to pass the table groups but would also slow the program. Can someone give me some advice on how to run this? Thank you in advance!

    MechaCool

    Use a cluster.  In your case, the cluster contains a data table and two digital inputs for the mean and std dev.  Look at the joint.  I created a control of Type Def the type of data I think you want.  In vi, you can see how to use the cluster to write your data.  For multiple series of data, you would have a picture of this cluster.  Each could have an array of different lengths and his averages dev partners and STDS.

  • connection with sqlite does not work

    I have 3 classes

    first class

    public class MyApp extends UiApplication {
        /**
         * Entry point for application
         *
         * @param args
         *            Command line arguments (not used)
         */
        public static void main(String[] args) {
            // Create a new instance of the application and make the currently
            // running thread the application's event dispatch thread.
            MyApp theApp = new MyApp();
            theApp.enterEventDispatcher();
        }
    
        /**
         * Creates a new MyApp object
         */
        public MyApp() {
            // Push a screen onto the UI stack for rendering.
            DBAdapter db=new DBAdapter();
            db.openOrCreateDatabase();
            pushScreen(new MyScreen());
        }
    }
    

    second class

    public final class MyScreen extends MainScreen implements FieldChangeListener
    {
        /**
         * Creates a new MyScreen object
         */
        private ButtonField addButton = new ButtonField("Add Records",
                ButtonField.CONSUME_CLICK | Field.FIELD_HCENTER);
        private ButtonField deleteButton = new ButtonField("Delete Records",
                ButtonField.CONSUME_CLICK | Field.FIELD_HCENTER);
        public MyScreen()
        {
            // Set the displayed title of the screen
            setTitle("MyTitle");
            HorizontalFieldManager hfm = new HorizontalFieldManager();
            addButton.setChangeListener(this);
            deleteButton.setChangeListener(this);
            hfm.add(addButton);
            hfm.add(deleteButton);
            add(hfm);
        }
        public void fieldChanged(Field field, int context) {
            // TODO Auto-generated method stub
            if (field == addButton) {
                DBAdapter db=new DBAdapter();
                db.insertTableData();
                String[] data=db.getCat();
            }
        }
    }
    

    third class

    public class DBAdapter {
    
        private static String DB_NAME = "test.db";
        public Database db;
        public void openOrCreateDatabase() {
            boolean sdCardPresent = false;
            String root = null;
            Enumeration e = FileSystemRegistry.listRoots();
            while (e.hasMoreElements()) {
                root = (String) e.nextElement();
                if (root.equalsIgnoreCase("sdcard/")) {
                    sdCardPresent = true;
                }
            }
            if (!sdCardPresent) {
                UiApplication.getUiApplication().invokeLater(new Runnable() {
                    public void run() {
                        Dialog.alert("This application requires an SD card to be present. Exiting application...");
                        System.exit(0);
                    }
                });
            } else {
                try {
    
                    String dbLocation = "/SDCard/databases/";
                    // Create URI
                    URI uri = URI.create(dbLocation + DB_NAME);
    
                    // Open or create a plain text database. This will create the
                    // directory and file defined by the URI (if they do not already
                    // exist).
                    db = DatabaseFactory.openOrCreate(uri);
                    createDatabaseSchema();
                } catch (Exception ae) {
                    Dialog.alert("Error,database not created...");
                }
            }
        }
    
        private void createDatabaseSchema() {
            Statement st = null;
            try {
                st = db.createStatement("CREATE TABLE IF NOT EXISTS 'People' ( 'Name' TEXT, 'Age' INTEGER )");
                st.prepare();
                st.execute();
            } catch (Exception e) {
                e.printStackTrace();
            } finally {
                try {
                    st.close();
                } catch (DatabaseException e) {
                }
            }
        }
    
        public void insertTableData() {
            Statement st = null;
            try {
                st = db.createStatement("INSERT INTO People(Name,Age) VALUES (?,?)");
                st.prepare();
                Hashtable ht = new Hashtable(5);
                ht.put("Joe", new Integer(6));
                ht.put("Mike", new Integer(7));
                ht.put("Marie", new Integer(12));
                ht.put("Dennis", new Integer(14));
                ht.put("Richard", new Integer(12));
                Enumeration names = ht.keys();
                Enumeration ages = ht.elements();
                while (names.hasMoreElements()) {
                    String strName = (String) names.nextElement();
                    Integer iAge = (Integer) ages.nextElement();
                    st.bind(1, strName);
                    st.bind(2, iAge.intValue());
                    st.execute();
                    st.reset();
                    Dialog.alert("ok");
                }
            } catch (Exception e) {
                Dialog.alert("Error");
            } finally {
                try {
                    st.close();
                } catch (DatabaseException e) {
                    Dialog.alert("Error");
                }
            }
        }
    
        public String[] getCat() {
            String[] data = {};
            if (db == null) {
                return data;
            }
            Statement st = null;
            try {
                st = db.createStatement("SELECT Id,Name FROM Cat");
                st.prepare();
                Cursor c = st.getCursor();
                if (c == null) {
                    return data;
                }
                Row r;
                int i = 0;
    
                while (c.next()) {
                    r = c.getRow();
                    data[i] = r.getString(1);
                    i++;
                    // recordList.insert(0, r.getString(0) + " - " +
                    // r.getInteger(1)+ " years old");
                }
                if (i == 0) {
                    return data;
                }
            } catch (Exception e) {
                e.printStackTrace();
            } finally {
                try {
                    st.close();
                } catch (Exception e) {
                }
            }
            return data;
        }
    }
    

    There is problem please help me

    How do you define the instance "db" on the screen?

  • Run query does not return a lines

    Hello

    I find that the Executequery code does not return everything.

    {

    pageContext.writeDiagnostics (this, "connection entry-front connection", 1);

    Connection Conn = pageContext.getApplicationModule (webBean) .getOADBTransaction () .getJdbcConnection ();

    pageContext.writeDiagnostics (this, "connection entered" & conn, 1);

    pageContext.writeDiagnostics (this, "input connection [AJ]" & conn, 4);

    Dim Query = "select CODE a.secondary_uom_code, (select b.unit_of_measure from MTL_UNITS_OF_MEASURE b where b.uom_code = a.secondary_uom_code) GLU, xxtmxc_primary_selling_suom (: 3, a.inventory_item_id) ' PSUOM from mtl_system_items_b where a.inventory_item_id =: 1 and a.organization_id =: 2 and a.secondary_uom_code is not null ';"

    'UNION select 'OUR' CODE, UOM 'Number', 10 double PSUOM;

    String query = "" select secondary_uom_code CODE of mtl_system_items_b where inventory_item_id =: 1 and organization_id =: 2 and secondary_uom_code is not null '; "

    pageContext.writeDiagnostics (this, ' [AJ] after the query string", 4");

    pageContext.writeDiagnostics (this, "message query" + Query, 1);

    PreparedStatement stmt = conn.prepareStatement (Query);

    pageContext.writeDiagnostics (this, "prepared statement Post" + stmt, 1);

    stmt.setString(1,Item);  ver1

    stmt.setString(2,Org);  ver1

    stmt.setInt (3, Dis.intValue ());

    stmt.setString(3,Dis);

    stmt.setInt (3, Ext.intValue ());

    stmt.setString (3, Ext); ver1

    pageContext.writeDiagnostics (this, "Post Ext after SetString" + Ext, 1);

    ResultSet resultset = stmt.executeQuery ();

    pageContext.writeDiagnostics (this, "Resultset" + resultset, 1);

    If (resultset.next ())

    for (ResultSet resultset = stmt.executeQuery ();)

    ResultSet.Next ();)

    While (resultset.next ())

    {

    String code = resultset.getString ('CODE');

    String uom = resultset.getString ("UOM");

    String psuom = resultset.getString ("PSUOM");

    row.setAttribute ("UomCode", code);

    row.setAttribute ("UnitOfMeasure", GLU);

    row.setAttribute ("LineAdjustedPercent", psuom);

    pageContext.writeDiagnostics (this, "secondary UOM" + resultset.getString ('CODE') + resultset.getString ("UOM") + resultset.getString ("PSUOM"), 1);

    pageContext.writeDiagnostics (this, "secondary UOM" + row.getAttribute ("UomCode") + row.getAttribute ("UnitOfMeasure"), 1);

    pageContext.writeDiagnostics (this, "LineAdjustedPercent" + row.getAttribute ("LineAdjustedPercent") + "PSUOM" + resultset.getString ("PSUOM"), 1);

    }

    ResultSet.Close ();

    stmt. Close();

    }

    catch (SQLException sqle)

    {

    throw new OAException ("error in query Preparation" + sqle, OAException.INFORMATION);

    }

    pageContext.writeDiagnostics (this, ' [AJ] after try-catch: ", 4");

    }

    }

    }

    }

    Hi Bobo,

    I tried the same requirement in my local instance and changed the code for you.

    Please check process requires working Code of the form below:

    ' Public Sub processFormRequest (pageContext OAPageContext, OAWebBean webBean)
    {
    OAViewObject QuoteLinesLevel70VO1Obj1 = (OAViewObject) pageContext.getApplicationModule (webBean) .findViewObject ("QuoteLinesLevel70VO1Obj");
    if(QuoteLinesLevel70VO1Obj1!=null)
    {
    If (QuoteLinesLevel70VO1Obj1.GetCurrentRow ()! = null)
    pageContext.writeDiagnostics (this, "Current Row" + QuoteLinesLevel70VO1Obj1.getCurrentRow () .getAttribute ("UomCode"), 1);
    }
               
    pageContext.writeDiagnostics (, "concluded Save Button", OAFwkConstants.STATEMENT);
    If ("Event.Go".equals (pageContext.getParameter (OAWebBeanConstants.EVENT_PARAM)))
    {
    OAViewObject QuoteLinesLevel70VO1Obj = (OAViewObject) pageContext.getApplicationModule (webBean) .findViewObject ("QuoteLinesLevel70VO1Obj");
    if(QuoteLinesLevel70VO1Obj!=null)
    {
    pageContext.writeDiagnostics (thie, 'enter in Count' + QuoteLinesLevel70VO1Obj.getFetchedRowCount (), 1);
    int count = QuoteLinesLevel70VO1Obj.getFetchedRowCount ();
    RowSetIterator Iter = QuoteLinesLevel70VO1Obj.createRowSetIterator ("Iter");
    {if(Count>0)}
    Iter.setRangeStart (0);
    Iter.setRangeSize (count);
    for (int i = 0; i)<>
    {
    OAViewRowImpl row = (OAViewRowImpl) Iter.getRowAtRangeIndex (i);
    If (row.getAttribute ("InventoryItemId")! = null & row.getAttribute ("OrganizationId")! = null)
    {
    String Item = row.getAttribute("InventoryItemId").toString ();
    String Org = row.getAttribute("OrganizationId").toString ();
    Number say = (Number) row.getAttribute ("LineAdjustedPercent"); LineAdjustedPercent
    Dim Ext = (String) row.getAttribute ("Attribute1");
                              
                               int item1 is Integer.valueOf (Item) .intValue ();.   Converted entire string
    int Org1 is Integer.valueOf (Org) .intValue ();.     Converted entire string
    Try
    {
    pageContext.writeDiagnostics (this, "connection entry-front connection", 1);
    Connection Conn = pageContext.getApplicationModule (webBean) .getOADBTransaction () .getJdbcConnection ();
    pageContext.writeDiagnostics (this, "connection entered" & conn, 1);
    pageContext.writeDiagnostics (this, "input connection [AJ]" & conn, 4);
    String query = "select xxtmxc_primary_selling_suom(:1,a.inventory_item_id) PSUOM from mtl_system_items_b where a.inventory_item_id =: 2 and a.organization_id =: 3"; Index link //Changed
    pageContext.writeDiagnostics (this, ' [AJ] after the query string", 4");
    pageContext.writeDiagnostics (this, "message query" + Query, 1);
    PreparedStatement stmt = conn.prepareStatement (Query);
    pageContext.writeDiagnostics (this, "prepared statement Post" + stmt, 1);
                                    Item1 is Integer.valueOf (Item) .intValue ();. Converted entire string
    ORG1 = Integer.valueOf (Org) .intValue ();  Converted entire string
    pageContext.writeDiagnostics (this, "Param1 all" + item1, 1);
    pageContext.writeDiagnostics (this, "Param2 all" + Org1, 1);
    pageContext.writeDiagnostics (this, "Param3 all" + Ext, 1);
    stmt.setString(1,Ext);
    stmt.setInt(2,item1);  ver1
    stmt.setInt(3,Org1);  ver1
    pageContext.writeDiagnostics (this, "Post Ext after SetString" + Ext, 1);
                                    
    for (ResultSet resultset = stmt.executeQuery (); resultset.next ();)  //Used for loop in Resultset
    {
                                       
    String psuom = resultset.getString ("PSUOM");
    pageContext.writeDiagnostics (this, "[AJ] z:" + psuom, 4 "); //Here we got the value of the function
    pageContext.writeDiagnostics (this, "m [AJ]:" + Ext, 4);
                                        
    }
                                    
    stmt. Close();
    }
    catch (SQLException sqle)
    {
    pageContext.writeDiagnostics (this, ' [AJ] with the Exception: "+ sqle.getMessage (), 4");
    throw new OAException ("error in query Preparation" + sqle, OAException.INFORMATION);
    }
    pageContext.writeDiagnostics (this, ' [AJ] after try-catch: ", 4");
    }
                              
    }
    }
                     
          
    }
             
    super.processFormRequest (pageContext, webBean);
    }
    }

    Thank you

    Dilip

  • validation does not

    Hi I'm doing validation by calling the procedure that it is wht I did

    <af:inputText value="#{bindings.SignId.inputValue}"
                                    label="Sign-on ID:"                           
                                    columns="#{bindings.SignId.hints.displayWidth}"
                                    maximumLength="#{bindings.SignId.hints.precision}"
                                    shortDesc="#{bindings.SignId.hints.tooltip}"
                                    id="it2"
                                    autoSubmit="true"
                                    styleClass="inputTextRequired" required="true"
                                    validator="#{Pswdbean.validUsr1}"/>
    
    

    
        public void validUsr1(FacesContext facesContext, UIComponent uIComponent,
                              Object object) {
            String inputString = object.toString().toUpperCase();
    
        OperationBinding oBindings = getOperationBinding("signOnId");
    
            oBindings.execute();
            FacesContext.getCurrentInstance().renderResponse();
        }
    
    

    It does not validate using the code above

    but when use the method below is ok

    public  void signId(ValueChangeEvent valueChangeEvent){
            UIComponent c = valueChangeEvent.getComponent();
            c.processUpdates(FacesContext.getCurrentInstance());
            // Below is the code snippet to invoke above method
            
            
            OperationBinding oBindings = getOperationBinding("signOnId");
                                   
            oBindings.execute();
            FacesContext.getCurrentInstance().renderResponse();
    
        }
    
    

    Hello

    You changed the signOnId public void (String signid) ' public void signOnId (String signid, String err_msa)

    and have not updated the method data binding. You should do something like this...

    public String signOnId (String signid) {}

    ViewObject svo = this.findViewObject("CalMain1");

    String err_msa = null;

    Line = svo.first ();

    SignID = getSignid();

    {if(Row!=null)}

    {if (Row.getAttributeIndexOf ("SignId")! =-1)}

    int index = row.getAttributeIndexOf ("SignId");

    Object [] values is row.getAttributeValues ();.

    {if(values[index]!=null)}

    SignID = (String) row.getAttribute ("SignId");

    callPerformSdmsLogon "(calmain. SignId(?,?) (", new Object [] {signid.toUpperCase (), err_msa});

    }

    }

    }

    Return err_msa;

    }

    ' Public Sub SignIdValidator (FacesContext facesContext, UIComponent uIComponent,

    The object) {}

    String msg = null;

    OperationBinding oBindings = getOperationBinding ("signOnId");

    oBindings.getParamsMap () .put ("signid", object);

    oBindings.execute ();

    String msg = oBindings.getResult (m:System.NET.SocketAddress.ToString ());

    If (msg! = null) {}

    FacesMessage fm = new FacesMessage (msg);

    throw new ValidatorException (fm);

    }

    Delete the current method of signOnId from your customer interface of AM and replace it with the given.

    Then,

    You will have to redo the binding of the method in the page. Then it should work.

    Thank you

    Aman J

  • Reg: Generating range values

    Hi Experts,

    I'm struggling to resolve this issue for the moment quite sometimes, but not luck...

    Sample data :

    with t as)

    Select 1 id, 'D1005-D1009"dual UNION ALL val

    Select 2 id, val "K3630-K3633" of the double

    )

    Expected o/p :

    1 D1005

    1 D1006

    1 D1007

    D1008 1

    1 D1009

    2 K3630

    2 K3631

    2 K3632

    2 K3633

    My test :

    with t as)

    -Select 1 id, 'D1005-D1009"dual UNION ALL val

    Select 2 id, val "K3630-K3633" of the double

    )

    Select

    ID,

    -substr(val,1,1) prefix,

    -pos instr(val,'-'),

    -ltrim (substr (val, 1, instr(val,'-')-1), substr (val, 1, 1)) s_str,.

    -ltrim (substr (val, instr(val,'-') + 1), substr (val, 1, 1)) e_str,.

    substr (Val, 1, 1) | (ltrim (substr (val, 1, instr(val,'-')-1), substr (val, 1, 1)) + level - 1) vals

    t

    connect by level < = (ltrim (substr (val, instr(val,'-') + 1), substr (val, 1, 1))-ltrim (substr (val, 1, instr(val,'-')-1), substr (val, 1, 1))) + 1

    ;



    2 K3630
    2 K3631
    2 K3632
    2 K3633


    I guess something like NOCYCLE clause can be useful... search...

    Pointers?

    Thank you

    -Nordine

    (on Oracle 11.2.0.4.0)

    This should be faster than the approach CONNECT-larger sets of data:

    select /*+ no_xml_query_rewrite */
           t.id
         , substr(t.val, 1, 1) || to_char(x.val, 'fm0999') as val
    from test_range t
       , xmltable(
           'for $i in xs:integer(substring(substring-before($range, "-"), 2))
                   to xs:integer(substring(substring-after($range, "-"), 2))
            return $i'
           passing t.val as "range"
           columns val number path '.'
         ) x ;
    
    create table test_range (id integer, val varchar2(12));
    
    insert into test_range
    select level, chr(64+level)||'0000-'||chr(64+level)||'9999'
    from dual
    connect by level <= 26;
    
    SQL> WITH    got_nums    AS
      2  (
      3      SELECT  id
      4      ,       SUBSTR (val, 1, 1)   AS prefix
      5      ,       TO_NUMBER ( SUBSTR ( val
      6                                 , 2
      7                                 , INSTR (val, '-') -2
      8                                 )
      9                        )          AS low_num
     10      ,       TO_NUMBER ( SUBSTR ( val
     11                                 , INSTR (val, '-') + 2
     12                                 )
     13                        )          AS high_num
     14      FROM  test_range  t
     15  )
     16  SELECT    id
     17  ,         prefix || TO_CHAR (low_num + LEVEL - 1, 'fm0999')  AS vals
     18  FROM      got_nums
     19  CONNECT BY  LEVEL               <= high_num + 1 - low_num
     20  AND         PRIOR               id  = id
     21  AND         PRIOR  SYS_GUID ()  IS NOT NULL
     22  ;
    
    260000 rows selected.
    
    Elapsed: 00:00:11.71
    
    Statistics
    ----------------------------------------------------------
              0  recursive calls
              0  db block gets
              7  consistent gets
              0  physical reads
              0  redo size
        6171324  bytes sent via SQL*Net to client
         191215  bytes received via SQL*Net from client
          17335  SQL*Net roundtrips to/from client
              1  sorts (memory)
              0  sorts (disk)
         260000  rows processed
    
    SQL>
    SQL> select /*+ no_xml_query_rewrite */
      2         t.id
      3       , substr(t.val, 1, 1) || to_char(x.val, 'fm0999') as val
      4  from test_range t
      5     , xmltable(
      6         'for $i in xs:integer(substring(substring-before($range, "-"), 2))
      7                 to xs:integer(substring(substring-after($range, "-"), 2))
      8          return $i'
      9         passing t.val as "range"
     10         columns val number path '.'
     11       ) x ;
    
    260000 rows selected.
    
    Elapsed: 00:00:02.99
    
    Statistics
    ----------------------------------------------------------
              0  recursive calls
              0  db block gets
             32  consistent gets
              0  physical reads
              0  redo size
        6171323  bytes sent via SQL*Net to client
         191215  bytes received via SQL*Net from client
          17335  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
         260000  rows processed
    

Maybe you are looking for

  • MIC monitor

    Hi all I wrote a vi to the continuous monitor the sound from the microphone. I found the stop signal after some time and then program also cannot stop/close normally. No error message displayed after the fact, someone knows what's the problem for him

  • Software update for Xperia M

    I just upgraded to an Xperia M which came with Jelly Bean 4.1 which, according to my knowledge is level 16 on the Android versions.   Have received a message that there is an upgrade of software available that is 15.1.C.1.17 - this is certainly a mov

  • the configuration in the registry information is incomplete or damaged (code 19), all Audio devices!

    After restarting my laptop today, I noticed that his or my microphone wasn't working. Shortly after, went to check my reading and recording settings to see that all of the devices that were once there were not show. It wasn't a matter of display disa

  • GPS problem

    Dear, According to instrucations here: https://developer.BlackBerry.com/Cascades/documentation/device_platform/location/retrieving.html 'Retrieve a single fix. I added the code in the cpp file, added "LIBS +=-lQtLocationSubset" in my file pro and the

  • Display volume bar

    The volume on my Pavilion dv7 (Windows 7 64-bit) display bar will not be cut.  Known fixes for this?