DB two types in the same column

Hello

I have a column in an interactive report that displays a digit or a varchar2 (string) according to another column.

What I want here is when it displays the string while it is, but when you display a number, then it sholud be justified right and 3 digits after that comma should be presented (7,000 or 7.123...). To display the number I am converting it to a char using to_char. If I didn't ' t make an error comes out.

Is it possible to get what I want somehow?

Please suggest.
Thank you.

Assuming that the maximum width of the column is known and is used a fixed-width font, I tend to choose an alignment and then add (or add) a number appropriate spaces for the string, or numeric values (in office, of course, on the alignment you chose).

Justin

Tags: Database

Similar Questions

  • Two guests on the same column

    Hi Experts,

    I'm defining two different guests (and associate them with the two variables of different presentation) on the same column. However, when I view the 2 guests on the same dashboard page, whenever I select a value for the first prompt, the same value is automatically selected for the second line.

    Is this a normal behavior? How to capture the two distinct values?

    Thank you
    Guillaume

    Hi William,.

    I think I forgot something.

    You must do the following steps:

    (1) add the column to the dashboard command prompt.
    (2) in the column "Show" change the option to 'results '.
    (3) in the column "Column" change the formula of the column to a name like «filter 1"»
    (4) this column value to the variable in the presentation, such as FILTER1.
    (5) change the label for the column.
    (6) assign the filter in your report to the presentation FILTER1 variable.

    Repeat step 1 to 6 for the second filter.

    Kind regards
    Stijn

  • apex5 pre-release - url filter applies to the two IRs with the same column name

    I've implemented 2 interactive reports on the same page, one on EMP (static id Throne) and the other on DEPT (deptir static id). Both the DEPTNO column. If I create the following filter via the URL: IR [throne] EQ_DEPTNO:20, the filter is applied to the two interactive reports.

    Screenshot from 2015-03-29 08:30:33.png

    Hello

    Please let us know. It has the same root cause as your other reported problem. It's bug #20764255, which has already been identified and corrected on our development environment. A fix will be released in our production release.

    Concerning

    Patrick

    Member of the APEX development team

    My Blog: http://www.inside-oracle-apex.com

    APEX Plug-Ins: http://apex.oracle.com/plugins

    Twitter: http://www.twitter.com/patrickwolf

  • How to exchange the two values in the same column by using the UPDATE?

    Hi all

    I have a table named TEST, and it has a column called A.

    and has values as follows:

    A
    ------
    10
    20
    30
    40
    50

    My question is how to move '10' instead of '20' and '20' instead of '10' in the column? This permutation is only for the first two values (10, 20)

    Note: Must be only in SQL, not in PLSQL.

    Any advice?

    Thanks in advance?

    Update
    test
    the value a = decode(a,10,20,20,10,a);

    Alexander gelin
    http://nimishgarg.blogspot.com/

  • subtracting the two rows in the same column

    Hello
    I have the following table with about 6000 lines of different year_month, but I compare and subtract v
    Contribution of the Organization Year_month
    Kano 200000 JAN-2011
    KADUNA 300000 JAN-2011
    ABUJA 400000 JAN-2011
    Kano 300000 FEB-2011
    KADUNA 200000 FEB-2011
    ABUJA 600000 FEB 2012
    I want to choose a year_month runtime to subtract the contribution of the first contribution of the second year_month year_month and give me the result, as shown in the following table
    Difference of JAN - FEB 2011 - 2011 organization
    Kano 200000 300000-100000
    300000 200000 100000 KADUNA
    ABUJA 400000 200000 600000
    Here is my code back will too

    create or replace function "GET_MONTHLY_VALUE".
    (q_name in VARCHAR2,
    hmoCode in VARCHAR2)
    return VARCHAR2
    is
    number of C1;
    Start
    Select NHIS_CONTRIBUTION in c1 of CONTRIBUTION_MGT where upper (YEAR_MONTH) = upper (q_name) and upper (ORGANIZATION) = upper (hmoCode);

    return to c1;
    exception when NO_DATA_FOUND THEN
    Returns a null value.
    end;

    -a call to the function above:

    create or replace function process_cont_monthly return varchar

    is
    Cursor cont_cursor is select ORGANIZATION of CONTRIBUTION_MGT;
    Start
    for
    cont_rec loop cont_cursor
    First, select GET_MONTHLY_VALUE(:p26_month,cont_rec.ORGANIZATION) GET_MONTHLY_VALUE(:p26_month2,cont_rec.ORGANIZATION) second,
    ABS (GET_MONTHLY_VALUE (:p26_month,cont_rec.ORGANIZATION)-GET_MONTHLY_VALUE(:p26_month2,cont_rec.ORGANIZATION)) difference
    of CONTRIBUTION_MGT;

    end loop;
    commit;
    end;
    I got totally confused and do not know what to do next
    Any help and the best guide is appreciated

    Analytics can also be used (assuming that you store dates as dates, ORDER BY working properly)

    create table t(org varchar2(10),mon date, cont number);
    insert into t(org,mon,cont) values ('Kano',to_date('201101','YYYYMM'),200000);
    insert into t(org,mon,cont) values ('KADUNA',to_date('201101','YYYYMM'),300000);
    insert into t(org,mon,cont) values ('Kano',to_date('201102','YYYYMM'),300000);
    insert into t(org,mon,cont) values ('KADUNA',to_date('201102','YYYYMM'),200000);
    commit;
    
    select * from t;
    ORG        MON                    CONT
    ---------- ---------------------- ----
    Kano       01-JAN-2011 00:00:00   200000
    KADUNA     01-JAN-2011 00:00:00   300000
    Kano       01-FEB-2011 00:00:00   300000
    KADUNA     01-FEB-2011 00:00:00   200000 
    
    select org,cont1 start_month,cont2 end_month,cont1-cont2 difference
      from (
            select org,mon,cont cont1,
                   lead(cont) over (partition by org order by mon) as cont2
            from t
            where  mon in (to_date('201101','YYYYMM'),to_date('201102','YYYYMM'))
            )
    where cont2 is not null;
    
    ORG        START_MONTH END_MONTH DIFFERENCE
    ---------- ----------- --------- ----------
    KADUNA          300000    200000     100000
    Kano            200000    300000    -100000 
    
  • A target table is in charge of two different sources but the same columns, but a source is one database and another in a flat file.

    We all hope you are doing well.

    I have a business problem to implement in ODI 11 G. It's here. I'm trying to load a target table from two sources that have the same column names. But a source is to the file format and the other is in the Oracle database.

    That's what I think I'll create two mappings in the same interface by using the Union between the sources. But I don't know how the interface would connect to different logical architecture to connect to two different sources.

    Thank you

    SM

    You are on the right track, all in a single interface. Follow these steps

    (1) pull model of your data in the designer of the source file and your table model target to the target pane.

    (2) all relevant columns map

    (3) in the source designer to create a new dataset and choose as the UNION join type (this will create a separate tab in the source designer pane)

    (4) select the new dataset tab in the source designer pane and pull your source oracle table data model in the designer of the source. All columns that are relevant to the target card

    (5) make sure that your staging location is set to a relational technology i.e. in this case the target would be an ideal candidate because it is where the ODI will organize the data from source two files and oracle and perform the UNION before loading to the target

    If you want to watch some pretty screenshots showing the steps above, take a look at http://odiexperts.com/11g-oracle-data-integrator-part-611g-union-minus-intersect/

  • Two or more SRID in the same column?

    Hello, I am working with Oracle Spatial, and I have a problem with the SRID.

    I have a column in a table with the SDO_GEOMETRY type and I need to create a Spatial Index to use. But to create a Spatial Index first, I need to insert metadata into the table incluied SRID: for example

    Insert in user_sdo_geom_metadata (table_name, column_name, srid, diminfo) values ('Spatial_Test', 'GEOMETRIA', 8307, SDO_DIM_ARRAY (SDO_DIM_ELEMENT('LONGITUDE',-180,180,0.5), SDO_DIM_ELEMENT ('LATITUDE',-90, 90, 0.5)));

    But I need to work with more than one SRID in this column. Is there anyway to have two or more SRID in the same column? How? and if I insert them, can they give any problem?

    Thank you very much.

    Good bye.

    ZeyKa,

    . . . . You can transform and store all your geometries in SRID 8307 and then turn to their original SRID when you SELECT them.

    -- "Example: Transform geometry from  to SRID 8307 for storage"
    -- "NOTE: Replace  and  with your values"
    INSERT INTO MyTable (ID, geometry,RenderSRID) VALUES (1, SDO_CS.TRANSFORM(,8307), );
    
    -- "Example: Transform stored geometry back to its "
    SELECT SDO_CS.TRANSFORM(geometry,RenderSRID) FROM MyTable WHERE ID = 1;
    

    Kind regards
    Noel

  • Open program of the two facades of the same type of v.i

    I would like to know if it is possible to open by program of the two facades of the the same type of v.i, but with activity on a front panel without impact on the activity on the other side... for example, the way that you would open two windows of a chrome for example of browser.. .thank you

    Want to open two instances of the same VI?  It's simple.  Just do the reentrant VI.

  • Two objects with the same name

    Hi all

    In my production database, there is a materialized view and a table with the same name. The two objects have the same number and type of columns.

    Record from user_object table

    OBJECT_NAMESUBOBJECT_NAMEOBJECT_IDDATA_OBJECT_IDOBJECT_TYPECREATEDLAST_DDL_TIMETIMESTAMPSTATUSTEMPORARYGENERATEDSECONDARYNAMESPACEEDITION_NAME
    TEST_OBJ151373151373TABLE22/06/201222/06/20122012-06 - 22:15:39:30VALIDNNN1
    TEST_OBJ152287MATERIALIZED VIEW22/06/201208/03/20122012-06 - 22:16:08:46VALIDNNN19

    I have another mode to normal display, TEST_NORMAL_VIEW, which selects the data of TEST_OBJ.

    Then, on which table data select. Please give some input on this subject.

    Kind regards

    Matondo

    A materialized view has 2 objects internally for her

    1. the materialized view (it is more of a model)

    2. the table that stores the actual data.

    So when you create a materialized view, you can see 2 objects created by querying the USER_OBJECTS.

    See this

    SQL> create materialized view my_test_mv as select * from emp;
    
    Materialized view created.
    
    SQL> select object_type, object_name, data_object_id from user_objects where object_name = 'MY_TEST_MV';
    
    OBJECT_TYPE        OBJECT_NAME          DATA_OBJECT_ID
    ------------------- -------------------- --------------
    TABLE              MY_TEST_MV                  1638964
    MATERIALIZED VIEW  MY_TEST_MV
    

    Now, you may notice that DATA_OBJECT_ID has null for the MV. DATA_OBJECT_ID is the Segment where the data is stored. As MV object is just a model and does not have data to null.

    The user has no direct access to the MY_TEST_MV table. See this

    SQL> drop table my_test_mv;
    drop table my_test_mv
               *
    ERROR at line 1:
    ORA-12083: must use DROP MATERIALIZED VIEW to drop "KARTHICK"."MY_TEST_MV"
    

    Also, you can associate an existing table to a materialized using the clause ON TABLE PREDEFINED view.

    Here is an example

    SQL> drop materialized view my_test_mv;
    
    Materialized view dropped.
    
    SQL> create table my_test_mv_new as select * from emp;
    
    Table created.
    
    SQL> select object_type, object_name, data_object_id from user_objects where object_name = 'MY_TEST_MV_NEW';
    
    OBJECT_TYPE         OBJECT_NAME          DATA_OBJECT_ID
    ------------------- -------------------- --------------
    TABLE               MY_TEST_MV_NEW              1638967
    
    SQL> create materialized view my_test_mv_new on prebuilt table as select * from emp;
    
    Materialized view created.
    
    SQL> select object_type, object_name, data_object_id from user_objects where object_name = 'MY_TEST_MV_NEW';
    
    OBJECT_TYPE         OBJECT_NAME          DATA_OBJECT_ID
    ------------------- -------------------- --------------
    TABLE               MY_TEST_MV_NEW              1638967
    MATERIALIZED VIEW   MY_TEST_MV_NEW
    
    SQL>
    

    Once you associate a Table with a MV direct Table access is limited. You can directly access only the MV.

  • Creating records from two Tables at the same time...

    I would be very grateful if someone could help with the following query.

    I have two Tables, Tbl1 and Tbl2. Tbl1 has the following columns: -.

    Tbl1_Unique_ID, Description

    Tbl1_Unique_ID is of type ' * number *' and ' * PK * ', Description is of type' * Varchar2 *'.

    Tbl2 has the following columns: -.

    Tbl2_Unique_ID, Description, Tbl1_Unique_ID

    Tbl2_Unique_ID is of type ' * number *' and is the ' * PK * ', Description is of type' * Varchar2 *' and Tbl1_Unique_ID is of type ' * number *', is a ' * foreign key *' and is the ' * primary key *' from Tbl1.

    While I can create a page to display and create folders in Tbl1, I'm not course coding required to view and create records Tbl1 and Tbl2 simultaneously, as well as regarding the two together at the same time.

    I know that it involves one ' * INSERT *' statement, but I have problems the correct SQL query.

    Can anyone provide any assistance will be appreciated.

    Have you tried to create a form master / detail page? Because it seems that is what you need...

  • Audit in two stages on the same device? !

    After upgrading to Mac OS Sierra the next thing happened:

    When I tried to sign in the community Apple with my Macbook Pro, I had a request of two steps and was invited to enter the 6 digit code that 'someone was trying to use my Apple ID to a place near me'... about 300 Km.

    I agreed, but the strange thing is that I got the 6 digit code on my Mac, where I had to type.

    Very easy process, but what is the meaning of this if I get the same code that I have to type on the same device? !

    I was a believer to receive on my iPhone or by SMS.

    There is something strange about this event?

    This scene reproduced whenever I tried to connect to the Apple community, until I checked "remember this browser.

    Tnxs.

    I arrived as well. My guess is that your mac is the only device approved for now, so the only option for apple is to send the code.

    If you go to ibutt settings in system preferences and click on account details, you can see which devices are approved under the devices tab. For me, it says my iphone is not usable as a trusted device, and I did bother to see if I can change this again, but I guess it can be done somehow.

    Edit: I just stumbled upon a thread discussing the same thing and found this answer, that solved the problem for me: Re: why Apple showed the authentication code to two factors on the same device that I connect to?

  • an alphabet by typing in a cell gives drop down suggestions from previous hits on the same column. But how the drop down to choose the suggestions of the other columns and other sheets.

    an alphabet by typing in a cell gives drop down suggestions from previous hits on the same column. But how the drop down to choose the suggestions of the other columns and other sheets.

    Hi mdsavol,

    Your observations are accurate. The 'suggestions' are previous entries in the same column that correspond to what has been entered so far in the active cell. The only direct user control is to activate the function turn on or off in numbers preferences > general.

    There are other ways to include or exclude items of suggestions:

    • To remove typos in the suggestions list, the user must correct the typos in the cell above the active cell. If they are more in the list, they won't be presented as suggestions.
    • To include selections added to the list, the user must enter these suggestions in the individual cells above the active cell and column where they are wanted as suggestions.

    There was a request here a while there is a list of suggestion 'live' similar to those of some websites, which offers a descending list of possible entries as a type in an input box.

    The only way I see to reach a solution similar to what you have asked is to use as many lines at the top of the non-en-tete of the table section to list the items likely to repeat in your table, and then hide the lines. You'll need a list for each column where you want to use this feature with a list previously planted. Existing items will then require a likely hit up to three, then a click to choose from a list small enough to enter a value into a cell. News he will need to enter in full the first time, but after that it will be put on the list and answer the same thing as the terms preseeded.

    While your setting upward (or decide not to do), consider going on the menu of number (in numbers), choosing to provide feedback from numbers and writing a feature in Apple request. Describe what you want. Explain how he could help the average user numbers, and then hope for the best.

    Kind regards

    Barry

  • When you add pictures to the Vista image folder it creates a folder HIDDEN of the same name with two copies of the same image inside

    I use Vista 32 bit. I started to see this problem when I recently copy photos from an SD card.

    When you add pictures to the Vista image folder it creates a folder HIDDEN of the same name with two copies of the same image inside

    I saw hidden files enabled in folder options.

    Any help is appreciated.

    Hey guys... I found the answer... Problem is with the software vaio content analyzer that comes with the vaio...

    It just search for Vaio Content Analyzer (parameters) and deselect

    Video analysis
    image analysis
    analysis of the music

    I went looking for this crazy thing... used almost all types of online scan, and finally to find that it is caused by an internal software only...
    anyway thanks to all... Hope it helps someone in the future :)
  • Compare two rows in the same table

    Hi all

    I need to compare two rows in the same table, I don't know hoe to do it in pl/sql. Please help me on this.

    example:

    price of ro TR
    xya0001 AMA.7 12
    xya0003 ama6 14
    xya0004 AMA.7 16

    in table b is a unique value for each line, I need to compare the price column and see if the first value is less than or greater than the following value and, if there is more to put the corresponding value of br to a variable, and if it is less, put the corresponding value of the br to another variable. I don't know a method to do this, as I'm new to pl/sql. Please help me in this
    for data in(select tr,br,price, lag(price) over ( order by tr) newcol
    from yourtable)
    loop
    if nvl(data.newcol,0) > data.price then
    variable1:=data.br;
    else
    varable2:=data.br;
    end if;
    end loop;
    
  • Multiple values for the same column in the columns of diffétent in the same row?

    Hi all
    I wonder how you can display different values for the same column in different columns on the same line. For example, using a CASE statement, I can:

    CASE WHEN CODE IN ('1 ', ' 3') THEN COUNT (ID) AS 'Y '.
    CASE WHEN CODE NOT IN ('1 ', am') THEN COUNT (ID) AS "N".

    Yes, that will produce two columns but will produce null values to empty and also two separate registers.


    Any ideas?

    Thank you

    Are you sure that this code works for you?

    Select ID
             ,CASE WHEN MODE_CODE IN ('1', '3') THEN COUNT( No) END as "Fulltime"
             ,CASE WHEN MODE_CODE NOT IN ('1', '3') THEN COUNT( No ) END  as "Other"
    From table
    group by ID
    

    I guess the code above fails because MODE_CODE is not in your group by?

    My suggestion would be to put the CASE in the COUNT:

    Select ID
             ,COUNT(CASE WHEN MODE_CODE IN ('1', '3') THEN No END) as "Fulltime"
             ,COUNT(CASE WHEN MODE_CODE NOT IN ('1', '3') THEN No END)  as "Other"
    From table
    group by ID
    

    CASE expressions return no. when the respective conditions are true and NULL otherwise.
    COUNTY will have non-null values.

Maybe you are looking for