JavaFX Single line table

Hello World) recently I started using javafx and I faced a complication that I don't know how to solve.

I have a table view with specific columns. I need fill the cells with text data, represented by String objects.

Sometimes these strings contains more than one line, but I still need the table display to show only a (first) line of this text so that the rows are the same height regardless of the amount of lines of text.

Is it possible to do? Thanks in advance)

Use a cell factory. Suppose you have

TableColumn someColumn ;

Then you can do

someColumn.setCellFactory(col -> new TableCell() {
  @Override
  public void updateItem(String item, boolean empty) {
      super.updateItem(item, empty);
      if (empty) {
          setText(null);
      else {
          int lineBreakIndex = item.indexOf("\n");
          if (lineBreakIndex >= 0) {
              setText(item.substring(0, lineBreakIndex);
          } else {
              setText(item);
          }
      }
  }
});

Tags: Java

Similar Questions

  • How to merge data from the table with a single line

    Hello

    I have three tables subscription_type, the address and the person. Here are the details of the table

    Person Subscription_type Address                                           

    Person_Id AdressType_id Address_id

    Person_name Description Address_type_id

    Person_id

    Address details


    There are three types of different address - home, postal and previous.

    Each person can have these three different addresses.

    I want to create a view that displays all addresses of three of each person in the table of the person in a single line.

    Any help please

    In your example, there are 2 rows of columns street1, TOWN, SUBURB etc for a single person. To convert this into a single line, with the new columns we could simply use CASES or DECODE in the select as the SQL below. To understand why consolidation function THAT MAX is used - remove the MAX and GROUP BY in SQL keyword and try.

    Select full_name

    , max (case when description = "Home" then end street1) Home_Street

    , max (case when description = "Home" then end suburb) home_suburb

    , max (case when description = end of the "Home" then City) home_city

    , max (case when description = "Home" then postal code end) home_postcode

    , max (case when description = "Home" then end state_name) home_state

    , max (case when description = 'Postal' then end street1) Postal_Street

    , max (case when description = 'Postal' and then end of suburb) Postal_suburb

    , max (case when description = 'Postal' then the city) Postal_city

    , max (case when description = 'Postal' and then end of CP) Postal_postcode

    , max (case when description = 'Postal' then state_name end) Postal_state

    , max (case when description = "Back" then end street1) Prev_Street

    , max (case when description = "Back" then end suburb) Prev_suburb

    , max (case when description = "Back" then city end) Prev_city

    , max (case when description = "Back" then postal code end) Prev_postcode

    address a

    S State

    No p

    Subscription_type att

    where a.person_id = p.person_id

    and a.state_id = s.state_id

    and a.address_type_id = att.address_type_id

    Full_name group

  • given in the lines, combine them in a single line

    Hello world

    I have programmed plsql to organize data based on a condition, but I need to do it directly in sql, if possible, once the value of the line in another line to combine in a single line, for example

    Header 1 Header 2 Header 3
    A77A84A12
    A12A10A11
    A30A44A42
    A77A02A70

    A08

    A09A86A08

    The goal

    Header 1 Header 2 Header 3 Header 4 Header 5 Heading 6
    A02A10A11A12A77A84
    A08A09A86
    A30A42

    A44

    If you can see the line no 2 & 4 there is A12, A77 who do declare on line no 1, so I need to combine and so on.

    example of data

    CREATE TABLE testrows (col1 VARCHAR2 (10), col2 VARCHAR2 (10), col3 VARCHAR2 (10));

    INSERT INTO testrows

    VALUES ('77', 'A84', 'A12');

    INSERT INTO testrows

    VALUES ("A12", "A10", "A11");

    INSERT INTO testrows

    VALUES ('A30', 'A44', "A42");

    INSERT INTO testrows

    (col1, col2

    )

    VALUES ("A08", "A09"

    );

    INSERT INTO testrows

    (col1, col2

    )

    VALUES ('A86","A08"

    );

    INSERT INTO testrows

    VALUES ('A77","A02","A70");

    Kind regards

    Hello

    I'm not sure that understand what you want.  You must explain in more detail, citing specific examples.

    Why won't you 'The A70' in the results?

    Maybe you want something like this:

    WITH got_r_num AS

    (

    SELECT col1, col2, col3

    ROWNUM AS r_num

    OF testrows

    )

    got_grp AS

    (

    SELECT the val

    MIN (val CONNECT_BY_ROOT) AS grp

    -The following 3 lines are necessary only if rotating into discrete columns

    -, ROW_NUMBER () OVER (PARTITION OF MIN (val CONNECT_BY_ROOT)

    --                               ORDER BY      val

    --                             )          AS c_num

    OF got_r_num

    UNPIVOT (val

    FOR the collar (col1, col2, col3)

    )

    CONNECT BY NOCYCLE (val = val PREREQUISITE AND r_num <> r_num PREREQUISITE)

    OR (val <> val PREREQUISITE AND r_num = PRIOR r_num)

    GROUP BY val

    )

    SELECT LISTAGG (val, ",") THE Group (ORDER BY val) AS val_list

    OF got_grp

    GROUP BY grp

    ORDER BY grp

    ;

    The results I get include "The A70" and are in a tall column concatenated, but are also what you asked:

    VAL_LIST

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

    A02, A10, A11, A12, A70, A77, A84

    A08 A09, A86

    A30, A42, A44

    The number of columns in the output must be hard-coded in the application.  If you want the number of columns depends on what the search query, you need dynamic SQL statements.  The following all the addresses this issue:

    Re: 4. How can I convert rows to columns?

    Re: County report and the sum of the number of rows by multiple columns

    http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:4471013000346257238

  • join in the query with the result of a single line

    Hi all

    I have two tables
    create table item(item_id number primary key,
    item_desc varchar2(200));
    
    create table item_properties(item_id number references item(item_id),
    property_name varchar2(20),
    property_value varchar2(100));
    I insert the following records
    insert into items values(1,'CPU');
    insert into item_properties values(1,'RAM','2gb');
    insert into item_properties values(1,'PROCESSOR','2ghz');
    insert into item_properties values(1,'HARDDISK','2ghz');
    commit;
    now I want a query that produces the following results
    item_id      RAM      PROCESSOR         HARDDISK
    1              2gb        2ghz              2TB
    How to generate this result?
    I create a query, but it generates several lines, instead I need a single line like above.
    select i.item_id,p.property_value from items i , item_properties p
    where i.item_id=p.item_id and i.item_id=1;
    Kind thanks.

    Published by: Maahjoor on May 7, 2013 12:22 AM
    select i.item_id,
           max(decode(p.property_name,'RAM',p.property_value)) ram,
           max(decode(p.property_name,'PROCESSOR',p.property_value)) processor,
           max(decode(p.property_name,'HARDDISK',p.property_value)) hd
    from items i , item_properties p
    where i.item_id=p.item_id
    and i.item_id=1
    group by i.item_id;
    

    Or pivot to 11g

    with details as
    (
    select i.item_id,p.property_name,p.property_value
    from item i , item_properties p
    where i.item_id=p.item_id
    and i.item_id=1
    )
    select *
    from details
    pivot
     (
       max(property_value) for property_name in ('RAM','PROCESSOR','HARDISK')
     );
    

    Published by: JAC on May 7, 2013 13:04

  • AF board display a single line

    I use jdev 11.1.1.5

    I dropped a table af... I want on UI for it to display a single row (a first)... I don't want that it displays all the lines

    What property should change... I remember in 11.1.1.3 there was a building known as lines, but do we have nothing in 11.1.1.5

    Or add the VO even for the modules of applications data model using a different name, click on the edit button on the top of the face of data model and change the knot tuning to return a single line for the VO. Then you have a VO which returns all the lines you use for the tables and which returns a single row.

    Timo

  • Get-hard drive on a single line of csv

    Hello


    I have to do a migration to a new san.

    I want to be able to move everyting off the old san to the new, but I also need to separate files vmdk to different LUNS.
    --------------
    ex:

    (VM1 (vmxfiles, Hd1, hd2, hd3) SAN1LUN1)--> (((VM1 vmxfiles) SAN2LUN0), ((VM1 hd1) SAN2LUN1), ((VM1 hd2) SAN2LUN2), ((VM1 hd3) SAN2LUN3))
    --------------

    I wish I could get a single line in a csv file:

    --------------
    ex:

    VMName, VMXFILESLUN, HD1, HD1LUN, HD2, HD2LUN, HD3, HD3LUN
    --------------

    Is it possible to have this command, which overlooks several lines

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

    Get-disk hard - VM * | where {$_.} DiskType - "Flat" eq} | Select the Parent, name, file name

    Parent                                                             Name                                                              Filename
    ------                                                             ----                                                              --------
    VM1                                                         Hard disk 1                                                       [DS1] VM1/VM1.vmdk
    VM1                                                         Hard disk 2                                                       [DS1] VM1/VM1_1.vmdk
    VM1                                                         Hard disk 3                                                       [DS1] VM1/VM1_2.vmdk

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

    Instead, format to give:

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

    VM1, name, hard drive 1, VM1/VM1.vmdk disk, Hard [DS1] 2, [DS1] VM1/VM1_1.vmdk, Hard disk 3, VM1/VM1_2.vmdk [DS1]

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

    Thank you

    Try something like that.

    Note that we need to sort the table with the longest row at the top, otherwise Export-Csv has a problem.

    $report = @()
    foreach($vm in Get-VM){
        $row = "" | Select VM    $row.VM = $vm.Name
        foreach($hd in (Get-HardDisk -VM $vm)){
            Add-Member -InputObject $row -MemberType NoteProperty -Name $hd.Name.Replace("Hard disk ","HD") -Value $hd.Name
            Add-Member -InputObject $row -MemberType NoteProperty -Name $hd.Name.Replace("Hard disk ","LUN") -Value $hd.Filename
        }
        $report += $row}
    $report | Sort-Object -Property {($_ | gm | Measure-Object).Count} -Descending | ` Export-Csv "C:\vm-hd-list.csv" -NoTypeInformation -UseCulture
    
  • Replace or remove all single line breaks in a Blob

    Hello

    I want to remove/replace all new simple lines (NOT the carriage return / new line) in a BLOB.

    I tried to convert the BLOB in a clob, and then replace all occurrences of new lines of simple with the function replace (for example replace (clob, 10),)
    I even cut the clob into small pieces of varchar2 and tried to apply the function replace etc., but without success!

    I'd be happy if someone could give me a tip how I could fix this problem.

    I use
    Request 4.1.0.00.32 Express on
    Oracle 10g (10.2.0.4.0 - 64 bit)

    Thank you
    Johnny

    Johnny Be Good wrote:
    Hi Paul,.

    the answer to your first question is simple. I use a blob instead of a clob object because I download a file (csv) using an element "Browse file".
    The file is then stored in FLOWS_FILES. WWV_FLOW_FILE_OBJECTS$ (wwv_flow_files) that stores the file in a blob (blob_content) column.

    What to do now is to store the contents of the BLOB to a file in a directory in order to to use as an external file.
    After this, I question the external file and merge the contents into a normal table within the database.

    The problem I have now is that sometimes downloaded csv files have 'broken data sets' in the way that a line (a single dataset), which was divided into
    two or more rows (with a single line break at the end of each line instead of a carriagereturn/linefeed to the normal lines).
    Sometimes, when the lines matching/data sets contain a very large text (e.g. 3000 characters) in a single column and MS excel (the tool used to record the original excel in csv file) can not handle this long texts of a column and breaks the content of a line into multiple lines in a cell.

    However, I need to "Break" the broken data sets in the blob downloaded by removing (or replace) single line breaks, which are an indication of a split data set.

    In view of this process. I converted to CLOB BLOB when the file is extracted from APEX_APPLICATION_FILES, remove the EPA of the problem, and then write in the file system as a CLOB.

    I tried to do by converting the BLOB in a clob, for example with this function:

    A function like this is reinventing the wheel. 10g comes with dbms_lob.convertToClob (see above).

    And after conversion, trying to replace all the occurrences of single line within this clob breaks, for example with this code:

    l_clob := replaceClob(l_clob,chr(10),' ');
    

    Who will replace all the LFs, whether or not they are in CR/LF pairs. Use regexp_replace/regular expressions to exclude EPA following a CR (see above).

    "Without success" means, that the line breaks have not been replaced. I tried several ways as delete (replace without a third parameter and the corresponding function), replacement (for example with a white) etc. !

    I even tried to apply the function of standard replacement for varchars on a clob that I read somewhere that it is supported in 10g and apex 4.1 but with the same result.

    I think that you have been making life difficult for yourself. Everything that seems to involve more (ineffective) writing code as necessary. Everything you need is built into 10g (it seems that you could use the obsolete references?)

    I hope I could explain the question a bit better now and would appreciate it if you had a starting point for me.

    Should have what you need in the above examples.

  • PL/SQL muliple line insert for a single line

    I need to insert several lines in a single line. Here is the table structures and sample data
    CREATE TABLE TEST_SAMPLE (NAME VARCHAR2(20), ATTR_1 VARCHAR2(20), ATTR_2 VARCHAR2(20), ATTR_3 VARCHAR2(20),ATTR_4 VARCHAR2(20));
    
    CREATE TABLE TRANSACTION (NAME VARCHAR2(20), ATTR VARCHAR2(20))
    
    insert into TEST_SAMPLE (NAME, ATTR_1, ATTR_2, ATTR_3,ATTR_4) values ('hello','asd','fgh','ert',null);
    For the anecdote above in the TEST_SAMPLE table, three records must be populated\inserted in TRANSACTION table. In PL/SQL
    stored procedure I am insert records of TRANSACTIONS when ATTR_1 or ATTR_2 or ATTR_3 or ATTR_4 is not null.

    Please help me to find a better way to insert above in table TRANSACTION?

    Like this...

    SQL> ed
    Wrote file afiedt.buf
    
      1  insert all
      2    when 1=1 then
      3      into TEST_SAMPLE (NAME, ATTR_1, ATTR_2, ATTR_3,ATTR_4) values (name, attr_1, attr_2, attr_3, attr_4)
      4    when attr_1 is not null then
      5      into TRANSACTION (NAME, ATTR) values (name, attr_1)
      6    when attr_2 is not null then
      7      into TRANSACTION (NAME, ATTR) values (name, attr_2)
      8    when attr_3 is not null then
      9      into TRANSACTION (NAME, ATTR) values (name, attr_3)
     10    when attr_4 is not null then
     11      into TRANSACTION (NAME, ATTR) values (name, attr_4)
     12  select 'hello' as name
     13        ,'asd' as attr_1
     14        ,'fgh' as attr_2
     15        ,'ert' as attr_3
     16        ,null as attr_4
     17* from dual x
    SQL> /
    
    4 rows created.
    
    SQL> select * from test_sample;
    
    NAME                 ATTR_1               ATTR_2               ATTR_3               ATTR_4
    -------------------- -------------------- -------------------- -------------------- --------------------
    hello                asd                  fgh                  ert
    
    SQL> select * from transaction;
    
    NAME                 ATTR
    -------------------- --------------------
    hello                asd
    hello                fgh
    hello                ert
    
  • The simple aggregate data of a certain number of lines into a single line on 10g xe

    Hi all, is it solution for 10g xe how to aggregate the data of a certain number of rows in a single line.
    Basic data:
    DEPTNO ENAME
    ---------- ----------
    20 SMITH
    ALLEN 30
    WARD 30
    20 JONES
    30 MARTIN
    30 BLAKE
    10 CLARK
    SCOTT 20
    10 KING
    30 TURNER
    20 ADAMS
    30 JAMES
    20 FORD
    10 MILLER

    need to update table B with this release

    DEPTNO EMPLOYEES
    ---------- --------------------------------------------------
    10 CLARK, KING, MILLER
    20 SMITH, FORD, ADAMS, SCOTT, JONES
    30-ALLEN, BLAKE, MARTIN TURNER, JAMES, WARD

    concerning
    Gordan

    Hello

    The deliimter (the 2nd argument) in SYS_CONNECT_BY_PATH should never appear in the elements be concatenated (the 1st argument). Use a different delimiter; It can be more than 1 character, if you wish.
    For example:

    SELECT    deptno
    ,       LTRIM ( SYS_CONNECT_BY_PATH (ename, '`')
                , '`'
              )     AS employees
    FROM        (
              SELECT  deptno
              ,     ename
              ,     ROW_NUMBER () OVER ( PARTITION BY  deptno
                                        ORDER BY          ename
                                ) AS curr
              FROM    emp
           )
    WHERE       CONNECT_BY_ISLEAF     = 1
    START WITH     curr     = 1
    CONNECT BY      curr        = PRIOR curr + 1
         AND     deptno      = PRIOR deptno
    ;
    

    Furthermore, the code you posted was the way to Oracle 9 use SYS_CONNECT_BY_PATH. In Oracle 10, it is simpler and more effective to use CONNECT_BY_ISLEAF, as shown above.

    If you really want to use a delimiter that appears in the data, then you can use some other characters in SYS_CONNECT_BY_PATH and then use REPLACE on the results, like this:

    SELECT    deptno
    ,       REPLACE ( LTRIM ( SYS_CONNECT_BY_PATH (ename, '`')
                           , '`'
                     )
                , '`'
                , ','
                )     AS employees
    FROM ...
    

    Of course, if you do this, you will not be able to tell if "CLARK, KING, MILLER" is 1, 2 (e.g., 'CLARK' and 'KING, MILLER') or 3 elements.

  • Extract data into a single line

    Hi good morning all,
    Here's my problem: my goal is to have a single flat txt file with a single line!
    That being said can someone tell me how to retrieve my oracle table data in a txt file, with the news that my table has a single colum (varchar 250); and I have 200 rows in this table;
    the output should be only a single line without end!
    Thank you for your great support;
    I try with all possible overall; (set pagesize 0 tab settled out of SPACE SET SET NEWPAGE 0 0 trimspool set set verify off set set recsep [off set echo off... off position) but no way to work!

    user647922 wrote:
    Thank you all for the reply! Dear BLUSHADOW! I try but I get an error that I can't understand:
    SQL > declare
    cursor cur_e is
    Select to_char (MASTRECORD_EDU, 'fm9999') as ln
    of operant.fic_bdf;
    v_fh UTL_FILE. TYPE_DE_FICHIER;
    Start
    v_fh: = UTL_FILE. FOPEN ('W_DIR', 'testout.txt', 'w');
    for e in cur_e
    loop
    UTL_FILE. PUT(v_fh,e.LN);
    end loop;
    UTL_FILE. FCLOSE (v_fh);
    end;
    /
    declare 2 3 4 5 6 7 8 9 10 11 12 13 14
    *
    ERROR? line 1:
    ORA-01722: invalid number
    ORA-06512:? line 8

    Help, please!

    This means that one of your MASTRECORD_EDU values is not a valid number. Question by data, not code Office.

  • How to change the background color of a single line

    Hi, OTN,.

    I use JDeveloper with ADF faces 11.1.1.2 in the view layer. My question is how to change the background color of a single line in af:table?.

    Hi idir Mitra
    You can use EL to bind column for example inlineStyle (#{row.id == null?' background-color: rgb (255,214,165);':'background-color:red'})})

    Cordially Abhilash.S

  • All the dimension values must be single line values

    I created a Simple hierarchy with the following levels:

    Category
    Subcategory
    Agenda

    The mapping of the hierarchy above is based on a table where the column list are as follows:

    ITEM_KEY
    NOM_ELEMENT
    BRAND_KEY
    BRAND_NAME
    CATEGORY_KEY
    CATEGORY_NAME
    SUBCATEGORY_KEY
    SUBCATEGORY_NAME


    Item_key is the primary key for this table and nom_element is also unique.

    When I maintain this dimension, the following error occurs:


    An error occurred on the server
    Class of error: failure of the Express
    Server error descriptions:
    INI: Error creating a generic Manager definition to < BuildProcess > TxsOqConnection::generic
    INI: XOQ-01600: OLAP DML error "all dimension values must be single line values." while executing DML 'SYS. AWXML! R11_COMPILE_ATTRIBUTES('ITEM.) DIMENSION') ', generic for TxsOqStdFormCommand::execute '.

    at oracle.olapi.data.source.DataProvider.callGeneric (unknown Source)
    at oracle.olapi.data.source.DataProvider.callGeneric (unknown Source)
    at oracle.olapi.data.source.DataProvider.executeBuild (unknown Source)
    to oracle.olap.awm.wizard.awbuild.UBuildWizardHelper$ 1.construct (unknown Source)
    to oracle.olap.awm.ui.SwingWorker$ 2.run (unknown Source)
    at java.lang.Thread.run(Thread.java:595)

    The essential error is "all the dimension values must be unique row values", which means that the server tries to create a dimension of AW member containing a newline character. The error occurs under the SYS. AWXML! Procedure R11_COMPILE_ATTRIBUTES, which is where the attributes are indexed (i.e. transformed into dimension members). If my guess is that one of your attributes (likely mapped to a column _NAME) contains a new line.   The solution is to disable the indexing for that attribute.   In terms of AWM you must make sure the following boxes are not activated in the "Général" pane

  • Create the views level attribute columns
  • Index

  • Data in multiple lines concatenated into a single line to separate id

    Hello

    I have a t1 like this table:

    create table t1
    (number of c1,
    number of C2,
    C3 number (4.2)
    );

    Data in the table are such as:

    ----------------------------------------
    C1 | C2 | C3 |
    -----------------------------------------
    102. 1. 1.1 |
    102. 1. 1.2 |
    102. 2. 2.1 |
    103. 2. 2.1 |
    103. 2. 2.2 |
    -----------------------------------------

    How to display data by using a query above?

    ------------------------------------------------------
    C1 | C2 | C3 |
    -------------------------------------------------------
    102. 1, 2 | 1.1, 1.2, 2.1 |
    103. 2. 2.1, 2.2.
    ------------------------------------------------------

    Thank you

    So you're after what we call 'Aggregation in the chain.'

    Check this link as it highlights several techniques:

    Aggregation of string techniques

    A Re: Concat ranks of the values in a single column Michael

    At Re: multiple lines in a single line in the 'single column Table' followed by reason of Billy on the conduct of a stragg first.

    In addition, 11 GR 2 has the LISTAGG function.

  • Multi lines convert to a single line

    Dear Group members
    I want to convert the queries that return multiple lines in a single line. Scanario is provided for in
    select * from inout v
    where v.empcode = '00047'
    and v. dated = '27-dec-09'
    
    EMPCODE      DATED        IN_TIME   NET_TIME     ATT_STATUS     VAL
    00047     27/12/2009     0     0       G             1
    00047     27/12/2009     0     0       R             1
    00047     27/12/2009     7.44     483       P             1
    This query gives multi lines, but I would like to convert it into a line like this
    EMPCODE      DATED        IN_TIME   NET_TIME     ATT_STATUS     VAL
    00047     27/12/2009     7.44     483       R             1
    If the employee came the day that has three traffic status ('G', 'R', 'P'), then it should show in_time, net_time situation and their participation should be 'R '.

    In this example there are two rows. I need the line that has in_time > 0, which is the 2nd bet replaces att_status 'P' for 'R '.
    EMPCODE      DATED        IN_TIME   NET_TIME     ATT_STATUS     VAL
    00047     25/12/2009     0     0       R             1
    00047     25/12/2009     7.59     476       P             1
    Suppose that there are the 25/12/2009 and employee came that day then it shows the following result.
    EMPCODE      DATED        IN_TIME   NET_TIME     ATT_STATUS     VAL
    00047     25/12/2009     7.59     476       R             1
    It presents 'R' Att_status coloums instead of 'P '.

    >
    Note that
    'G' = blew in gusts
    'R' = rest
    "P" = present
    >

    Test case is provided for in
    CREATE TABLE INOUT
    (
      EMPCODE     VARCHAR2(10),
      DATED       DATE,
      IN_TIME     NUMBER(10,2),
      NET_TIME    NUMBER(10,2),
      ATT_STATUS  VARCHAR2(5),
      VAL         NUMBER(3)
    )
    
    insert into inout(EMPCODE,    DATED     ,IN_TIME , NET_TIME, ATT_STATUS, VAL  )
    values           ('00047','25-DEC-2009',     0    ,       0     ,   'R' ,           1);
    insert into inout(EMPCODE,    DATED     ,IN_TIME , NET_TIME, ATT_STATUS, VAL  )
    values           ('00047','25-DEC-2009',     7.59 ,       476   ,   'P' ,           1);
    insert into inout(EMPCODE,    DATED     ,IN_TIME , NET_TIME, ATT_STATUS, VAL  )
    values           ('00047','27-DEC-2009', 0    ,    0         ,   'G'     ,       1);
    insert into inout(EMPCODE,    DATED     ,IN_TIME , NET_TIME, ATT_STATUS, VAL  )
    values           ('00047','27-DEC-2009',     0    ,       0     ,       'R'     ,       1);
    insert into inout(EMPCODE,    DATED     ,IN_TIME , NET_TIME, ATT_STATUS, VAL  )
    values           ('00047','27-DEC-2009',     7.44 ,       483   ,       'P' ,           1);
    Thanks and greetings
    select distinct empcode,dated,
           case when cnt>0 then
             max(in_time) over (partition by empcode,dated)
            else
               in_time
            end in_time,
           case when cnt>0 then
             max(net_time) over (partition by empcode,dated)
            else
               net_time
            end net_time,
    
           case when cnt >0 then
               case when status in  ('G','P','R')  then
                'R'
                    when status in ('HCP','1/2') THEN
                'HCP'
               end
             else
               status
            end status
           from (
            select v.empcode,v.dated,v.in_time,v.net_time,(count(*) over (partition by v.empcode,v.dated)) cnt,att_status status
             from inout v
            where v.empcode = '00047')
    

    Published by: Khaled Aradhye, January 20, 2010 02:23

  • convert the column values to a single line...

    I have to return the column values to a single line separated by commas.
    If the nulls in the column just ignore without a comma.
    Here is one for example. There are three values and two NULL values in the table
    SQL> select ID from temp_fa;
    ID
    -----
    
             1
             2
    
             3
    
             5
    
    6 rows selected.
    
    
    I am expecting an output as 1,2,3,5
    Help, please

    There is always more than one title in the Oracle world ;)
    You can use the TRIM, for example (same configuration as your example):

    hoek&XE>  create table t as select level col  from dual connect by level <= 6;
    
    Tabel is aangemaakt.
    
    hoek&XE> update t set col = null where col in (1,3,5);
    
    3 rijen zijn bijgewerkt.
    
    hoek&XE> select * from t;
    
           COL
    ----------
    
             2
    
             4
    
             6
    
    6 rijen zijn geselecteerd.
    
    hoek&XE> select ltrim(sys_connect_by_path(col, ','), ',') output
      2  from  ( select col
      3          ,      row_number() over (order by col) rn
      4          from   t
      5        )
      6  where connect_by_isleaf=1
      7  start with rn=1
      8  connect by rn = prior rn+1;
    
    OUTPUT
    -------------------------------------------------------------------------------------------------------------
    2,4,6,,,
    
    1 rij is geselecteerd.
    
    hoek&XE> select trim ( both ',' from sys_connect_by_path(col, ',')) output
      2  from  ( select col
      3          ,      row_number() over (order by col) rn
      4          from   t
      5        )
      6  where connect_by_isleaf=1
      7  start with rn=1
      8  connect by rn = prior rn+1;
    
    OUTPUT
    -------------------------------------------------------------------------------------------------------------
    2,4,6
    
    1 rij is geselecteerd.
    

Maybe you are looking for

  • Java with Facebook Firefox errors

    HelloWith Facebook, every time the screen just where I go to another page on Facebook, I received several errors of Java. Please see the attached screenshots. I'd appreciate any help with this error of Java.Thank you...

  • Intermittent output HDMI (sound and vision) Z70-80

    Hey everybody, Hope someone has some useful advice. Got my lenovo about a week ago. Try to connect to my smart TV via HDMI and are based on the questions: 1 connection is not immediate, i.e. I need to plug and unplug the cable hdmi repeatedly until I

  • The palette of colors and LabVIEW RT on cRIO

    Hello I have problem with the help of the color scheme for Sound and Vibration toolkit in the VI real cRIO running on the system at the time. When I try to drag and drop control of the color palette in the front that I get the icon: http://screenshoo

  • ATTENTION: No supported video Configuration detected

    System stopped!ATTENTION: No supported video Configuration detected Action is required This computer has a graphics add-in card, but the screen is pluggedintegrated into the video connector.To connect the cable from the monitor into the graphics add-

  • HP integrated family camera on windows vista premium does not work with the new version of Skype

    I can do everything a coup is no longer video calls via the new version of Skype - on my Windows vista computer family premium. and the older version of Skype is no longer available for download... Help, please.