Put a dummy column in a view

Hi,
How to add a dummy column like 'Status' and all its value as "Closed" in a view. This column
is not related to any table.

See example below. Hope this is what you want.
SQL> select * from tst_table;
        ID DEP        DET
        10 XXX        A
        10 XXX        B
        20 YYY        C
        10 ZZZ        D
SQL> create or replace view my_view as
  2  select id,dep,det,(select 'Closed' from dual) Status from tst_table;
View created
SQL> desc my_view;
Name   Type         Nullable Default Comments
ID     NUMBER       Y                        
DEP    VARCHAR2(10) Y                        
DET    VARCHAR2(25) Y                        
STATUS CHAR(6)      Y                        
SQL> select * from my_view;
        ID DEP        DET                       STATUS
        10 XXX        A                         Closed
        10 XXX        B                         Closed
        20 YYY        C                         Closed
        10 ZZZ        D                         Closed
SQL>

Similar Messages

  • Put a Client column in the UWL

    Hi,
    I'm looking for a way of putting a client column in the UWL, that gets the client for each Work Item (task).
    Previously I've had succes with getting BOR attributes, however now I need the client for the current task.
        <ItemType name="uwl.task.webflow.TS00999999.SAPxxx.xxxxx_xxx" connector="WebFlowConnector" defaultView="some_View" defaultAction="launchWebDynPro" executionMode="default">
          <ItemTypeCriteria systemId="xxxxx_xxx" externalType="TS00999999" connector="WebFlowConnector"/>
          <CustomAttributes>
            <CustomAttributeSource id="ABAP_BOR" objectIdHolder="externalObjectId" objectType="BUSxxxx" cacheValidity="default">
              <Attribute name="CURRENCY" type="string" displayName="Currency"/>
            </CustomAttributeSource>
    BR
    Lasse

    See example below. Hope this is what you want.
    SQL> select * from tst_table;
            ID DEP        DET
            10 XXX        A
            10 XXX        B
            20 YYY        C
            10 ZZZ        D
    SQL> create or replace view my_view as
      2  select id,dep,det,(select 'Closed' from dual) Status from tst_table;
    View created
    SQL> desc my_view;
    Name   Type         Nullable Default Comments
    ID     NUMBER       Y                        
    DEP    VARCHAR2(10) Y                        
    DET    VARCHAR2(25) Y                        
    STATUS CHAR(6)      Y                        
    SQL> select * from my_view;
            ID DEP        DET                       STATUS
            10 XXX        A                         Closed
            10 XXX        B                         Closed
            20 YYY        C                         Closed
            10 ZZZ        D                         Closed
    SQL>

  • Custom column in List view

    Dear guru's,
    I'd like to ask you if its possible to add custom column in list view. For example in tc. FBL1N I'd like to add a column with custom text (for example with value "1" for counting the sum of rows). Is it possible to do without creating custom program?
    Thank you all.
    Regards.
    Michael.

    Hi Michael,
    It's not possible to add some extra text in standard out-put without modifying it or creating custom program.
    For adding a column in your list view. I think this write statement will help you
    WRITE 'You can overwrite the following line:'.
    FORMAT INPUT ON INTENSIFIED OFF.
    WRITE 'WRITE HERE'.
    FORMAT INPUT OFF INTENSIFIED ON.

  • Common Label for two columns in pivot view??

    Hi Guys,
    PLs help me..
    i want common label or heading columns in pivot view..
    Example:
    Under label1 (i should have two columns like 'A','B'), under label2(shud have colums like 'C','D','E')..
    i tried with dummy column, i placed it in measures section..but its not worked)..

    Hi Bhargav,
    f you are using 11g, goto Pivot Table Properties->Display Column & Folder Headings option.
    In 10g try this, http://obiee1000.blogspot.in/2012/03/header-on-measures.html
    Regards,
    Dpka

  • Problem with binding value on the UI  from a calculated column in the view

    I have calculated field "Readiness" in my db view, which gets calculated based on other columns in the same table. I have added new column to my EO using "Add from table" option and added the same column from to VO using "Add from EO" option. In my application, I will update a particular date field in the UI and this calculated column "Readiness" in the db will be set to yes or no and this logic is working fine, both date date field and calculated field are in same view object. I have added a attribute binding to this "Readiness" column in my view page. The problem is the calculated column value does not reflect the new value in the db, it shows the old value. I have tried different refresh option for the iterator and ppr option for the field binding. Even after reloading the page, the value shown on the UI page is different from the value in db, other bindings on the UI page works fine, not sure any special settings are required for the Calculated columns. any ideas are appreciated.
    Thanks for your help,
    Surya

    I tried to add soms debugging statements in the EO and getters method, the calcaulated column is not picking the value in db view. I'm not any special iterator/field settings are required at BC level. I'm a newbie, any help is appreciated.
    Thanks,
    Surya

  • How to cast a column of a derived column in a view to NULL

    I have a derived column in my view and this column by default is picked up as not null.
    I want to cast it to null how can i do it ?
    Actual column
    column1 varchar(3) not null
    Expected column
    column1 varchar(3)  null
    Mudassar

    Shridar I  havent defined it but the derived column has been picked up as not null which is strange
    CREATE VIEW test
    AS
    SELECT 
    CASE
    WHEN COMPANY_SIZE IS NULL then  'a'
    ELSE 'b' 
    END AS
    column1 ----- added derived column identifier
    ,[Company_Size] AS [CompanySize]
    FROM xyz
    Mudassar

  • Column definition for a specific column in a view

    Is there a way to query the metadata to get the definition of a single column in a view? I can see the complete DDL for a view from USER_VIEWS.TEXT, and I can see the column listing in USER_TAB_COLUMNS to give the datatype etc. However, what I'm looking for is the DDL that defined a specific column.
    So, given:
    create table PERSON (
    SSN VARCHAR2(12),
    FIRST_NAME VARCHAR2(25),
    LAST_NAME VARCHAR2(25),
    STREET VARCHAR2(40),
    CITY VARCHAR2(30),
    STATE VARCHAR2(30),
    ZIP VARCHAR2(15),
    COUNTRY VARCHAR2(35))
    create view PERSON_VW as
    select SSN,
    FIRST_NAME,
    LAST_NAME,
    FIRST_NAME || ' ' || LAST_NAME FULL_NAME
    from PERSON
    I expect the query might look something like:
    select DDL from metadata where table_name = 'PERSON_VW' and column_name = 'FULL_NAME'
    and the result would be: "PERSON.FIRST_NAME || ' ' || PERSON.LAST_NAME"
    or select DDL from metadata where table_name = 'PERSON_VW' and column_name = 'FIRST_NAME'
    and the result would be: "PERSON.FIRST_NAME"
    Thanks!

    >
    Hi again Barry,
    When I queried user_tab_columns (or dba_tab_columns or all_tab_columns), I have the following list of columns:
    TABLE_NAME
    COLUMN_NAME
    DATA_TYPE
    DATA_LENGTH
    DATA_PRECISION
    DATA_SCALE
    NULLABLE
    COLUMN_ID
    DEFAULT_LENGTH
    DATA_DEFAULT
    I don't see anything resembling the DDL for the view column. Somewhere underneath some
    cover I haven't peeked under, Oracle must be keeping track of what it is supposed to be giving
    for, in my example, FULL_NAME.Unless I'm very much mistaken, these columns' data (per table) looks pretty much like DDL to me.
    Maybe what you need is just SQL Developer (great tool, if you don't have it, get it!).
    And it's free (as in beer - not as in speech! :( )
    Beside the connections tab is a "Reports" tab with various, as you might expect ;), reports.
    One of them is on the Tables - with (some) DDL. This will work as a once-off if that's what
    you need?
    Otherwise there's the SQL tab if you open a table under connections - it's very complete - sample
    at bottom of post.
    HTH,
    Paul...
    (Ultimately, I'm diagnosing problems in existing databases that have views already created so
    I don't have the option of considering virtual columns.)Quelle surprise ;(
    Paul...
    -Barry
    CREATE TABLE "HR"."COUNTRIES"
        "COUNTRY_ID"   CHAR(2 BYTE) CONSTRAINT "COUNTRY_ID_NN" NOT NULL ENABLE,
        "COUNTRY_NAME" VARCHAR2(40 BYTE),
        "REGION_ID"    NUMBER,
        CONSTRAINT "COUNTRY_C_ID_PK" PRIMARY KEY ("COUNTRY_ID") ENABLE,
        CONSTRAINT "COUNTR_REG_FK" FOREIGN KEY ("REGION_ID") REFERENCES "HR"."REGIONS" ("REGION_ID") ENABLE
      ORGANIZATION INDEX NOCOMPRESS PCTFREE 10 INITRANS 2 MAXTRANS 255 LOGGING STORAGE
        INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
      TABLESPACE "USERS" PCTTHRESHOLD 50;
    COMMENT ON COLUMN "HR"."COUNTRIES"."COUNTRY_ID"
    IS
      'Primary key of countries table.';
      COMMENT ON COLUMN "HR"."COUNTRIES"."COUNTRY_NAME"
    IS
      'Country name';
      COMMENT ON COLUMN "HR"."COUNTRIES"."REGION_ID"
    IS
      'Region ID for the country. Foreign key to region_id column in the departments table.';
      COMMENT ON TABLE "HR"."COUNTRIES"
    IS
      'country table. Contains 25 rows. References with locations table.';

  • How can I add a new column to Grid view under Tests tab

    I understand in "ORACLE Test manager for web Applications", the Grid view under Tests tab should be customised.
    How can I add a new column to Grid view under Tests tab? Thanks Katherine

    I don't think this is possible.
    Regards,
    Jamie

  • Times missing in left column in week view

    I am using iCal 2.0.3 and the hour times to not show in the left column in week view. Noon is present, but no others. There have been a few occasions that times have shown up, but then the next time they are gone. I set up a new user and went into iCal and the dates show. All my prefs are the same in my account and the "new user".
    I am suspecting that there is corrupted prefs file of some sort, but I am reluctant to just delete files without knowing which one. Since I installed 10.4 a few months ago, I have found a lot of settings changed that upgrades should have kept intact in preferences.
    Any suggestions?

    no responses
    posting again

  • Hide a column in one view, but show in other

    Hi all.
    I need to hide a column on "Table" view, but column needs to show up on "Pivot table".
    I know we can hide it on pivot ( exclude It ) and show on table, but I want to know if reverse is possible.
    This is needed because I am doing a view selector for writeback. And I dont want to display all the columns on writeback table view. But it needs to be there on Pivot table.
    Please let me know if it is possible.
    Thanks.
    Vinay

    Yes we can do that.
    Check on the "Hide" in the column format tab of the column that you need to display in the table lay out.
    Now dupliate the same view and in the pivot table column intially you will not see the column displayed.
    Now in the properties check on "hidden" in the "format headings" and you wont see it still and now uncheck the"hidden" and you shoud be able to see the column displayed in the pivot view
    In this way you will have the column hidden in the table view and displayed in the pivot table.
    Hope it helps
    Prash

  • How to create  index for a column of a view

    Hi,
    I have created view for a table and then i am trying to create index for a column of that view. i am using the query "CREATE INDEX index_name ON view_name (col)". but Mysql is showing error like "view_name is not a base table".
    How can i do that......

    As mentioned this is a java forum not a mysql forum, but as I know the answer - you can't create an index directly on a view in mysql.

  • REP-1425 report formula DO_SQL error putting value into column

    Hi all
    I have opened a report 2.5 in Oracle9i Reports Developer and, it converted ok. However, when I run the report (paper layout), the message
    rep-1425 report formula DO_SQL error putting value
    into column. Column may not be referenced by parameter
    triggers
    appears. There are several report level formula columns and corresponding placeholder columns that are the cause of this error. The formula has the following :
    SRW.DO_SQL('SELECT RPAD(''DAILY TABLE AUDIT REPORT'',60,''.'')||TO_CHAR(SYSDATE,''DD-MON-YYYY'') INTO :REPORT_TIT FROM DUAL');
    COMMIT;
    RETURN('');
    I can't work out what this error message really means as the column, report_tit is a placeholder column and, the formula column is not a parameter trigger!! The report_tit placeholder is used as a source for a layout field. I noticed that the layout field is defined as a placeholder column in the converted report but in the reports 2.5 version, it is defined as a layout field.
    I can do a work around by replacing the SRW.DO_SQL statement with a normal PL/SQL SELECT statement. However, I wonder if anyone else has had the same problem and, if anyone can help provide an answer as to what this error really means and, also, how I can retain the SRW.DO_SQL statement and/or an alternative work around to the one that I have described.
    Thanks.
    Therese Hughes
    Forest Products Commision

    Hi again
    The firewall proved to be the problem after all! The firewall set in Reports config-files is not used for WebServices, it has to be set within the stub:
    Properties prop = System.getProperties();
    prop.put("http.proxyHost","yourProxyServer");
    prop.put("http.proxyPort","youProxyServerPort");
    I inserted this in my java-code and after some problems (see below), restarting Report Builder turned the trick, the report works now.
    Cheers
    Tino
    Here there mail I set up before I found that restarting Report Builder helped:
    Thanks for your answer, putting in the proxy-settings actually helped some - the same error message is
    popping up, but instantly and not after 10 seconds like before:
    My proxy lines look like this, I also tried "http://proxy.ch.oracle.com", but "proxy.ch.oracle.com" proved to
    be the correct syntax:
    public Float getRate(String country1, String country2) throws Exception
    Float returnVal = null;
    Properties prop = System.getProperties();
    prop.put("http.proxyHost","proxy.ch.oracle.com");
    prop.put("http.proxyPort","8080");
    URL endpointURL = new URL(endpoint);
    Call call = new Call();
    I tested the new proxy-entries by disabling the proxy preference in JDeveloper, so I could verify the added
    proxy-lines in the code work - they do. If I change the proxy to some incorrect value like
    "proxyy.ch.oracle.com", they fail.
    After unsuccessfully trying recompile and re-import of Java classes, I rebuild the report from scratch and
    stumbled over the same problem. Now the question is, whether I'm still doing something wrong with the
    proxy or whether there is another problem after passing the firewall....
    -------------------------------------------------------------------------------------------------------------

  • Finding source database table/column name for a column in a view

    Hi i need to be able to identify the original database table/column name for a column in a view.
    e.g. say i have a view like this
    create v1 as select a.name fname, b.name bname, c.name cname,......
    from u1.names a, u2.names b. u3.names c
    where .....
    Now I want to find out that the database table/column name for the fname, bname and cname columns in the view v1, which in this instance is u1.name.name, u2.names.name, u3.names.name.
    But i need to be able to do it for any view. Short of parsing the SQL is there an easy way of doing this?
    Now obviusly I can't do this for virtual columns but I will know my column is not virtual as it has an index on it.

    But i need to be able to do it for any view. Short of
    parsing the SQL is there an easy way of doing this?No, parsing the SQL is the only way. Good luck it is not something I would want to attempt.

  • How to increase the the max limit column in pivot view in BIEE 11G?

    Hi Experts,
    How to increase the the max limit column in pivot view in BIEE 11G?
    When the number of column exceed 256 in pivot view, it will generate the following error message as below:
    Exceeded configured maximum number of allowed output prompts, sections, rows, or columns.
    Error Details
    Error Codes: IRVLJWTA:OI2DL65P
    Location: saw.httpserver.processrequest, saw.rpc.server.responder, saw.rpc.server, saw.rpc.server.handleConnection, saw.rpc.server.dispatch, saw.threadpool.socketrpcserver, saw.threads
    SQL Issued: 13678~vid1ptgt0v5ubh39gesnauuhl6
    For example:
    ----------------Day
    Country-----20120101---20120102---..........20121231
    China--------10000---------20000----......

    Try increasing the Max Rows in Instanceconfig.xml
    Path:-Middleware\instances\instance1\bifoundation\OracleBIPresentationServices\instanceconfig.xml
    <ServerInstance>
    <Views>
    <Pivot>
    <MaxVisibleColumns>300</MaxVisibleColumns>
    <MaxVisiblePages>1000</MaxVisiblePages>
    <MaxVisibleRows>500</MaxVisibleRows>
    <MaxVisibleSections>25</MaxVisibleSections>
    <DefaultRowsDisplayed>30</DefaultRowsDisplayed>
    </Pivot>
    </Views>
    </ServerInstance>
    Try adding this in the config file and restart the services.
    Mark as correct if it is helpful.
    Thanks.

  • How to add new columns in materialized view

    We are using Oracle 10g Release2.
    We need to add new columns to a prebuilt fast refresh materialized view. We want to add 4 new columns in this table and make them part of select statement in the materialized view. We can drop the view but we cannot do complete refresh after that because the paymentsInfo table has a creation_timestamp column which is populated by before row insert trigger with systimestamp. If we did the complete refresh, all values in this column shall be changed.
    CREATE MATERIALIZED VIEW  paymentsInfo
    ON PREBUILT TABLE
    REFRESH FAST
      ON DEMAND
      START WITH SYSDATE
      NEXT SYSDATE+5/1440
      WITH PRIMARY KEY
    DISABLE QUERY REWRITE AS
    SELECT PAYMENT_ID,BATCH_REFERENCE, TRANSACTION_REFERENCE, NO_OF_TRANSACTIONS, DEBIT_ACC_NUM,... from payment@dblink
    I want to know is there any other way to add new columns without losing any changes from the master table.
    Thanks.

    There is no way to add new Columns to Materialized view. To add new columns, it has to be dropped and re-built again.
    Extract from Oracle Documentaion:
    Use the ALTER MATERIALIZED VIEW statement to modify an existing materialized view in one or more of the following ways:
      To change its storage characteristics
      To change its refresh method, mode, or time
      To alter its structure so that it is a different type of materialized view
      To enable or disable query rewrite
    If you have a problem of Complete refresh, then It may be beneficial to get the backup of the MView; Drop and re-create it with modified definition; Restore the backup data leaving the new columns untouched (assuming they are to be kept as fetched from the Master site).

Maybe you are looking for

  • X1 and x4 give same displacement

    Hey All, I realize now that this issue should go in this discussion board.  Instead of repeating, just follow this link: http://forums.ni.com/ni/board/message?board.id=250&message.id=32994&jump=true Thanks, -Andrew

  • How can I move files from FileAppPro to open in Adobe ?

    How can I move files in FileAppPro to Adobe to open?

  • Can anuone help me on persistence API problem please?

    I would like someone to explain me why when using persistence API sometime i can insert data in database normally but later when i have added more functionalities like ajax, and file upload i can insert data in database using persistence API. for ins

  • Permissions/Ownership issue? [Solved]

    Running KDE 3.5.8, I can open Konqueror, and click any text or openOffice fileand open it. Everything pretty much works as expected. If I open File Manager - Superuser Mode, and try to open these same files, it fails with errors like <KDEInit could n

  • Sms service from website

    Hi friends,i have developed website for credit card transaction,if the transaction was successful i need to show the transaction to the client by sending sms to him.I dont knw how to do that,,,?can anyone here tell me in which technology i need to us