Add a "virtual" column

Hi,
I have an application that list the content of a table.
Actually, when I access to the application, the system show me something like :
COLUMN_1 ; COLUMN_2
A1 ; A2
B1 ; B2
I want add a third column to this application, the third column need to contain a like build with the content of COLUMN_1. For example :
COLUMN_1 ; COLUMN_2 ; COLUMN_3
A1 ; A2 ; x1
B1 ; B2 ; x2
Where x1 an x2 are a picture (or something else) and a link.
For example, I want that the system open a browser with something like http://exeternal_site.com/f?N=x1 if I select x1 and http://exeternal_site.com/f?N=xé if I select x2
Actually, I already have a link on COLUMN_1.
Can you help me ?
Thanks,
Edited by: villegente on 16 mai 2013 15:50

Hi Villegente,
You can do that in you your query.
select a1  as COLUMN_1
     , a2  as COLUMN_2
     , '<a href="http://exeternal_site.com/f?N='||x1||'">LINK</a>' as COLUMN_3
from table_xset at the Column Attributes for column_3 the attribute Display as to Standard Report Column.
Regards,
Kees Vlek
Company: http://www.orcado.nl
Blog: http://www.orcado.nl/blog/blogger/listings/69-kvlek
Twitter: http://www.twitter.com/skier66
If the question is answered please change it to answered and mark the appropriate post as correct/helpfull.

Similar Messages

  • How can I add a new column in compress partition table.

    I have a compress partition table when I add a new column in that table it give me an error "ORA-22856: CANNOT ADD COLUMNS TO OBJECT TABLES". I had cretaed a table in this clause. How can I add a new column in compress partition table.
    CREATE TABLE Employee
    Empno Number,
    Tr_Date Date
    COMPRESS PARTITION BY RANGE (Tr_Date)
    PARTITION FIRST Values LESS THAN (To_Date('01-JUL-2006','DD-MON-YYYY')),
    PARTITION JUNK Values LESS THAN (MAXVALUE));
    Note :
    When I create table with this clause it will allow me to add a column.
    CREATE TABLE Employee
    Empno Number,
    Tr_Date Date
    PARTITION BY RANGE (Tr_Date)
    PARTITION FIRST Values LESS THAN (To_Date('01-JUL-2006','DD-MON-YYYY')),
    PARTITION JUNK Values LESS THAN (MAXVALUE));
    But for this I have to drop and recreate the table and I dont want this becaue my table is in online state i cannot take a risk. Please give me best solution.

    Hi Fahed,
    I guess, you are using Oracle 9i Database Release 9.2.0.2 and the Table which you need to alter is in OLTP environment where data is usually inserted using regular inserts. As a result, these tables generally do not get much benefit from using table compression. Table compression works best on read-only tables that are loaded once but read many times. Tables used in data warehousing applications, for example, are great candidates for table compression.
    Reference : http://www.oracle.com/technology/oramag/oracle/04-mar/o24tech_data.html
    Topic : When to Use Table Compression
    Bug
    Reference : http://dba.ipbhost.com/lofiversion/index.php/t147.html
    BUG:<2421054>
    Affects: RDBMS (9-A0)
    NB: FIXED
    Abstract: ENH: Allow ALTER TABLE to ADD/DROP columns for tables using COMPRESS feature
    Details:
    This is an enhancement to allow "ALTER TABLE" to ADD/DROP
    columns for tables using the COMPRESS feature.
    In 9i errors are reported for ADD/DROP but the text may
    be misleading:
    eg:
    ADD column fails with "ORA-22856: cannot add columns to object tables"
    DROP column fails with "ORA-12996: cannot drop system-generated virtual column"
    Note that a table which was previously marked as compress which has
    now been altered to NOCOMPRESS also signals such errors as the
    underlying table could still contain COMPRESS format datablocks.
    As of 10i ADD/SET UNUSED is allowed provided the ADD has no default value.
    Best Regards,
    Muhammad Waseem Haroon
    [email protected]

  • How to delete a virtual column in a table

    Is it possible to delete a virtual column in a table. Please give the complete syntax to help do it

    Like this...
    SQL> select * from dept;
        DEPTNO DNAME          LOC
            10 ACCOUNTING     NEW YORK
            20 RESEARCH       DALLAS
            30 SALES          CHICAGO
            40 OPERATIONS     BOSTON
    SQL> alter table dept add (sal as (deptno*10));
    Table altered.
    SQL> select * from dept;
        DEPTNO DNAME          LOC                  SAL
            10 ACCOUNTING     NEW YORK             100
            20 RESEARCH       DALLAS               200
            30 SALES          CHICAGO              300
            40 OPERATIONS     BOSTON               400
    SQL> alter table dept drop (sal);
    Table altered.
    SQL> select * from dept;
        DEPTNO DNAME          LOC
            10 ACCOUNTING     NEW YORK
            20 RESEARCH       DALLAS
            30 SALES          CHICAGO
            40 OPERATIONS     BOSTON

  • Adding virtual column: ORA-12899: value too large for column

    I'm using Oracle 11g, Win7 OS, SQL Developer
    I'm trying to add virtual column to my test table, but getting ORA-12899: value too large for column error. Below are the details.
    Can someone help me in this?
    CREATE TABLE test_reg_exp
    (col1 VARCHAR2(100));
    INSERT INTO test_reg_exp (col1) VALUES ('ABCD_EFGH');
    INSERT INTO test_reg_exp (col1) VALUES ('ABCDE_ABC');
    INSERT INTO test_reg_exp (col1) VALUES ('WXYZ_ABCD');
    INSERT INTO test_reg_exp (col1) VALUES ('ABCDE_PQRS');
    INSERT INTO test_reg_exp (col1) VALUES ('ABCD_WXYZ');
    ALTER TABLE test_reg_exp
    ADD (col2 VARCHAR2(100) GENERATED ALWAYS AS (REGEXP_REPLACE (col1, '^ABCD[A-Z]*_')));
    SQL Error: ORA-12899: value too large for column "COL2" (actual: 100, maximum: 400)
    12899. 00000 -  "value too large for column %s (actual: %s, maximum: %s)"
    *Cause:    An attempt was made to insert or update a column with a value
               which is too wide for the width of the destination column.
               The name of the column is given, along with the actual width
               of the value, and the maximum allowed width of the column.
               Note that widths are reported in characters if character length
               semantics are in effect for the column, otherwise widths are
               reported in bytes.
    *Action:   Examine the SQL statement for correctness.  Check source
               and destination column data types.
               Either make the destination column wider, or use a subset
               of the source column (i.e. use substring).When I try to select, I'm getting correct results:
    SELECT col1, (REGEXP_REPLACE (col1, '^ABCD[A-Z]*_'))
    FROM test_reg_exp;Thanks.

    Yes RP, it working if you give col2 size >=400.
    @Northwest - Could you please test the same w/o having a regex clause in col2?
    I doubt on the usage of a REGEX in this dynamic col case.
    Refer this (might help) -- http://www.oracle-base.com/articles/11g/virtual-columns-11gr1.php
    Below snippet from above link.... see if this helps...
    >
    Notes and restrictions on virtual columns include:
    Indexes defined against virtual columns are equivalent to function-based indexes.
    Virtual columns can be referenced in the WHERE clause of updates and deletes, but they cannot be manipulated by DML.
    Tables containing virtual columns can still be eligible for result caching.
    Functions in expressions must be deterministic at the time of table creation, but can subsequently be recompiled and made non-deterministic without invalidating the virtual column. In such cases the following steps must be taken after the function is recompiled:
    Constraint on the virtual column must be disabled and re-enabled.
    Indexes on the virtual column must be rebuilt.
    Materialized views that access the virtual column must be fully refreshed.
    The result cache must be flushed if cached queries have accessed the virtual column.
    Table statistics must be regathered.
    Virtual columns are not supported for index-organized, external, object, cluster, or temporary tables.
    The expression used in the virtual column definition has the following restrictions:
    It cannot refer to another virtual column by name.
    It can only refer to columns defined in the same table.
    If it refers to a deterministic user-defined function, it cannot be used as a partitioning key column.
    The output of the expression must be a scalar value. It cannot return an Oracle supplied datatype, a user-defined type, or LOB or LONG RAW.
    >
    Edited by: ranit B on Oct 16, 2012 11:48 PM
    Edited by: ranit B on Oct 16, 2012 11:54 PM

  • Virtual column based partitioning

    Hi,
    we have a non-partitioned table in a production database and wish to partition it based on an expression. Since we are on 11.2 the first thing that comes to mind is virtual column based partitioning. The "problem" is that in order to partition by a virtual column, you have to create one, and adding a new column to a table could break any application that doesn't reference the existing columns by name, e.g. "SELECT *" or. "INSERT INTO table VALUES(....)".
    My question is: is it possible to somehow specify the expression on which to partition directly in the "partition by" clause rather than specifying it as a virtual column definition?
    Example:
    Instead of this..
    SQL> create table test (
      2    id             number not null,
      3    content        varchar2(10),
      4    record_type    varchar2(1) generated always as (case when (substr(content, 1, 1)='B' and not substr(content, 1, 3)='Bxy') then 'B' else 'A' end) virtual
      5  )
      6  partition by list(record_type)
      7  (
      8    partition partA values ('A'),
      9    partition partB values ('B')
    10  );
    Table created...I'd like to use something like this:
    SQL> create table test (
      2    id             number not null,
      3    content        varchar2(10)
      4  )
      5  partition by list((case when (substr(content, 1, 1)='B' and not substr(content, 1, 3)='Bxy') then 'B' else 'A' end))
      6  (
      7    partition partA values ('A'),
      8    partition partB values ('B')
      9  );
    partition by list((case when (substr(content, 1, 1)='B' and not substr(content, 1, 3)='Bxy') then 'B' else 'A' end))
    ERROR at line 5:
    ORA-00904: : invalid identifierThank you in advance for any answers.
    Regards,
    Jure

    adding a new column to a table could break any application that doesn't reference the existing columns by name, e.g. "SELECT *" or. "INSERT INTO table VALUES(....)". "Ok, i got it. You mean, in application you are using select * from yourtable; and those data is being used by a datagrid or any control, then where that application will show / handle the new column data right ?
    Yes, thats why DBA and developers do SDLC (Software Development Life Cycle); that our table will be looks like this, these will be columns, these will be their data types, these will be followed in naming convention, privileges, indexes, storage parameters, constraints, dependent objects etc. Now after creating the table, you found a need to add a column, it means there was some lapses happened at the design time/phase or business requirements are newly defined.
    So, as far as concerned of select * ... ; you have to change in the application by :
    select col1, col2, new_col from your table... (as per order of your datagrid control columns). There is no other solution, you have to change in application code at every place where you have used select * and if those statements are being merged / deals into a control)
    New column addition will hamper only at select * from... not with any INSERT/UPDATE/DELETE, because if they are running fine it means, they have well written column references. For DMLs you need not worry so far.
    By the way, what is your technology for application ? I have worked on couple of applications in ASP.NET with using datagrid which auto add/removes the columns in itself as per cursor result (not rememberring the exact property of it though)
    Regards
    Girish Sharma

  • ORA-00939 when creating XML table with Virtual Columns

    Getting error on creating table with VIRTUAL COLUMNS:
    Error at Command Line:4 Column:31
    Error report:
    SQL Error: ORA-00939: too many arguments for function
    00939. 00000 - "too many arguments for function"
    Without VIRTUAL COLUMNS works fine.
    Where to start?
    Is it possible to add Virtual Columns after a table is created?
    CREATE TABLE TDS_XML OF XMLType
    XMLSCHEMA "http://xmlns.abc.com/tds/TDSSchemaGen2.xsd"
    ELEMENT "TDSTestData"
      VIRTUAL COLUMNS
      TESTID AS (
        XMLCast(
                  XMLQuery('declare default element namespace "http://xmlns.abc.com/tds/TDSSchemaGen2.xsd"; /TDSTestData/TestID' PASSING OBJECT_VALUE RETURNING CONTENT)  AS VARCHAR2(32)
       )SQL*Plus: Release 11.2.0.2.0 Production on Mon Apr 30 20:17:29 2012
    Copyright (c) 1982, 2010, Oracle. All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE 11.2.0.2.0 Production
    TNS for 64-bit Windows: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    SQL>

    victor_shostak wrote:
    Figured, Virtual Columns work only for Binary XML.They are only supported, currently, for Binary XML.

  • Problem with creating virtual column

    Hello,
    We've got problem with creating virtual column.
    There is table R_T that contain columns R_ID and L_ID, we would like to create virtual column RL_ID that contains sth like 'R_ID-L_ID' (R_ID, L_ID and RL_ID are varchars).
    According documentation we've tried:
    alter table R_T add column (RL_ID varchar2(60) generated always as (R_ID||'-'||L_ID) VIRTUAL)
    but getting
    ORA-00904: : invalid identifier
    00904.00000 - "%s: invalid identifier"
    Have no idea where is the problem.
    Table, columns names are little different but contains only capital letters A - Z and underscore "_".
    Has anyone idea?
    Thanks a lot.

    Strange...
    This does work for me :
    Connected to Oracle Database 11g Enterprise Edition Release 11.2.0.1.0
    Connected as dev
    SQL>
    SQL> create table r_t (
      2   r_id varchar2(25),
      3   l_id varchar2(25)
      4  );
    Table created
    SQL> insert into r_t (r_id, l_id) values('R','L');
    1 row inserted
    SQL> alter table r_t add (rl_id varchar2(60) generated always as (r_id||'-'||l_id) virtual);
    Table altered
    SQL> select * from r_t;
    R_ID                      L_ID                      RL_ID
    R                         L                         R-L
    SQL>

  • Virtual column in the result set of the query.

    Hi folks,
    I have table , let it be, EMP. It has columns ENAME,EMPNO,JOB etc.,
    My requirement is to add an extra column, not present in the table, having NULL value at the time of diplaying the results of a query. I hope you got it. So a column that does not exists in the table should get displayed in the resultant set when we query the results from that table. so my question is, how to write the SELECT statement using that virtual column.
    I'd thought of using X column in Dummy table but what if I don't have any dummy table in my particular schema.
    Please do revert back with the solution.
    Your effort'll be genuinely appreciated.
    Cheers
    PCZ

    Hi,
    If you just wany display null values you can write query like this :
    SELECT ENAME,EMPNO,JOB , NULL DUMMY_COLUMN FROM emp;
    Regrads
    Avinash

  • Want to use analytical function as a Virtual column

    I am wondering if I can use an analytic function as a virtual column to a table?
    The table conatins a field named BUSINESS_RUN_DATE, which becomes the EXPIRY_DATE of the on the previous record. So we want to add this value right into the table without resorting t a view.
    This is what I tried to add the column to the table:
    alter table stg_xref_test_virtual
    ADD (expiry_date2 date generated always AS (max (business_run_date) over
    *(PARTITION BY ntrl_src_sys_key order by business_run_date*
    rows between 1 preceding and 1 following))) ;
    It give me an error that GROUP BY is not allowed.
    Can someone help out>?
    Thanks,
    Ian

    From the documentation.
    [Column Expressions|http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/expressions005.htm#BABIGHHI]
    A column expression, which is designated as column_expr in subsequent syntax diagrams, is a limited form of expr. A column expression can be a simple expression, compound expression, function expression, or expression list, but it can contain only the following forms of expression:* Columns of the subject table — the table being created, altered, or indexed
    * Constants (strings or numbers)
    ** Deterministic functions — either SQL built-in functions or user-defined functions*
    No other expression forms described in this chapter are valid. In addition, compound expressions using the PRIOR keyword are not supported, nor are aggregate functions.
    You can use a column expression for these purposes:
    * To create a function-based index.
    * To explicitly or implicitly define a virtual column. When you define a virtual column, the defining column_expr must refer only to columns of the subject table that have already been defined, in the current statement or in a prior statement.
    The combined components of a column expression must be deterministic. That is, the same set of input values must return the same set of output values.

  • Add one more column

    select
                    nvl(appr.APPROVER_NAME, org.APPROVER_NAME) as APPROVER_NAME,
                    nvl(appr.APPROVER, org.APPROVER) as APPROVER,
                    nvl(appr.APPROVER_TYPE, org.APPROVER_TYPE) as APPROVER_TYPE,
                    nvl(appr.ASSIGNED_DATE, org.ASSIGNED_DATE) as ASSIGNED_DATE,
                    nvl(appr.APPROVAL_DATE, '-') as APPROVAL_DATE,
                    nvl(appr.STATE, org.STATE) as STATE,
                                    org.SEQ as numberoftimesmodified,
                    nvl(appr.PROCESS, org.PROCESS) as PROCESS,
           -- appr.request_comment,
                    appr.seq2
                    from (
                        select a.seq,
                        b.usr_display_name as APPROVER_NAME,
                        b.usr_login as APPROVER,
                        'User' as APPROVER_TYPE,
                        '-' as ASSIGNED_DATE,
                        '-' as STATE,
                        a.seq as numberoftimesmodified,
                '-' as PROCESS
                        from(
                            SELECT 1 as seq, USR_UDF_MANAGER_LOGIN as GID, '' as approver_name, 'user' as approver_type FROM DEVT_OIM.USR WHERE USR_LOGIN =:BENEFICIARY_GID AND :APPLICATION = 'Oracle 11i On demand'
                            UNION
                            select rownum as seq, regexp_substr(:APPROVERPAYLOAD,'[^,]+', 1, level) as gid, '' as approver_name, 'user' as approver_type from dual
                            where :APPLICATION != 'Oracle 11i On demand'
                            connect by regexp_substr(:APPROVERPAYLOAD, '[^,]+', 1, level) is not null
                        ) a
                        inner join DEVT_OIM.usr b on a.gid = b.usr_login
                    ) org
                    left join(
                        select b.numberoftimesmodified as seq, rownum as seq2, a.*
                        from
                            select
                            LEAD(a.ASSIGNEES) OVER(ORDER BY a.numberoftimesmodified) as prev_gid,
                            LEAD(a.pushbacksequence) OVER(ORDER BY a.numberoftimesmodified) as prev_pushbacksequence,
                            a.ASSIGNEES as current_gid,
                            nvl(retrieveGidName(a.ASSIGNEES), '-') as APPROVER_NAME,
                            (DEVT_OIM.TOKNEW(REPLACE(a.ASSIGNEES, ',', ':'))) as APPROVER,
                            'User' as APPROVER_TYPE,
                            a.pushbacksequence,
                            TO_CHAR(a.assigneddate,'DD-Mon-YYYY HH:MI:SS AM') as ASSIGNED_DATE,
                            case when a.state = 'WITHDRAWN' then TO_CHAR(a.updateddate,'DD-Mon-YYYY HH:MI:SS AM') else TO_CHAR(d.updateddate,'DD-Mon-YYYY HH:MI:SS AM') end as APPROVAL_DATE,
                            a.numberoftimesmodified,
                            case when a.state = 'EXPIRED' then 'Expired' when a.approvalduration is null then 'Pending' when  a.outcome = 'REJECT' then 'Rejected' else 'Approved' end as PROCESS,
                            d.state as process2,
                            case when d.substate = 'REASSIGNED' then 'Reassigned' when d.state = 'INFO_REQUESTED' then 'Request Info' when a.state = 'EXPIRED' then 'Expired'
                                when  a.outcome = 'REJECT' then 'Rejected' when d.substate = 'INFO_SUBMITTED' then 'Submitted' when a.state = 'WITHDRAWN' then 'Withdrawn' when e.state is null then 'Pending' else 'Approved' end as state,
                            e.ASSIGNEES, d.substate
                            from DEVT_SOAINFRA.WFTASKHISTORY a
                            left join DEVT_SOAINFRA.WFTASKHISTORY d on d.IDENTIFICATIONKEY = a.IDENTIFICATIONKEY and d.numberoftimesmodified = (a.numberoftimesmodified+1)
                            left join DEVT_SOAINFRA.WFTASKHISTORY e on e.IDENTIFICATIONKEY = a.IDENTIFICATIONKEY and e.numberoftimesmodified = (a.numberoftimesmodified-1) and e.ASSIGNEES = a.ASSIGNEES
                            where a.IDENTIFICATIONKEY = :IDENTIFICATIONKEY and a.state is not null
                            order by a.numberoftimesmodified
                        ) a
                        inner join (select rownum as numberoftimesmodified, pushbacksequence from (select distinct pushbacksequence from DEVT_SOAINFRA.WFTASKHISTORY a where a.IDENTIFICATIONKEY = :IDENTIFICATIONKEY order by pushbacksequence)) b
                        on b.pushbacksequence = a.pushbacksequence
                        where a.prev_gid != a.current_gid or prev_gid is null
                        order by a.numberoftimesmodified
                    ) appr on org.seq = appr.seq
                union
                select
                    nvl(appr.APPROVER_NAME, org.APPROVER_NAME) as APPROVER_NAME,
                    nvl(appr.APPROVER, org.APPROVER) as APPROVER,
                    nvl(appr.APPROVER_TYPE, org.APPROVER_TYPE) as APPROVER_TYPE,
                    nvl(appr.ASSIGNED_DATE, '-') as ASSIGNED_DATE,
                    nvl(appr.APPROVAL_DATE, '-') as APPROVAL_DATE,
                    nvl(appr.STATE, '-') as STATE,
                                       999 as numberoftimesmodified,
                    nvl(appr.PROCESS, '-') as PROCESS,
                    999 as seq2
                    from(
                        select 999 as seq, '-' as APPROVER, ugp_name as APPROVER_NAME, 'group' as approver_type
                        from DEVT_OIM.UGP ugp
                        where  ugp_name in (
                        SELECT a.it_processor_group FROM ec_admin.ENTITLEMENT a
                            inner join ec_admin.application b on a.application_id = b.application_id
                            WHERE b.extra_field_2 = :APPLICATION
                            and a.module_name = :MODULE
                            and a.site_name = :SITE
                            and a.entitlement_name = DEVT_OIM.TOKNEW(:RESPONSIBILITY)
                            and b.auto_provisioning = 'FALSE')
                    ) org
                    left join(
                    select nvl(grp.APPROVER_NAME, usr.APPROVER_NAME) as APPROVER_NAME,
                    nvl(grp.APPROVER, usr.APPROVER) as APPROVER,
                    nvl(grp.APPROVER_TYPE, usr.APPROVER_TYPE) as APPROVER_TYPE,
                    TO_CHAR((select min(OSI_create) from DEVT_OIM.OSI where request_key = :IDENTIFICATIONKEY),'DD-Mon-YYYY HH:MI:SS AM') as ASSIGNED_DATE,
                    nvl(grp.APPROVAL_DATE, usr.APPROVAL_DATE) as APPROVAL_DATE,
                    'ASSIGNED' as STATE,
                    999 as numberoftimesmodified,
                    case when nvl(grp.APPROVAL_DATE, usr.APPROVAL_DATE) = '-' then 'Pending' else usr.ost_status end as PROCESS
                    from
                        select b.usr_display_name as APPROVER_NAME, b.usr_login as APPROVER,  'User' as APPROVER_TYPE,
                        TO_CHAR(a.OSI_create,'DD-Mon-YYYY HH:MI:SS AM') as APPROVAL_DATE, 'key' as tbl_key,
                        (select ost_status from DEVT_OIM.UPA_RESOURCE where UPA_RESOURCE_key in (
                                  select max(UPA_RESOURCE_key)
                                  from DEVT_OIM.UPA_RESOURCE a
                                  inner join DEVT_OIM.oiu b on a.oiu_key = b.oiu_key
                                  where b.request_key = :IDENTIFICATIONKEY )) as ost_status
                        from (
                          select osi_assigned_to_usr_key, OSI_create
                          from DEVT_OIM.OSI
                          where request_key = :IDENTIFICATIONKEY and osi_assigned_to_usr_key != 1
                          order by OSI_create desc
                        ) a
                        inner join DEVT_OIM.usr b on a.osi_assigned_to_usr_key = b.usr_key
                        where rownum between 0 and 1
                    ) usr
                    left join
                        select ugp.ugp_name as APPROVER_NAME, '-' as APPROVER, 'Group' as APPROVER_TYPE,
                        '-' as APPROVAL_DATE, 'key' as tbl_key
                        FROM DEVT_OIM.OTI itp
                        inner join DEVT_OIM.UGP ugp on ugp.ugp_key = itp.osi_assigned_to_ugp_key
                        where itp.request_key = :IDENTIFICATIONKEY
                        and :REQUEST_STATUS != 'Request Completed'
                    ) grp
                    on usr.tbl_key = grp.tbl_key
                    order by numberoftimesmodified
                    ) appr on 1=1
                order by numberoftimesmodified, seq2
                   Above is the script and i need to add one more column for the script column name request_comment from the table request_comments, anyone help me in doing so.

    /* Formatted on 2012/06/14 13:19 (Formatter Plus v4.8.8) */
    SELECT X.*, request_comments.request_comment
    FROM(
    SELECT   NVL (appr.approver_name, org.approver_name) AS approver_name, NVL (appr.approver, org.approver) AS approver,
             NVL (appr.approver_type, org.approver_type) AS approver_type, NVL (appr.assigned_date, org.assigned_date) AS assigned_date,
             NVL (appr.approval_date, '-') AS approval_date, NVL (appr.state, org.state) AS state, org.seq AS numberoftimesmodified,
             NVL (appr.process, org.process) AS process,
                                                        -- appr.request_comment,
                                                        appr.seq2
        FROM (SELECT a.seq, b.usr_display_name AS approver_name, b.usr_login AS approver, 'User' AS approver_type, '-' AS assigned_date,
                     '-' AS state, a.seq AS numberoftimesmodified, '-' AS process
                FROM (SELECT 1 AS seq, usr_udf_manager_login AS gid, '' AS approver_name, 'user' AS approver_type
                        FROM devt_oim.usr
                       WHERE usr_login = :beneficiary_gid AND :application = 'Oracle 11i On demand'
                      UNION
                      SELECT     ROWNUM AS seq, REGEXP_SUBSTR (:approverpayload, '[^,]+', 1, LEVEL) AS gid, '' AS approver_name,
                                 'user' AS approver_type
                            FROM DUAL
                           WHERE :application != 'Oracle 11i On demand'
                      CONNECT BY REGEXP_SUBSTR (:approverpayload, '[^,]+', 1, LEVEL) IS NOT NULL) a
                     INNER JOIN
                     devt_oim.usr b ON a.gid = b.usr_login
                     ) org
             LEFT JOIN
             (SELECT   b.numberoftimesmodified AS seq, ROWNUM AS seq2, a.*
                  FROM (SELECT   LEAD (a.assignees) OVER (ORDER BY a.numberoftimesmodified) AS prev_gid,
                                 LEAD (a.pushbacksequence) OVER (ORDER BY a.numberoftimesmodified) AS prev_pushbacksequence,
                                 a.assignees AS current_gid, NVL (retrievegidname (a.assignees), '-') AS approver_name,
                                 (devt_oim.toknew (REPLACE (a.assignees, ',', ':'))) AS approver, 'User' AS approver_type,
                                 a.pushbacksequence, TO_CHAR (a.assigneddate, 'DD-Mon-YYYY HH:MI:SS AM') AS assigned_date,
                                 CASE
                                   WHEN a.state = 'WITHDRAWN'
                                     THEN TO_CHAR (a.updateddate, 'DD-Mon-YYYY HH:MI:SS AM')
                                   ELSE TO_CHAR (d.updateddate, 'DD-Mon-YYYY HH:MI:SS AM')
                                 END AS approval_date,
                                 a.numberoftimesmodified,
                                 CASE
                                   WHEN a.state = 'EXPIRED'
                                     THEN 'Expired'
                                   WHEN a.approvalduration IS NULL
                                     THEN 'Pending'
                                   WHEN a.outcome = 'REJECT'
                                     THEN 'Rejected'
                                   ELSE 'Approved'
                                 END AS process,
                                 d.state AS process2,
                                 CASE
                                   WHEN d.substate = 'REASSIGNED'
                                     THEN 'Reassigned'
                                   WHEN d.state = 'INFO_REQUESTED'
                                     THEN 'Request Info'
                                   WHEN a.state = 'EXPIRED'
                                     THEN 'Expired'
                                   WHEN a.outcome = 'REJECT'
                                     THEN 'Rejected'
                                   WHEN d.substate = 'INFO_SUBMITTED'
                                     THEN 'Submitted'
                                   WHEN a.state = 'WITHDRAWN'
                                     THEN 'Withdrawn'
                                   WHEN e.state IS NULL
                                     THEN 'Pending'
                                   ELSE 'Approved'
                                 END AS state,
                                 e.assignees, d.substate
                            FROM devt_soainfra.wftaskhistory a LEFT JOIN devt_soainfra.wftaskhistory d
                                 ON d.identificationkey = a.identificationkey AND d.numberoftimesmodified = (a.numberoftimesmodified + 1)
                                 LEFT JOIN devt_soainfra.wftaskhistory e
                                 ON e.identificationkey = a.identificationkey
                               AND e.numberoftimesmodified = (a.numberoftimesmodified - 1)
                               AND e.assignees = a.assignees
                           WHERE a.identificationkey = :identificationkey AND a.state IS NOT NULL
                        ORDER BY a.numberoftimesmodified) a
                       INNER JOIN
                       (SELECT ROWNUM AS numberoftimesmodified, pushbacksequence
                          FROM (SELECT DISTINCT pushbacksequence
                                           FROM devt_soainfra.wftaskhistory a
                                          WHERE a.identificationkey = :identificationkey
                                       ORDER BY pushbacksequence)) b ON b.pushbacksequence = a.pushbacksequence
                 WHERE a.prev_gid != a.current_gid OR prev_gid IS NULL
              ORDER BY a.numberoftimesmodified) appr ON org.seq = appr.seq
    UNION
    SELECT   NVL (appr.approver_name, org.approver_name) AS approver_name, NVL (appr.approver, org.approver) AS approver,
             NVL (appr.approver_type, org.approver_type) AS approver_type, NVL (appr.assigned_date, '-') AS assigned_date,
             NVL (appr.approval_date, '-') AS approval_date, NVL (appr.state, '-') AS state, 999 AS numberoftimesmodified,
             NVL (appr.process, '-') AS process, 999 AS seq2
        FROM (SELECT 999 AS seq, '-' AS approver, ugp_name AS approver_name, 'group' AS approver_type
                FROM devt_oim.ugp ugp
               WHERE ugp_name IN (
                       SELECT a.it_processor_group
                         FROM ec_admin.entitlement a INNER JOIN ec_admin.application b ON a.application_id = b.application_id
                        WHERE b.extra_field_2 = :application
                          AND a.module_name = :module
                          AND a.site_name = :site
                          AND a.entitlement_name = devt_oim.toknew (:responsibility)
                          AND b.auto_provisioning = 'FALSE')) org
             LEFT JOIN
             (SELECT   NVL (grp.approver_name, usr.approver_name) AS approver_name, NVL (grp.approver, usr.approver) AS approver,
                       NVL (grp.approver_type, usr.approver_type) AS approver_type,
                       TO_CHAR ((SELECT MIN (osi_create)
                                   FROM devt_oim.osi
                                  WHERE request_key = :identificationkey), 'DD-Mon-YYYY HH:MI:SS AM') AS assigned_date,
                       NVL (grp.approval_date, usr.approval_date) AS approval_date, 'ASSIGNED' AS state, 999 AS numberoftimesmodified,
                       CASE
                         WHEN NVL (grp.approval_date, usr.approval_date) = '-'
                           THEN 'Pending'
                         ELSE usr.ost_status
                       END AS process
                  FROM (SELECT b.usr_display_name AS approver_name, b.usr_login AS approver, 'User' AS approver_type,
                               TO_CHAR (a.osi_create, 'DD-Mon-YYYY HH:MI:SS AM') AS approval_date, 'key' AS tbl_key,
                               (SELECT ost_status
                                  FROM devt_oim.upa_resource
                                 WHERE upa_resource_key IN (SELECT MAX (upa_resource_key)
                                                              FROM devt_oim.upa_resource a INNER JOIN devt_oim.oiu b
                                                                   ON a.oiu_key = b.oiu_key
                                                             WHERE b.request_key = :identificationkey)) AS ost_status
                          FROM (SELECT   osi_assigned_to_usr_key, osi_create
                                    FROM devt_oim.osi
                                   WHERE request_key = :identificationkey AND osi_assigned_to_usr_key != 1
                                ORDER BY osi_create DESC) a
                               INNER JOIN
                               devt_oim.usr b ON a.osi_assigned_to_usr_key = b.usr_key
                         WHERE ROWNUM BETWEEN 0 AND 1) usr
                       LEFT JOIN
                       (SELECT ugp.ugp_name AS approver_name, '-' AS approver, 'Group' AS approver_type, '-' AS approval_date,
                               'key' AS tbl_key
                          FROM devt_oim.oti itp INNER JOIN devt_oim.ugp ugp ON ugp.ugp_key = itp.osi_assigned_to_ugp_key
                         WHERE itp.request_key = :identificationkey AND :request_status != 'Request Completed') grp
                       ON usr.tbl_key = grp.tbl_key
              ORDER BY numberoftimesmodified) appr ON 1 = 1
    ORDER BY numberoftimesmodified, seq2
    ) X, request_comments
    WHERE...

  • How To Add a new column for ZPR0 price in open sales order report ??

    HI,
    my requirement is To Add a new column for ZPR0 price in open sales order report if the order/scheduling agreement is a cross-company code transaction l(company code of order/scheduling agreement <> company code of delivering plant), price = ZPR0 price as at estimated GI date

    k

  • To Add a new column for ZPR0 prce in open sales order report

    HI,
    my requirement is To Add a new column for ZPR0 prce in open sales order report if the order/scheduling agreement is a cross-company code transaction l(company code of order/scheduling agreement <> company code of delivering plant), price = ZPR0 price as at estimated GI date

    HI,
    my requirement is To Add a new column for ZPR0 prce in open sales order report if the order/scheduling agreement is a cross-company code transaction l(company code of order/scheduling agreement <> company code of delivering plant), price = ZPR0 price as at estimated GI date

  • Add a Link Column in WAD Report

    Dear All.
    my requirement is to show the link column as a first or last column of the table, user want that if he click the link the outlook should open with the email taking from the vendor.
    All i want to add a new column and place the following (<mailto:vendorattribute?subject=xyz>).
    Can you please let me know how can i achive this in WAD application through Java script or any other way how can i read the value of vendor attribute.
    any help will be highly appreciatable.

    Gurus,
    Any advice?

  • How to add a new column (Project Number) in the action items table under NPD Module?

    There are two projects with same name and created by same person in NPD.
    So when it is displayed in "Action Items" table, It looks similar.
    To avoid this, I need one more column (Project Number) to be added in the "Action Items" table and " Strategic briefs and projects" table.
    So, How to add a new column (Project Number) in the "Action Items" table and " Strategic briefs and projects" table under NPD Module?
    Please do the needful.

    There is no out of the box configuration available to add columns to NPD action items.   As always we welcome enhancement requests. 
    Thanks
    Kelly

  • 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

Maybe you are looking for

  • Vast numbers of undeletable voice memos on iphone?

    I have no less than 3388 voice memos, including huge numbers of duplicates and occupying 9.6 Gb, that are visible via iTunes on my iPhone4 but do not appear in iTunes on my mac. There seems to be absolutely no way to delete this pile of useless rubbi

  • Check box in flex

    I have a check box and a label related with it which I want to appear when the user checks the check box.... <mx:Label  x="10" y="76" text="Information" fontWeight="bold" fontSize="11"/> <mx:Label x="366" y="76" text="Record - New/Existing" fontWeigh

  • Peripheral for external Iomega Zip MAC 100 & Mac Book Pro

    I would like to download files from an external Iomega Zip Mac 100 but the peripheral is not compatible with my MacBook Pro 13".  What do I need to get in order to do this, and will I also need to download a driver for the Mac to see it? Thank you.

  • Te:Texts in abap hr

    Hello, can anyone please tell me how to get texts for job and position of an employee in abap hr. Thanks. Ramya.

  • Printing questions

    Okay, i have printed several things from the internet and mydocs, etc.  Now, i am trying to print a coupon and i had to download their software to print it, which i did.  so i print and i get the msg that their program doesn't support one of my print