SQL to align child values with parent columns

Hi everyone,
I'm stumped on how to develop an sql query that generates a report where my child values are aligned with my parent columns based on matching years.  Here's the example...
create table test_yr (yr_id number primary key, yr_nb number);
insert into test_yr values (1,2013);
insert into test_yr values (2,2014);
insert into test_yr values (3,2015);
create table test_parent (parent_id number primary key, parent_yr_id_begin number, parent_title varchar2(100));
alter table test_parent add foreign key (parent_yr_id_begin) refererences test_yr (yr_id);
insert into test_parent values (1,1,'This rec starts in 2013');
create table test_child (
     child_id number primary key,
     child_parent_id number,
     child_yr_id_begin number,
     child_title varchar2(100),
     child_yr1_val number, child_yr2_val number, child_yr3_val number, child_yr4_val number, child_yr5_val number
alter table test_child add foreign key (child_parent_id) references test_parent (parent_id);
alter table test_child add foreign key (child_yr_id_begin) references test_yr (yr_id);
insert into test_child values (1,1,3,'This rec starts in 2015',10,20,30,40,50);
insert into test_child values (2,1,3,'This rec starts in 2015',15,25,35,45,55);
The child can start at a different begin year than the parent, making yr1 for parent and yr1 for child different.  So for this example, year 1 of the child (2015) = year 3 of the parent.
I can get the values strictly from the child using the following...
select child_yr1_val, child_yr2_val, child_yr3_val, child_yr4_val, child_yr5_val
from test_child
where child_parent_id = 1;
However, I need the report to be based off of the first five years of the parent.  And since the child doesn't start until 2015, the first two years should be zero.  Here is the expected result:
yr1 | yr2 | yr3 | yr4 | yr5
0   | 0   | 10  | 20  | 30
0   | 0   | 15  | 25  | 35
I'm trying to do this using plain sql without having to use pl/sql to derive a dynamic query.  But I need to somehow match up and align the years... such as in this example, yr1(child) = yr3(parent), yr2(child) = yr4(parent), etc.  I'm hoping some joins and case statements will do the trick, but I don't quite know how to utilize them to get the result I need.  Can anyone help?  Oracle 11gR2.
Thanks,
Mark

Hi,
oramark14 wrote:
Hi Frank,
Thanks so much for your reply!  I'll try to digest this solution and implement it this weekend.  I also agree completely about the table design...  I know apps shouldn't drive database design,  ...
If you get indigestion, feel free to ask questions here.
The SELECT ... PIVOT feature isn't very convenient for dealing with missing values.  You may prefer to change the main query like this:
WITH unpivoted_child AS
    SELECT  child_id, child_parent_id
    ,       child_yr_id_begin + child_yr - 1   AS column_num
    ,       val
    FROM    test_child
    UNPIVOT (    val
            FOR  child_yr  IN ( child_yr1_val  AS 1
                              , child_yr2_val  AS 2
                              , child_yr3_val  AS 3
                              , child_yr4_val  AS 4
                              , child_yr5_val  AS 5
    WHERE   child_parent_id  = 1
SELECT    NVL (SUM (CASE WHEN column_num = 1 THEN val END), 0)  AS yr1
,         NVL (SUM (CASE WHEN column_num = 2 THEN val END), 0)  AS yr2
,         NVL (SUM (CASE WHEN column_num = 3 THEN val END), 0)  AS yr3
,         NVL (SUM (CASE WHEN column_num = 4 THEN val END), 0)  AS yr4
,         NVL (SUM (CASE WHEN column_num = 5 THEN val END), 0)  AS yr5
FROM   unpivoted_child
GROUP BY  child_parent_id
,         child_id
ORDER BY  child_parent_id
,         child_id
Also, if you want to see how SELECT ... PIVOT works, this can help show you.
Having 5 separate columns for input can be very conveninet, just like having 5 separate columns for display.  But, as you said, that shouldn't drive the table design.  If necessary, you could create a view that has 5 separate val columns, like your current table, and write an INSTEAD OF trigger for user input.

Similar Messages

  • Min Value with all column

    Oracle 10g database
    I have 2 rows in table
    at_id
    emp_id
    at_date
    time_in
    time_out
    status
    00041
    14/06/2013
    0925
    02
    25
    00041
    14/06/2013
    1400
    02
    I want to select Min(time_in) value with all column.
    if I write this query all row shows:-
    select at_id,emp_id,at_date,min(time_in) timein,time_out,status from t
    group by at_id,emp_id,at_date,time_out,status;
    I need
    at_id
    emp_id
    at_date
    time_in
    time_out
    status
    00041
    14/06/2013
    0925
    02

    You could try analytics as well:
    with xx as ( select at_id,emp_id,at_date,time_in,time_out,status,
                       row_number() over (partition by at_id, emp_id, at_date, status
                                          order by time_in desc nulls last ) rnum
                   from t)
    Select at_id, emp_id, at_date, time_in, time_out, status
      from xx
    where rnum = 1;

  • Restful: Child lov with parent prompt

    I have 2 dimensions, Parent and Child. The list of values of the Child dimension contains a prompt on the parent. With restful, I want to the the list of values for the child dimension. I've created a webi document with a prompted filter on the Child dimension. So I have 2 prompts one the webi document, one from the Child dimension and one from the list of values of the child dimension.
    A call GET http://{hostname}:6405/biprws/raylight/v1/documents/{documentID}/parameters/{parameterID} for the child prompt returns the expected xml:
    <lov hierarchical="false" refreshable="true">
    <id>UNIVERSELOV_DS0.DO4</id>
    <parameters>
    <id>0</id>
    </parameters>
    </lov>
    where 0 is the id of the parent dimension
    I then use the resful call PUT http://{hostname}:6405/biprws/raylight/v1/documents/{documentID}/parameters/{parameterID} to answer the parent and the child's lov.
    When the prompt on the parent in the list of values is not optional, everything is fine but when the prompt is optional, I get the error :
    Bad Request WSR 00102 - Illegal argument (Suspicious identifier(s): [0])
    In both case, I use the input xml (with true or false value for optional attribute of parameter):
    <parameters>
         <parameter optional="true|false">
              <id>0</id>
              <answer>
                   <values><value id="10" >Parent 10</value></values>
              </answer>
         </parameter>
         <parameter>
              <id>1</id>
              <answer>
                   <info><lov><query intervalId="0" intervalSize="10000" /></lov></info>
              </answer>
         </parameter>
    </parameters>
    If I use the refresh="true" attribute to the query tag, I don't get any value for the child lov only:
    <lov hierarchical="false" refreshable="true">
    <id>UNIVERSELOV_DS0.DO4</id>
    </lov>
    Any ideas?

    Eric,
    I hope it's not an issue but an invalid input XML.
    I just made some good progress. The restful documentation states that "The <info> element is not mandatory in the XML inputs, except in the case of cascading parameters and hierarchical parameters.", so I surround the values tag by a info tag and it almost works in both cases (mandatory and optional parent prompt). The XML input is
    <parameters>
       <parameter>
          <id>0</id>
          <answer>
             <info>
                <lov>
                   <query intervalSize="-1" />
                </lov>
             </info>
             <values>
                <value id="1">Parent 1</value>
                <value id="3">Parent 2</value>
             </values>
          </answer>
       </parameter>
       <parameter>
          <id>1</id>
          <answer>
             <info>
                <lov>
                   <query intervalSize="-1" />
                </lov>
             </info>
          </answer>
       </parameter>
    </parameters>
    But one problem solves, one problem raises. When a answer no parent value (<values></values>), I get in return of a PUT call, the same result as a GET call:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <parameters>
        <parameter dpId="DP0" type="prompt" optional="false">
            <id>0</id>
            <technicalName>pmParent(s)?</technicalName>
            <name>Parent(s)?</name>
            <answer type="Text" constrained="true">
                <info cardinality="Multiple">
                    <lov refreshable="true" partial="false" hierarchical="false">
                        <id>UNIVERSELOV_DS0.DO1</id>
                        <updated>2014-10-09T12:54:54.000+01:00</updated>
                        <values>
                            <value id="1">Parent 1</value>
                            <value id="2">Parent 2</value>
                            <value id="3">Parent 3</value>
                        </values>
                        <columns mappingId="0">
                            <column type="String" id="0">Parent </column>
                        </columns>
                    </lov>
                    <previous>
                        <value id="1">Parent 1</value>
                        <value id="3">Parent 2</value>
                    </previous>
                </info>
                <values>
                    <value id="1">Parent 1</value>
                    <value id="3">Parent 2</value>
                </values>
            </answer>
        </parameter>
        <parameter dpId="DP0" type="prompt" optional="true">
            <id>1</id>
            <technicalName>pmChild(ren)?</technicalName>
            <name>Child(ren)?</name>
            <answer type="Text" constrained="true">
                <info cardinality="Multiple">
                    <lov refreshable="true" hierarchical="false">
                        <id>UNIVERSELOV_DS0.DO3</id>
                        <parameters>
                            <id>0</id>
                        </parameters>
                    </lov>
                    <previous>
                        <value id="21">Child 21 - 2</value>
                    </previous>
                </info>
                <values>
                    <value id="21">Child 21 - 2</value>
                </values>
            </answer>
        </parameter>
    </parameters>
    Nevertheless, I get a workaround for this situation, instead of not answering the parameter, I have to answer all possible values. It's not a nice solution and I hope a better one exists.
    The results are the same with
    http://{hostname}:6405/biprws/raylight/v1/documents/{documentID}/parameters/{parameterID}/
    and with
    http://{hostname}:6405/biprws/raylight/v1/documents/{documentID}/parameters/
    except, of course that when using first url, the return xml contains only one parameter (the one in the url)
    Regards

  • SQL Developer autoformating text values with hypen (-)

    Hi
    This happens in SQL Developer. The version which I use is 2.1.0.63
    When I insert a varchar2 value to a column in the table, if there is a hyphen in the text and if there are empty lines in the text, the empty lines are lost. If there is no hyphen, it works fine.
    Below is an eg:
    Create table test (error Varchar2(500));
    Insert into test values ('This
    is
    a
    test
    Select * from test;
    The result copied to a notepad is below
    This
    is
    a
    test
    Now remove the hypen from the text and insert the record
    The result copied to a notepad is below
    This
    is
    a
    test
    Can anyone explain me why this is happening. I have a lot of text with hyphen and almost all my records are auto-formatted by sql developer.
    any help is appreciated.
    Warm Regards
    -Georgey
    Edited by: 859895 on Jul 7, 2011 4:14 PM

    So, I'm just checking this in 3.1 and it looks fine to me.
    drop table test ;
    Create table test (error Varchar2(50));
    Insert into test values ('This
    is
    a
    test
    Insert into test values ('This
    is
    a
    test
    select rownum, length(error) from test;
    select * from  test;gives this on the f5 output
    table TEST dropped.
    table TEST created.
    1 rows inserted.
    1 rows inserted.
    ROWNUM LENGTH(ERROR)
         1            25
         2            37
    ERROR                                           
    This                                              
    is                                                
    a                                                 
    test                                              
    This                                              
    is                                                
    a                                                 
    test                                              
           In F9, if you edit the col value, the data is intact. It looks like the cell renderer compresses space down for viewing purposes.
    Thanks
    Barry

  • Sql Loader INFILE name value in table column Value

    Hi,
    Here is my Sql Loader Script
    LOAD DATA
    infile '%1'
    APPEND INTO TABLE XX_SUPPLIER_UPD
    FIELDS TERMINATED BY ";" OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
    ACTION Char
    ,ADDRESS_TYPE Char
    ,REGION Char "LTRIM(RTRIM(:REGION))"
    ,PO_BOX Char
    ,,WWW_ADDRESS Char
    ,status Char "NVL(:status,'X')"
    ,filename Char "replace(:infile,'\"','')"
    I am getting the infile name as the parameter and i want to insert that parameter value in the column name fillename. Can any one guide me to how to do.
    Cheers!
    Jayaraj.S

    If you were to use external tables instead of SQL*Loader, you can dynamically change the location of the external table (i.e. the filename) using a simple ALTER TABLE statement.
    External tables also mean that all the control is inside the database rather than relying on external utilities and external scripts.
    ;)

  • Updating child table with parent table

    Can anyone help me with this update statement?
    I have a table BETA with children of the family list and I have table GAMA with children and family list. The relation between family and children is 1 to many. Now we have decided to update table BETA which has children list with table GAMA’s family list. So I did as below.
    UPDATE beta B
    SET (b.childe_code 
       ,b.childe_name) =(SELECT DISTINCT g.family_code
                          ,g.family_name
           FROM gama g
           WHERE b.childe_code IN (SELECT g.childe_code
                                             FROM gama g)
           AND g.period = (SELECT MAX(period) FROM gama g))
    WHERE EXISTS (SELECT 1
           FROM gama g
           WHERE b.childe_code IN (SELECT g.childe_code
                                             FROM gama g)
           AND g.period = (SELECT MAX(period) FROM gama g));It is giving this error: ORA-01427: single-row subquery returns more than one row
    Could someone please help me with this?
    Thanks for the help.

    Hello tubby,
    Here is the answers for all your questions.
    How about you post your Oracle version
    select * from v$version
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    CORE     10.2.0.4.0     Production
    TNS for Solaris: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - ProductionThe DDL for BETA and GAMA tables (create table statements).
    CREATE TABLE BETA
      CHILDE_CODE  NUMBER,
      CHILDE_NAME  VARCHAR2(50 BYTE),
      PERIOD       INTEGER
    CREATE TABLE GAMA
      FAMILY_CODE  NUMBER,
      FAMILY_NAME  VARCHAR2(50 BYTE),
      CHILDE_CODE  NUMBER,
      CHILDE_NAME  VARCHAR2(50 BYTE),
      PERIOD       INTEGER
    )Sample data for both tables (in the form of INSERT statements) which represent a small test case you've constructed.
    Insert into BETA
       (CHILDE_CODE, CHILDE_NAME, PERIOD)
    Values
       (10, 'google', 201010);
    Insert into BETA
       (CHILDE_CODE, CHILDE_NAME, PERIOD)
    Values
       (11, 'amazon', 201010);
    Insert into BETA
       (CHILDE_CODE, CHILDE_NAME, PERIOD)
    Values
       (12, 'ebay', 201010);
    Insert into BETA
       (CHILDE_CODE, CHILDE_NAME, PERIOD)
    Values
       (13, 'yahoo', 201010);
    Insert into BETA
       (CHILDE_CODE, CHILDE_NAME, PERIOD)
    Values
       (20, 'word', 201010);
    Insert into BETA
       (CHILDE_CODE, CHILDE_NAME, PERIOD)
    Values
       (21, 'excel', 201010);
    Insert into BETA
       (CHILDE_CODE, CHILDE_NAME, PERIOD)
    Values
       (22, 'access', 201010);
    Insert into BETA
       (CHILDE_CODE, CHILDE_NAME, PERIOD)
    Values
       (23, 'cognos', 201010);
    Insert into BETA
       (CHILDE_CODE, CHILDE_NAME, PERIOD)
    Values
       (30, 'cell phone', 201010);
    Insert into BETA
       (CHILDE_CODE, CHILDE_NAME, PERIOD)
    Values
       (31, 'laptop', 201010);
    Insert into BETA
       (CHILDE_CODE, CHILDE_NAME, PERIOD)
    Values
       (32, 'pager', 201010);
    Insert into GAMA
       (FAMILY_CODE, FAMILY_NAME, CHILDE_CODE, CHILDE_NAME, PERIOD)
    Values
       (1, 'website', 10, 'google', 201010);
    Insert into GAMA
       (FAMILY_CODE, FAMILY_NAME, CHILDE_CODE, CHILDE_NAME, PERIOD)
    Values
       (1, 'website', 11, 'amazon', 201010);
    Insert into GAMA
       (FAMILY_CODE, FAMILY_NAME, CHILDE_CODE, CHILDE_NAME, PERIOD)
    Values
       (1, 'website', 12, 'ebay', 201010);
    Insert into GAMA
       (FAMILY_CODE, FAMILY_NAME, CHILDE_CODE, CHILDE_NAME, PERIOD)
    Values
       (1, 'website', 13, 'yahoo', 201010);
    Insert into GAMA
       (FAMILY_CODE, FAMILY_NAME, CHILDE_CODE, CHILDE_NAME, PERIOD)
    Values
       (2, 'software', 20, 'word', 201010);
    Insert into GAMA
       (FAMILY_CODE, FAMILY_NAME, CHILDE_CODE, CHILDE_NAME, PERIOD)
    Values
       (2, 'software', 21, 'excel', 201010);
    Insert into GAMA
       (FAMILY_CODE, FAMILY_NAME, CHILDE_CODE, CHILDE_NAME, PERIOD)
    Values
       (2, 'software', 22, 'access', 201010);
    Insert into GAMA
       (FAMILY_CODE, FAMILY_NAME, CHILDE_CODE, CHILDE_NAME, PERIOD)
    Values
       (2, 'software', 23, 'cognos', 201010);
    Insert into GAMA
       (FAMILY_CODE, FAMILY_NAME, CHILDE_CODE, CHILDE_NAME, PERIOD)
    Values
       (3, 'wireless', 30, 'cell phone', 201010);
    Insert into GAMA
       (FAMILY_CODE, FAMILY_NAME, CHILDE_CODE, CHILDE_NAME, PERIOD)
    Values
       (3, 'wireless', 31, 'laptop', 201010);
    Insert into GAMA
       (FAMILY_CODE, FAMILY_NAME, CHILDE_CODE, CHILDE_NAME, PERIOD)
    Values
       (3, 'wireless', 32, 'pager', 201010);The desired output you want based on the input data, with an explanation as to how the data needs to be transformed.
    I want to replace data of childe_code and childe_name with family_code and family_name in the beta table. The error message you are currently getting is quite descriptive, you are getting back more than a single row for a given row you are trying to update. If you can deterministically decide which rows to take and outline that in your example, we can help you.

  • Window.open always opens a child window with parent window propertiesin firefox 30

    By clicking on a link my code uses window.open which should open the response in child window. I am not specifying any height and width(as per requirement). In firefox alone, the window takes up the properties of child window and opens with same size as of parent window. Is there a way to restrict Firefox from inheriting the properties of parent window?

    Hi prajulakc,
    Thank you for your question. Currently the active window selected when you create a new window that new window will take the active window's screensize.
    You can add a preference: see also [https://support.mozilla.org/en-US/questions/754273 question/754273]

  • Can I retrieve cursor's value with variable columns?

    I have a loop to check a bunch of columns in a cursor, I'd like to use a variable columns like following:
    cursor cur
    while ....
    loop
    cur.XXX
    end loop;
    here XXX are dynamical generated VARCHAR2.
    Could you please tell me is it possible, or not?
    Thanks alot

    Thanks for reply, first. I have couple of columns like abc_1 to abc_100 in the table, I need to check their value one by one. I want to check them using something like abc_X, in the cursor. my thought is like below,
    while i<= 100
    loop
    cur_name.abc_X
    end loop
    Just replace X with 1 to 100.

  • How to check the integer value with Date Column

    Hi Friends,
    I have a filter called 'Days'. I need to show the data based on the Days filter (Example : 2 Days).
    Example Query:
    Select * from Tb1
    Where EndDate(Value as '03/05/2013' > Days ( value as 2)
    How to handle the above scenario.
    Thanks in Advance....
    Regards,
    LuckyAbdul

    what meanings does it make. how can you compare a date to day count. Or is the inetger value an offset ie say 2 days from today etc?
    If yes you can use like below illlustration
    DECLARE @DayOffset int
    SET @DayOffset = 2
    SELECT *
    FROM TAble
    WHERE ENdDate >= DATEADD(dd,DATEDIFF(dd,0,GETDATE()),@DayOffset+1)
    refer
    http://visakhm.blogspot.in/2010/01/some-quick-tips-for-date-formating.html
    Please clarify with an example what you're expecting if its different from the above.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How to replace the string of column value with other column value in same table

      
    I have a temp table  which contains 
    Id  Name CTC   Address                      Content
    1    Ross  $200   6th block                  Dear #Name your  CTC  is #CTC and your address is  #address
    2   Jhon   $300   1oth cross                 Dear #Name your  CTC  is #CTC and your address is  #address
    Now i want to  select content    so that it should get  replace with  the respective  columns  and final output should come like this 
     Dear Ross your  CTC  is 200 and your address is    6th block  
      Dear Jhon your  CTC  is 300 and your address is   10th cross  
    Kindly suggest

    I think RSingh suggestion is ok ... what do you mean by another way? ...maybe something more generic?
    maybe build a table whith the list of col you need to "replace" and dinamically build the replace query ...
    declare @colList table(colName varchar(100))
    insert into @colList
    select 'name'
    union all select 'ctc'
    union all select 'address'
    declare @cmd varchar(2000)
    select @cmd='select '+ (select 'replace(' from @colList for xml path('') +' content '+
    (select ',''#'+ colName +''', '+ colName +')' from @colList for xml path(''))
    +' from YOURTABLENAME '
    exec (@cmd)
    or your request was different ?

  • Comparing two column values with multiple Parameter in VC (Indicator)

    Hello VC experts,
    GM
    I would like to know about how to indicate multiple parameter with different colour in same column and also comparing value with adjucent column.
    Eg.
    Parameters     ,,           Column1      ,,              Column 2       ,,            Indicator (Image)
    Parameter 1    ,,             a1             ,,                     b1          ,,                  RED
    Parameter 2    ,,            a2              ,,                     b2          ,,                  GREEN
    Parameter 3    ,,            a3              ,,                     b3          ,,                 
    Parameter 4    ,,            a4              ,,                     b4          ,,
    In case I  : Parameter -1     Column 1 ( value)  =  more is better compared to Column 2
    In case II : Parameter -2     Column 1 ( value)  =  Less is better compared to Column 2
    How to acheive this  INDICATOR based value comparison.
    Edited by: Sunil  B. Mundhe on Mar 7, 2009 6:30 AM
    Edited by: Sunil  B. Mundhe on Mar 7, 2009 6:38 AM

    Hi
    This is possible in VC. You have to insert 'Image' UI in the required table. Add images of alert through 'Image manager' (Tools tab). Select relevant images of alert in 'Image' UI. In display there is option for 'visibility condition' there you enter condition (like if greater than ,true,false).
    Like wise you can add multiple 'Image' UIs in that table & based on visibility conditions you will get these alert images in table.
    Regards
    Sandeep

  • Java.sql.SQLException: Cannot convert value

    I have a database table - name is client. It has one field with TimeStamp Datatype.
    I am using mysql-3.23.51-win and j2sdk-1_4_0_01-windows-i586.
    create table client (
    MODIFIED timestamp(14)
    while I am doing select MODIFIED from client that time I am receiving 00000000000000.
    So It has 00000000000000 value in databse.
    Now I am getting this value using ResultSet. for that
    I have a one Client Object class name is GenericClient
    public class GenericClient {
    private java.util.Date _modified;
    public java.util.Date getModified() {
    return _modified;
    public void setModified(java.util.Date newVal) {
    this._modified = newVal;
    In my database processing class I am getting database value and set that value in setModified(java.util.Date newVal).
    like
    private Client decodeRow(ResultSet rs) throws SQLException {
    GenericClient obj = new GenericClient();
    obj.setModified(rs.getTimestamp(1));
    return obj;
    So at obj.setModified(rs.getTimestamp(1)); line I am received error message
    java.sql.SQLException: Cannot convert value '00000000000000' from column 1 to TIMESTAMP.
    Please guide me why I am receiving the above error.
    Thanks
    Amit

    Please find some more information from my side
    1) I am passing Timestamp Object
    2) I am using PreparedStatement
    3) code
    Table : client
    create table client (
         MODIFIED timestamp(14)
    );Bean Class
    public class GenericClient {
         private java.util.Date _modified;
         public java.util.Date getModified() {
              return _modified;
         public void setModified(java.util.Date newVal) {
              this._modified = newVal;
    }Method - which is fired error
    private Client decodeRow(ResultSet rs) throws SQLException {
         GenericClient obj = new GenericClient();
         obj.setModified(rs.getTimestamp(1));
         return obj;
    }3) Error Stack
    ==========
    java.sql.SQLException: Cannot convert value '00000000000000' from column 1 to TIMESTAMP.
            at com.mysql.jdbc.ResultSet.getTimestampFromString(ResultSet.java:5538)
            at com.mysql.jdbc.ResultSet.getTimestampInternal(ResultSet.java:5566)
            at com.mysql.jdbc.ResultSet.getTimestamp(ResultSet.java:5219)
            at com.ksea.manager.ClientManager.decodeRow(ClientManager.java:463)
            at com.ksea.manager.ClientManager.loadByWhere(ClientManager.java:266)
            at com.ksea.manager.ClientManager.loadByWhere(ClientManager.java:221)
            at com.ksea.manager.ClientManager.loadByWhere(ClientManager.java:203)
            at com.ksea.manager.ClientManager.loadByUsername(ClientManager.java:53)
            at com.ksea.nt.DBSynch.synchEmployees(DBSynch.java:83)
            at com.ksea.nt.DBSynch.synchAll(DBSynch.java:35)
            at com.ksea.nt.DBSynch.main(DBSynch.java:168)4) db Info
    =======
    I am using mysql-3.23.51-win and j2sdk-1_4_0_01-windows-i586.

  • Cascading LOVs (v4) and retaining the child value

    I've implemented the default delivered implementation in version 4 (4.0.2.00.07 to be exact) of cascading LOVs. Working fine except for one thing...after refresh of a child LOV, the previously selected value is wiped out even when it's still a valid value in the child LOV. If it's an invalid value, I can understand that it would be wiped out, but if it's still valid, I'd like it to be retained.
    Example...let's say I have these two select-lists (parent and child).
    P100_PARENT
    P100_CHILD
    P100 Child's SQL references P100_PARENT:
    where b.child = NVL(a.parent,b.child)
    Optimize refresh is also set to 'No' because I need the child to refresh to all children selections when parent is null.
    In short, the parent is optional. If Parent is null, show all child options regardless of Parent. If Parent is defined, show only the child options for the parent.
    So when parent is null, I get all child options (OK). I pick one.
    If I go to parent and change it to a specific value that IS the parent of the child I chose, my expectation is the child select list should refresh (it does) but if my chosen value is still in the list, it should scroll to it and select it. Instead, it wipes it out.
    To put some values into the example...
    Let's say parent values are:
    A
    B
    C
    null
    Let's say child values are numbers such that valid values are:
    1 through 10 when parent is A
    11 through 20 when parent is B
    20 through 30 when parent is C
    1 through 30 (any child value) when parent is null.
    So I have a null parent LOV value and the child shows me 1 through 30 (OK). I pick 15.
    I change the parent to 'B'. Child list refreshes (OK). But while 15 is still a valid value in the list, it is not selected again (my value is wiped out). I still want it to have '15' selected.
    Any workaround? Is this a bug? Enhancement opportunity?

    Hi Matt,
    have you had a look at Skill Builders "Save Value on Cascade" dynamic action plug-in? See http://skillbuilders.com/oracle-apex/Application-Express-APEX-Consulting-Training.cfm?tab=free-plugin-downloads
    Regards
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Update column with parent child relationships

    Hi,
    i need to update a column with parent child relationship.
    Please provide the possible queries..
    Gobi..

    Hi,
    Depending of the objective and the size of the tables, personally, for maintenance purposes, I preferred duplicate the parent with the new column value and duplicate the child records with this same new value. Other alternative is disable the foreign key temporarily.
    You can take a look on this link below too:
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:5773459616034
    Cheers

  • How to list selected parent and child rows with values from ADF TreeTable

    I created one tree table having three levels using DepartmentsVO, EmployeesVO and
    JobHistoryVO where these tables contains parent and child relationship on database.
    Then i added one more column to the tree table which displays selectBooleanCheckBox. This
    check box is available for parent and child rows in that column.
    My first concern is i
    want to list out all the parentids and its child ids from three levels where the check
    box is selected.
    second concern is
    if i select the check box for a parent row, then the remaining check boxes for child rows also select automatically which are comes under the parent row.
    Thanks in advance.
    jk

    hi Frank,
    Thanks for the quick reply...
    As I mentioned before I am able to get the children using JUCtrlHierNodeBinding. but wanted to change the value of child row which have specific data.
    Is it possible through JUCtrlHierNodeBinding to update data of child and parent?? If so then can you please post the code snippet for the same???
    Viral

Maybe you are looking for

  • How to Avoid Save As dialog when Saving

    We recently upgraded Adobe Reader X to XI.  One difference between the two is the behavior of the Save function the first time it is performed.  In Reader X, when Save was selected, the file would simply save the current file, overwriting the origina

  • Can I print both wireless and USB to same HP 8625 printer from different computers?

    I Just installed a new HP Officejet Pro 8625 printer which is connected to my desktop computer via a hard wire USB connection.  I also have a separate PC which is used for connecting to my Wi-Fi network.  Can I have the same printer connected to one

  • PO release/distribution (from SRM to backend) FModules?

    Hi experts, I need to create a report that allows the user to release/distribute (sorry if these are not the right words to call the process) a PO ... My report actually retrieves the header of the purchase order ,that has status "waiting" ("park") i

  • Version Name vs File Name

    When I import files, the result seems to adhere to the Version Name I enter in the Input Inspector panel. But then, when I'm in Brower Line Mode, I see that the Filename reflects projects I imported a week ago, alongside the correct Version Name. Sho

  • CONTACTING APPLE.. POSSIBLE

    IS IT POSSIBLE TO CONTACT APPLE UK.. I AM ON MY 6TH IPOD IN A YEAR OFF THE WARRANTY THEY HAVE ALL BEEN FAULTY AND NOW THEY HAVE SENT ME ONE WHICH DIDNT WORK AT ALL!! CAN SOMEONE TELL ME HOW TO MAKE A COMPLAINT?