All the columns after first column null/white

Database: 10.2.0.1
OS: Windows xp

I need your help in the future. I have a table whose columns varchar2 20. Table looks something like this:
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Col1                       Col2                       Col3                                  Col4                    Col5               Col6...Col20
-------------------------------------------------------------------------------------------------------------------------------------------------------------
In some operating systems, you can use a character in place of HOST such as "$" in Windows.                         On some platforms,
SQL*Plus removes the       SQLTERMINATOR              (a semicolon by default)              before the HOST command                    A workaround for this     
Power required (all columns after first null/white column for a given row)
Output
On some platforms,
A workaround for this     
I'm sorry, I'm not having the machine in this moment, which is why I'm not necessary validation create table and SAMPLES.

I hope I'm clear in my question.

Thank you.

Hello

Assuming that you know a few suibstring who never appears in the data, you can get all the columns after the first NULL like this:

SELECT     REPLACE ( REGEXP_SUBSTR ( '/' || col1  ||
                                     '/' || col2  ||
                                     '/' || col3  ||
                      ...
                                     '/' || col20 ||
                       , '//.*'
                       )
           , '/'
--           , ' '
           )
FROM    table_x
;

As indicated, this returns the concatenated text, without any delimiter.
If you want the delimiter, omit to REPLACE them; Just use REGEXP_SUBSTR.
If you want a delimiter which may appear in the text, then a comment the argument 3 to REPLACE.

Tags: Database

Similar Questions

  • My display suddenly developed the columns of white dashes and has been distorted in many places.

    My display suddenly developed the columns of white dashes and has been distorted in many places. Subsequently, do not display and the computer turns off to protect themselves. I opened it in safe mode, and the screen is fine. I suppose a software problem. I tried to download a driver for AMD Radeon HD 6570 GPU without result and tried a reset to an earlier date also with no luck. Does anyone have any suggestions?

    Hello

    You certainly know the graphics that, when you say Radeon?

    You normally get drivers Chipset/video/graphic of your computer/notebook or the graphics card, if you have installed a graphics card manufacturer's Web site.

    If he continues to play until after you have installed the latest drivers, next step is to swap the graphic card with a good if a desktop computer.

    This is the path, and the problem is somewhere along it:

    Monitor > cable > Port > that is either connected to a graphics card in a slot on the motherboard or integrated graphics hardware that is part of the motherboard.

    When a laptop; If under warranty, contact the manufacturer.

    If it is not under warranty, contact a repair shop, local.

    See you soon.

  • How can I get my email back contacts views? I can only see my contacts 'online status. I accidentally deleted all the columns and cannot see contacts, emails.

    I can only view my contacts by "online status" in windows live mail.   I accidentally deleted all the columns and cannot see contacts, emails. How to bring back my columns?

    Hi celine,.

    For a more specialized on issue of Windows Live Mail help, post your query on the Windows Live Forum. Windows Live Forum - http://windowslivehelp.com/

  • Error when selecting all the columns in the table

    Hi all

    When I write a query by selecting all the columns of the table fromo using * function as well as another new column, I get the error,

    Select *, to_char (hiredate, 'fmday') day

    WCP

    where to_char (hiredate, 'fmday') ('Monday');

    ERROR on line 1:

    ORA-00923: THE KEYWORD not found where expected

    I need all the columns in the table with the column user-defined 'day '. Is there a way I can get the result like this?

    Hello

    padders wrote:

    Alias table to use...

    Or the name of the table, for example

    Select emp.*, to_char (hiredate, "fmday") as day

    WCP

    where to_char (hiredate, 'fmday') ('Monday');

    The bottom line is that * must be qualified (with a table name or alias) when the SELECT clause includes anything else besides *.

  • Bug: 4.1.1 as a table with all the columns of conditionals

    I need to make all the columns in a tabular form conditional because in some situations the editable elements must not appear. For some reason, simply change the columns in the form of work conditional stop valves, the ApplyMRU/ApplyMRD process works but not action lines changed. I can't understand why all or of a workaround.

    You can easily replicate this in 4.1.1 creating a form of table with the wizard by selecting a column in the form. Then subordinate the selector colunn line and your editable column using the expression 1 = 1 plsql. The form is displayed all the same with these real conditions but it does not work. Weird how?

    Rod West

    Rod,

    In your scenario, the tabular rendering engine may not place the hidden status columns, internal tabular form in your form, i.e. the columns that contain amounts of control, etc.. The logic that puts these columns search the last column unconditional, visible in the form of your table and includes hidden fields here. If you need at least a column that is always indicated to do so. This can be an empty column. I filed a bug (#13881803) to do this, so we can look to improve this logic.

    Kind regards
    Marc

  • Display all THE columns in the session state for a collection V4.0

    I loaded columns into a collection of APEX c001 to c020. as follows
    I'm in 1.:P1_SPC_NO_OF_SPECIMENS LOOP
    htmldb_collection.add_member (p_collection_name = > 'SPECIMEN_BATCH',)
    p_C001 = >: P1_LEVEL,.
    p_C002 = >: P1_PARENT_ID,.
    p_C003 = >: P1_SPC_TYPE,.
    p_C004 = >: P1_SPC_BANK_ASSIGNED,.
    p_C005 = >: P1_SPC_TRIAL,.
    p_C006 = >: P1_SPC_CONCENTRATION,.
    p_C007 = >: P1_SPC_SERUM_TAKEN_DATETIME,.
    p_C008 = >: P1_SPC_SERUM_FROZEN_DATETIME,.
    p_C009 = >: P1_SPC_CELL_COUNT,.
    p_C010 = > case: P1_SPC_CELL_COUNT_UNIT when '?' then "else: P1_SPC_CELL_COUNT_UNIT end.
    p_C011 = >: P1_SPC_VIABILITY_STATUS,.
    p_C012 = >: P1_SPC_VIABILITY_REASON,.
    p_C013 = >: P1_SPC_INITIAL_QUANTITY,.
    p_C014 = > case: P1_SPC_QUANTITY_UNIT when '?' then "else: P1_SPC_QUANTITY_UNIT end.
    p_C015 = >: P1_SPC_COMMENTS,.
    p_C016 = >: P12_SPC_VOL_OF_SAMPLE,.
    p_C017 = >: P12_SPC_DILUTION_FACTOR,.
    p_C018 = >: P12_SPC_A260,.
    p_C019 = >: P12_SPC_A280,.
    p_C020 = >: P12_SPC_RIN);
    END LOOP;

    When I discovered the contents of the collection in session state, I don't see until c010. How can I view all the columns 'C' of a collection in session state? I know that the values are in the columns to c020 c011 as I can successfully insert 20 values into a table!

    Thanks in advance
    Paul P

    Hello

    Better create report own region for debugging.

    SELECT *
    FROM apex_collections
    WHERE collection_name = 'SPECIMEN_BATCH'
    

    You can set the status of report never when you need, or just delete the entire region.

    Kind regards
    Jari

  • I need to re - installs all the software after the upgrade to windows 10 Windows 7? Should I backup my data?

    I need to re - installs all the software after the upgrade to windows 10 Windows 7? Should I backup my data?

    Hello

    without wise normal all your settings and data must be retained.

    However its always recommended to make a backup of all your important files.

  • Background image of a slide that appear in all the slides after and I can't remove it

    Hello

    I am changing a course created with Captivate 5, Captivate 7 and for some reason any background image slide 35 appeared in all the slides after one and I can not remove. The most interesting thing is that when you look at the film slides, they are different (like the original) than on the workspace that contains the background image, I'm trying to delete (screenshot below).

    Capture captivate.PNG

    Ideas or comments?

    Thank you.

    You can check the accordion of Timing (not visible on the screenshot)? There may be value to display for the rest of the project?

    Or is the image on the master slide used for other slides?

  • When I have a constarint of deferable in the Oracle database, while creating the ADF BC, all the columns in this table is marked as primary key. any help on how to fix this?

    DROP TABLE TWO.

    DROP TABLE ONE;

    CREATE TABLE 'A

    (

    ACTIVATE THE 'ID' NUMBER NOT NULL,

    ACTIVATE THE "SERIAL" VARCHAR2 (10 BYTE) NOT NULL,

    ACTIVATE THE "FIRST NAME" VARCHAR2 (30 BYTE) NOT NULL,

    ENABLE 'PK_ONE' CONSTRAINT PRIMARY KEY ('ID', "SERIAL")

    )

    TABLESPACE 'USERS ';

    CREATE TABLE "TWO"

    (

    ACTIVATE THE 'ID' NUMBER NOT NULL,

    ACTIVATE THE "SERIAL" VARCHAR2 (5 BYTE) NOT NULL,

    ACTIVATE THE "DEGREE_CODE" VARCHAR2 (10 BYTE) NOT NULL,

    'TEST_NAME' VARCHAR2 (20 BYTE),

    ACTIVATE THE KEY PRIMARY CONSTRAINT 'PK_TWO' ('ID', 'SERIAL'),

    "FK_TWO' FOREIGN KEY ('ID', 'DEGREE_CODE') CONSTRAINT REFERS TO 'ONE' ('ID', 'SERIAL') MAYBE DEFERRED ENABLE

    )

    TABLESPACE 'USERS ';

    If we use the above sql scripts to create the tables and create the ADF BC using the above 2 tables, all 4 columns in table 2 are reported as the primary key.

    User, tell us your version of Jdev, please!

    You should file an SR with support.oracle.com for this.

    As a work around you can change the area of occurrence, and remove the check mark key pirmary on the unwanted columns. After that, it should work.

    Timo

  • ALTER TABLE with the column NULL time consuming

    Hello

    I have a table with nearly 2 million documents (about 10 GB size table) when I perform the following change statement its run fast

    ALTER TABLE tbl_1 ADD (DEFAULT col_4 NUMBER 100 NOT NULL);

    but when I do not give the NOT NULL in the alter its taking a long time to complete this i.e tbl_1 of ALTER TABLE ADD (NUMBER col_4 by DEFAULT 100); once I do the column as NOT NULL.

    Can someone explain why is it happening like that regarding the execution point.

    Thanks in advance.

    I can reproduce the effect in 11.2.0.1 - but not in 12.1.0.1.

    drop table tbl_1;

    create table tbl_1

    as

    Select rownum id

    , lpad ('* ', 50,' *') padding

    of the double

    connect by level<=>

    ALTER TABLE tbl_1 ADD (NUMBER col_4 by DEFAULT 100);

    --> slow in 11.2.0.1; fast 12.1.0.1

    ALTER TABLE tbl_1 ADD (DEFAULT col_4 NUMBER 100 NOT NULL);

    --> Quick 11.2.0.1 and 12.1.0.1

    A SQL trace for two operations (11g) shows that the altar slow (without the constraint explicit non-null) made explicit (and tedious) update of any row in the table:

    Update 'TBL_1"set"COL_4"= 100

    call the query of disc elapsed to cpu count current lines

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

    Parse        1      0.00       0.02          0          1          0           0

    Run 1 11,63 33.56 8336 1016125 2053531 1000000

    Fetch        0      0.00       0.00          0          0          0           0

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

    Total 2 11,63 33,58 8336 1016126 2053531 1000000

    The other trace file does not contain the explicit Update. I guess in the optimized case that oracle stores somewhere that col_4 has the value 100 and updates only the line of the block after completing DML operations. But that's just a guess.

  • all the columns in a database instance

    Hi all

    I need all these columns in the database for all tables to check some specific query ones. We have a table for the columns as we ALL_TABLES for all tables?

    Hello

    954475 wrote:

    Hi all

    I need all these columns in the database for all tables to check some specific query ones. We have a table for the columns as we ALL_TABLES for all tables?

    Yes, there is ALL_TAB_COLS.

    'ALL' in ALL_TAB_COLS, as in ALL_TABLES. You hear all those you have privileges to see, not necessarily those in the database.  The data dictionary views whose names begin with DBA_ (for example, DBA_TAB_COLS and DBA_TABLES) include all those in the entire database.  Usually, not everyone is allowed to use the DBA_ views.

  • Query that count only the column null lines

    create table test
    (a varchar2 (10))
    b varchar2 (10),
    c varchar2 (10),
    d varchar2 (10),
    e varchar2 (10));


    SQL > DESC TEST
    Name Null? Type
    ------------------------------- -------- ----
    A VARCHAR2 (10)
    B VARCHAR2 (10)
    C VARCHAR2 (10)
    D VARCHAR2 (10)
    E VARCHAR2 (10)

    SQL > SELECT * FROM TEST;

    A B C D E
    ---------- ---------- ---------- ---------- ----------
    A1 - A3 A4-
    B1 - B3, B4-
    C1 - C3 C4-
    D1 - D4 D5
    -E2 - E4 E5


    I want an application that only count the rows of the column as null

    A B C D E
    --- ---- ----- ------ -------
    1 4 2 0 3

    Published by: Nilesh hole, Pune, India, on August 28, 2009 12:30
    select SUM(case when a is null then 1 else 0 end)
          ,SUM(case when b is null then 1 else 0 end)
          ,SUM(case when c is null then 1 else 0 end)
          ,SUM(case when d is null then 1 else 0 end)
          ,SUM(case when e is null then 1 else 0 end)
    from TEST
    /
    

    Published by: Toon Koppelaars August 28, 2009 09:07

  • count all the columns in the tables belonged to the user

    I want to get a handle on the width of the collar of ALL tables owned by a user.
    I have this syntax to check individual tables:
    SELECT COUNT (*)
    Of user_tab_columns
    WHERE table_name = < tbl_name >;

    But, I did a DESC on the USER_TAB_COLUMNS and it is not an owner\user that I can use to get all the tbls.

    Any suggestions how I can get it to go through all the tables (I will be rolled up the output to a file)

    Hello

    USER_TAB_COLUMNS view is not the owner because all available information is on your own schema.

    The DBA_TAB_COLUMNS view has the same information more OWNER. Then, you can query the number of columns for each table of any user. For example:

    SELECT TABLE_NAME, COUNT(*)
    FROM DBA_TAB_COLUMNS
    WHERE OWNER = 'SCOTT'
    GROUP BY TABLE_NAME
    

    Or, for all schemas

    SELECT OWNER, TABLE_NAME, COUNT(*)
    FROM DBA_TAB_COLUMNS
    GROUP BY OWNER, TABLE_NAME
    ORDER BY OWNER, TABLE_NAME
    

    Kind regards
    Miguel

  • Newbie - sorting data at the top and bottom of the column, NULL values

    I have this example:
    drop table da;
    create table (da)
    ANAME varchar2 (10)
    , number (3,0) db_ID
    (, dc_ID number (3.0));
    insert into da(aname,db_id,dc_ID) values('Apples',1,100);


    drop table db;
    Create table (db)
    VARCHAR2 (10) aBBB
    , rec_id number (3.0)
    (, number (3.0)) db_id.
    insert into db (aBBB, rec_id, db_id) values('B1test',1,1);
    insert into db (aBBB, rec_id, db_id) values('B2test',2,1);


    drop table dc;
    Create table (dc)
    VARCHAR2 (10) of the aCCC
    , rec_id number (3.0)
    (, dc_id number (3.0));


    insert into dc (aCCC, rec_id, dc_id) values('C1test',10,100);
    insert into dc (aCCC, rec_id, dc_id) values('C2test',20,100);
    insert into dc (aCCC, rec_id, dc_id) values('C3test',30,100);

    Select aname, db_id, dc_Id
    abbb, accc null null
    of da
    where db_id = 1
    Union of all the
    Select A.aname, A.db_id, null dc_id
    B.aBBB, accc null
    DB B right outer join da A
    ON B.db_id = A.db_id
    Union of all the
    Select A.aname, null db_id, A.dc_id
    null aBBB, B.accc
    Since DC B right outer join da A
    ON B.dc_id = A.dc_id

    I get results like:
    ANAME DB_ID ABBB ACCC DC_ID
    ---------- ---------- ---------- ---------- --------
    Apple 1 100
    Apples 1 B1test
    Apples 1 B2test
    Apples 100 C1test
    Apples 100 C2test
    Apples 100 C3test

    However, I want to be:
    ANAME DB_ID ABBB ACCC DC_ID
    ---------- ---------- ---------- ---------- --------
    C1test of B1test of 1 100 apples
    C2test of B2test of 1 100 apples
    Apple 1 100 C3test

    Suggestions?

    TIA.
    Steve42

    Actually looking at your results once again, that don't necessarily look as a problem of sorting.

    What is your version of Oracle?

    Can you explain why these lines are your expected results? For example if I have run the following query I see these results:

    SQL> SELECT  DA.ANAME
      2  ,       DA.DB_ID
      3  ,       DA.DC_ID
      4  ,       DB.ABBB
      5  ,       DC.ACCC
      6  FROM    DA
      7  JOIN    DB      ON DA.DB_ID = DB.DB_ID
      8  JOIN    DC      ON DC.DC_ID = DA.DC_ID
      9  ORDER BY 1, 2, 3, 4, 5
     10  /
    
    ANAME                     DB_ID                DC_ID ABBB       ACCC
    ---------- -------------------- -------------------- ---------- ----------
    Apples                        1                  100 B1test     C1test
    Apples                        1                  100 B1test     C2test
    Apples                        1                  100 B1test     C3test
    Apples                        1                  100 B2test     C1test
    Apples                        1                  100 B2test     C2test
    Apples                        1                  100 B2test     C3test
    

    Yet in your results, you have your lines collapsed as B1TEST and C1TEST are in the SAME ROW, but B2TEST is not in the same line as C1TEST or C3TEST. Why?

    Is that what you are looking for?

    SQL> SELECT  DA.ANAME
      2  ,       DA.DB_ID
      3  ,       DA.DC_ID
      4  ,       DB.ABBB
      5  ,       DC.ACCC
      6  FROM    DA
      7  JOIN    DC              ON DC.DC_ID = DA.DC_ID
      8  LEFT OUTER JOIN    DB   ON DA.DB_ID = DB.DB_ID AND SUBSTR(DB.ABBB,2,1) = SUBSTR(DC.ACCC,2,1)
      9  ORDER BY 1, 2, 3, 4, 5
     10  /
    
    ANAME                     DB_ID                DC_ID ABBB       ACCC
    ---------- -------------------- -------------------- ---------- ----------
    Apples                        1                  100 B1test     C1test
    Apples                        1                  100 B2test     C2test
    Apples                        1                  100            C3test
    

    Published by: Centinul on January 15, 2010 11:01

  • Favorites gets duplicated, rearranged, deleted, moved, or all the above after each cold start PC.

    Since the 26/08/12 in the bookmarks to a folder and subfolders either disappeared, were reorganized in other folders or "Unsorted Bookmarks", duplicate, 'old' old records of Netscape appeared in more recent cases of Mozilla, the bookmarks and folders were duplicated, but bookmarks in them were either older of the last (see Netscape) or have been removed or foregoing. The last folder of Netscape (version 8) and the Mozilla one have reversed positions, (the latter used as superior to Netscape one). This happens after each cold start PC. After several attempts of troubleshooting, it happens now in all folders. I save the bookmarks in a folder in My Documents separated as regular backups that seem to all be corrupted in the same way. I even purge the SYNCHRONIZED data and who has done nothing to solve this problem. I deleted the old bookmarks for Netscape 6/7 and the problem persists. Removal of duplicates is worse. Maintenance of places add worked only 2 consecutive days; Therefore, it is more effective. I have to restore the backup that I did whenever I use Fire Fox after a cold start.

    Have you checked all the backups JSON (10) in the folder bookmarkbackups to see if there are still no corrupted bookmarks?

    If all of your bookmark backups are damaged, you must first repair in a pure and uncorrupted places.sqlite file or try to do that via a tag HTML the backup is an appropriate HTML editor.

    If corruption always occurs after the computer starts and some security software is the most likely cause for this.

    You have not answered what firewall and antivirus that you use.

    Some security software has virtualization or sandbox features that can cause problems to protect and restore files in the Firefox profile folder.

Maybe you are looking for