Inserting a LONG to a BLOB in the same table

I have a table with a LONG column and would like to concatenate all existing columns into a new column in the same table and define it as a BLOB. I'm trying to figure out a way to do this. I tried the following and got error message
insert into cma_search_test
select obj_id,
     line_id,
     doc_nmbr,
     supplier_part_num,
     mnfctr,
     mnfctr_part_nmbr,
     line_desc,
     ext_desc_txt,
     vend_name,
     cma_effect_dt,
     cma_expir_dt,
     last_updt_usr,
     last_updt_tmsp,
     obj_id||
     line_id||
     doc_nmbr||
     supplier_part_num||
     mnfctr||
     mnfctr_part_nmbr||
     line_desc||
     to_lob(ext_desc_txt)||
     vend_name||
     cma_effect_dt||
     cma_expir_dt||
     last_updt_usr||
     last_updt_tmsp "All_Columns"
from cma_search
to_lob(ext_desc_txt)||
ERROR at line 22:
ORA-00932: inconsistent datatypes
Any help would be appreciated.
Thanks,
Tracy

You cannot concatenate a LONG field. You will have to use a procedure to accomplish what you want.
Use the DBMS_LOB package.

Similar Messages

  • SQL Developer no longer letting me look at the same table name on 2 servers

    I used to be able to look at the same table (such as; "ATS_Reminders") on both my development box and my production box at the same time. Now when I connect to both databases, if I try to open the same table on the second box, the first table closes so I can't look at them side by side. Is there a way to fix this annoying behavior?
    I'm on Windows 7 running:
    Java(TM) Platform     1.6.0_11
    Oracle IDE     3.1.07.42
    Versioning Support     3.1.07.42

    Hi bucketofsquid -
    You need to pin the 1st editor. This can be done manually by clicking the freeze view button on the object viewer toolbar or automatically by setting auto freeze on in preferences. Tools->Preferences->Database->ObjectViewer->Automatically Freeze Object Viewer Windows
    Brian Jeffries
    SQL Developer Team

  • IOS 5 used to allow Airplay between iPad (WiFi) and Apple TV (Ethernet) as long as they were on the same network. In iOS 6, now both the iPad and the Apple TV have to be on the same network and both have to be connected using WiFi ? Why did they change ?

    iOS 5 used to allow Airplay between iPad (WiFi) and Apple TV (Ethernet) as long as they were on the same network, i.e. connected to the same wired/wireless router. In iOS 6, now both the iPad and the Apple TV have to be on the same network and both have to be connected using WiFi ? Why did they change this ? Means that the iPad and the Apple TV box both have to be in range of the wireless router when this wasn't a restriction before. Apple TV could be anywhere as long as it was connected to the same wireless router via ethernet cable. Seems like an unnecessary thing to restrict.

    I have found with AppleTV that it is the IPV6 on the computer you want to access is the problem.  The issue is that Homegroup on Win 7 or Win 8 requires IPV6 to work, but AppleTV won't work with IPV6.  (So maybe double check you have IPV6 turned off)
    So you have to make a choice - Homegroup or AppleTV.... but you can't have both, until Apple brings ATV up to date. (crazy that it does not recognise IPV6 - c'mon Apple!)
    You can set up sharing individually in Win 7 or 8 and have the ATV access files that way.
    Having said that, there is always the exception.. I have an old HP home server running Win8 and it services ATV - but is part of the Homegroup... have no idea why it works on both, but no other machine on the home network will talk to both ATV and Homegroup at the same time!

  • MULTIPLE UPDATES/INSERTIONS TO THE SAME TABLE

    How can I update/insert mutiple rows into the same table from one form ?

    Hi,
    Using the portal form on table you can insert only a single row. You can use master-detail form to insert multiple rows.
    Thanks,
    Sharmila

  • Parallel Insert statements (bulk) to the same table

    Hi,
    I am in need to insert set of insert statements 50000+ in to table and wanted to split them in to tow halves and run in two SQL worksheets.
    Note that both will try to insert on the same table.
    Please let me know whether it is advisable or tell me an alternative way.
    Using...Oracle 11g DB.
    Regards
    Deep.

    935195 wrote:
    I am in need to insert set of insert statements 50000+ in to table and wanted to split them in to tow halves and run in two SQL worksheets.Small number of rows. 50,000 rows can be inserted in seconds. Not sure why you want to split it. Parallel inserts into the same table is not usually a problem. Contention could be around free lists, initrans and so on - especially if using RAC and inserting something like 50,000+ rows every second. But the table defaults usually suffice.
    Note that both will try to insert on the same table.So what? This is exactly what Oracle expects and what it is designed to do.
    Please let me know whether it is advisable or tell me an alternative way.Well, you mentioned SQL worksheets - why? Exactly how does the INSERT statements look like? Where does the data to insert come from? Is shared insert cursors used (bind variables compulsory)? The bottleneck and problem could very well be on your side and not with the actual inserts into the table.

  • Multiple and conditions in the same table

    Ok I am going to kick myself for this, but I can't figure it out. I am trying to figure out how to find employees which match multiple criteria in the same table.
    create table emp
    (empno number,
    name  varchar2(10))
    create table skills
    (skill_id   number,
    skill_code varchar2(20))
    create table emp_skills
    (empno    number,
    skill_id number,
    rating   number)
    insert into emp values(1, 'SMITH');
    insert into emp values(2, 'JONES');
    insert into skills values (1, 'SQL');
    insert into skills values (2, 'PLSQL');
    insert into skills values (3, 'JAVA');
    insert into emp_skills values(1,1, 8);
    insert into emp_skills values(1,2, 9);
    insert into emp_skills values(1,3, 10);
    insert into emp_skills values(2,1,9);
    insert into emp_skills values(2,2,2);
    insert into emp_skills values(2,3,7);Now I need to come up with a query finding all employees who match all 3 of the following criteria:
    1) Have at least a 5 rating in SQL
    2) Have at least a 6 rating in PLSQL
    3) Have at least a 7 rating in JAVA
    So using this I would expect to return only SMITH since his/her skills meet all 3 criteria. I dont want to use OR in my query since I want all 3 to match not just one of them.
    I have a feeling I will need to self join the table - but this is going to be part of a dynamic query for APEX where the users can choose the skills and ratings they want employees to adhere to, so I dont know the number of criteria or the exact criteria in advance. But I figure if I can get a proof of concept SQL I can make it work dynamically.
    Any ideas are appreciated - sorry for the long post but I figure more detail is better

    with es1 as(
    select s.skill_code, es.empno, es.rating
    from skills s, emp_skills es
    where s.skill_id = es.skill_id
    /* main */
    select e.*
    from emp e
    where
    exists
    (select 'x' from es1
    where es1.rating >= 5
    and es1.skill_code = 'SQL'
    and es1.empno = e.empno)
    and
    exists
    (select 'x' from es1
    where es1.rating >= 6
    and es1.skill_code = 'PLSQL'
    and es1.empno = e.empno)
    and
    exists
    (select 'x' from es1
    where es1.rating >= 7
    and es1.skill_code = 'JAVA'
    and es1.empno = e.empno)
    -- Addition (Another example)
    with es1 as(
    select s.skill_code, es.empno, es.rating
    from skills s, emp_skills es
    where s.skill_id = es.skill_id
    /* main */
    select e.*
    from emp e
    where
    (select count(distinct es1.skill_code) from es1
    where
    ((es1.rating >= 5 and es1.skill_code = 'SQL')
    or
    (es1.rating >= 6 and es1.skill_code = 'PLSQL')
    or
    (es1.rating >= 7 and es1.skill_code = 'JAVA')
    and es1.empno = e.empno)
    =3;

  • Data of column datatype CLOB is moved to other columns of the same table

    Hi all,
    I have an issue with the tables having a CLOB datatype field.
    When executing a simple query on a table with a column of type CLOB it returns error [POL-2403] value too large for column.
    SQL> desc od_stock_nbcst_notes;
    Name Null? Type
    OD_STOCKID N NUMBER
    NBC_SERVICETYPE N VARCHAR(40)
    LANGUAGECODE N VARCHAR(8)
    AU_USERIDINS Y NUMBER
    INSERTDATE Y DATE
    AU_USERIDUPD Y NUMBER
    MODIFYDATE Y DATE
    VERSION Y SMALLINT(4)
    DBUSERINS Y VARCHAR(120)
    DBUSERUPD Y VARCHAR(120)
    TEXT Y CLOB(2000000000)
    NBC_PROVIDERCODE N VARCHAR(40)
    SQL> select * from od_stock_nbcst_notes;
    [POL-2403] value too large for column
    Checking deeply, some of the rows have got the data of the CLOB column moved in another column of the table.
    When doing select length(nbc_providercode) the length is bigger than the datatype of the field (varchar(40)).
    When doing substr(nbc_providercode,1,40) to see the content of the field, a portion of the Clob data is retrieved.
    SQL> select max(length(nbc_providercode)) from od_stock_nbcst_notes;
    MAX(LENGTH(NBC_PROVIDERCODE))
    162
    Choosing one random record, this is the stored information.
    SQL> select length(nbc_providerCode), text from od_stock_nbcst_notes where length(nbc_providerCode)=52;
    LENGTH(NBC_PROVIDERCODE) | TEXT
    -------------------------+-----------
    52 | poucos me
    SQL> select nbc_providerCode from od_stock_nbcst_notes where length(nbc_providerCode)=52;
    [POL-2403] value too large for column
    SQL> select substr(nbc_providercode,1,40) from od_stock_nbcst_notes where length(nbc_providercode)=52 ;
    SUBSTR(NBC_PROVIDERCODE
    Aproveite e deixe o seu carro no parque
    The content of the field is part of the content of the field text (datatype CLOB, containts an XML)!!!
    The right content of the field must be 'MTS' (retrieved from Central DB).
    The CLOB is being inserted into the Central DB, not into the Client ODB. Data is synchronized from CDB to ODB and the data is reaching the client in a wrong way.
    The issue can be recreated all the time in the same DB, but between different users the "corrupted" records are different.
    Any idea?

    939569 wrote:
    Hello,
    I am using Oracle 11.2, I would like to use SQL to update one column based on values of other rows at the same table. Here are the details:
    create table TB_test (myId number(4), crtTs date, updTs date);
    insert into tb_test(1, to_date('20110101', 'yyyymmdd'), null);
    insert into tb_test(1, to_date('20110201', 'yyyymmdd'), null);
    insert into tb_test(1, to_date('20110301', 'yyyymmdd'), null);
    insert into tb_test(2, to_date('20110901', 'yyyymmdd'), null);
    insert into tb_test(2, to_date('20110902', 'yyyymmdd'), null);
    After running the SQL, I would like have the following result:
    1, 20110101, 20110201
    1, 20110201, 20110301
    1, 20110301, null
    2, 20110901, 20110902
    2, 20110902, null
    Thanks for your suggestion.How do I ask a question on the forums?
    SQL and PL/SQL FAQ

  • How to have concurrent CSV upload and manual edit in APEX on the same table

    Hi there,
    my users want to have csv upload and manual edit on apex pages functions together...
    it means they want to insert the data by csv upload and also have interactive report and form on the same table...
    so if user A changes something in csv file...then user B update or delete another record from apex fronted (manually in the apex form)...then after that user A wants to upload the csv file,the record was changed by user B would be overwritten ...
    So how can I prevent it?????

    Hi Huzaifa,
    Thanks for the reply...
    I'm going to use File Browser so that end users can upload the files themselves...
    after editing data by users...a manger going to review it and in case of approval , i need to insert the data to one final table....
    so it needs much effort to check two source tables and in case of difference between table of csv and other one...what to do...

  • For the same table in the same page, how to use 2 different forms (simple and tabular)?

    Hello! How I can be on the same page with the same table insert and update operations using 2 different forms (single form and tabular form)
    I have little knowledge of Apex, but I know PLSQL
    Thanks
    Ginger
    Ecuador

    Thank you Gramps.  It took some time, but I've got it working now.  I had to re-do all the user authentication actions from scratch for one of the databases, but it's finally behaving itself now.  I appreciate you pointing me in the right direction.

  • Trigger to Update in the same table.

    Hi,
    I would like to create a trigger that when we insert into table ALL_CAPACITY_SNS_CELL1 it updates column Action on teh same table,if teher is an update, it will update the same table , column ACTION.
    This is what I have attempted but seems to be technically wrong.
    <pre>
    create table ALL_CAPACITY_SNS_CELL1
    ( A varchar2,
    action char(2),
    date_executed date);
    create or replace
    TRIGGER ALL_CAPACITY_HISTORY_TRACKING
    AFTER INSERT OR DELETE OR UPDATE ON ALL_CAPACITY_SNS_CELL1 FOR EACH ROW
    DECLARE
    v_operation VARCHAR2(10) := NULL;
    BEGIN
    IF INSERTING THEN
    v_operation := 'I';
    ELSIF UPDATING THEN
    v_operation := 'U';
    ELSE
    v_operation := 'D';
    END IF;
    IF INSERTING
    UPDATE ALL_CAPACITY_SNS_CELL1
    SET ACTION =v_operation,
    DATE_EXECUTED =sysdate ;
    ELSIF UPDATING THEN
    UPDATE ALL_CAPACITY_SNS_CELL1
    SET ACTION =v_operation,
    DATE_EXECUTED =sysdate ;
    END IF;
    END;
    </pre>

    CrackerJack wrote:
    But above query made all ACTION nul...so we shoudl after insert or update trigger right?Obviously it is not working. You modified my code the way it does not make sense.
    IF INSERTING
    THEN
    :NEW.ACTION := 'I';
    IF UPDATING
    THEN
    :NEW.ACTION := 'U';
    ELSE
    :NEW.ACTION := 'X';
    END IF;The code above checks if trigger fired on INSERT (IF INSERTING). In THEN branch of that IF you check if trigger fired on UPDATE. It makes no sense. Now, if you would use my trigger:
    SQL> create table ALL_CAPACITY_SNS_CELL1
      2  ( A varchar2(1),
      3  action char(2),
      4  date_executed date);
    Table created.
    SQL> create or replace
      2    TRIGGER ALL_CAPACITY_HISTORY_TRACKING
      3      BEFORE INSERT
      4         OR UPDATE
      5      ON ALL_CAPACITY_SNS_CELL1
      6      FOR EACH ROW
      7      BEGIN
      8          IF INSERTING
      9            THEN
    10              :NEW.ACTION := 'I';
    11            ELSE
    12              :NEW.ACTION := 'U';
    13          END IF;
    14          :NEW.DATE_EXECUTED := sysdate ;
    15  END;
    16  /
    Trigger created.
    SQL> insert into ALL_CAPACITY_SNS_CELL1(a) values('A')
      2  /
    1 row created.
    SQL> insert into ALL_CAPACITY_SNS_CELL1(a) values('B')
      2  /
    1 row created.
    SQL> alter session set nls_date_format='mm/dd/yyyy hh24:mi:ss'
      2  /
    Session altered.
    SQL> select * from ALL_CAPACITY_SNS_CELL1
      2  /
    A AC DATE_EXECUTED
    A I  05/13/2009 08:56:02
    B I  05/13/2009 08:56:09
    SQL> update ALL_CAPACITY_SNS_CELL1
      2  set a = 'X'
      3  where a = 'B'
      4  /
    1 row updated.
    SQL> select * from ALL_CAPACITY_SNS_CELL1
      2  /
    A AC DATE_EXECUTED
    A I  05/13/2009 08:56:02
    X U  05/13/2009 08:57:05
    SQL> update ALL_CAPACITY_SNS_CELL1
      2  set a = 'Y'
      3  /
    2 rows updated.
    SQL> select * from ALL_CAPACITY_SNS_CELL1
      2  /
    A AC DATE_EXECUTED
    Y U  05/13/2009 08:57:21
    Y U  05/13/2009 08:57:21
    SQL> insert into ALL_CAPACITY_SNS_CELL1(a) values('C')
      2  /
    1 row created.
    SQL> select * from ALL_CAPACITY_SNS_CELL1
      2  /
    A AC DATE_EXECUTED
    Y U  05/13/2009 08:57:21
    Y U  05/13/2009 08:57:21
    C I  05/13/2009 08:57:53
    SQL> SY.

  • SUM two ROWS in the SAME Table

    Hi,
    I have a problem with this issue. I want to sum two rows from the same table, but I don´t know how to do that. I tried to do it with CTE, but always I get the same error "Ambiguous". I would like to ask you, if there is other manner to get that
    data (sum two rows) and if it is possible to see examples about it.
    Thank you  in advance

    Hi Vaibhav,
     I leave you my scrip:
    USE Modelling
    GO
    --TABLE Aer_Lingus_Income_Statement
    IF OBJECT_ID('Aer_Lingus_Income_Statement') IS NOT NULL
    DROP TABLE Aer_Lingus_Income_Statement
    GO
    CREATE TABLE Aer_Lingus_Income_Statement
    ID [nvarchar](255) NOT NULL,
    Name_Account [nvarchar](255) NULL,
    Company [nvarchar](255) NULL,
    Level0_Account [nvarchar](255) NULL,
    Level1_Account [nvarchar](255) NULL,
    Level2_Account [nvarchar](255) NULL,
    Level3_Account [nvarchar](255) NULL,
    Level4_Account [nvarchar](255) NULL,
    Level5_Account [nvarchar](255) NULL,
    Level6_Account [nvarchar](255) NULL,
    Level7_Account [nvarchar](255) NULL,
    Level8_Account [nvarchar](255) NULL,
    Year_2006 decimal (15,2) null,
    Year_2007 decimal (15,2) null,
    Year_2008 decimal (15,2) null,
    Year_2009 decimal (15,2) null,
    Year_2010 decimal (15,2) null,
    Year_2011 decimal (15,2) null,
    Year_2012 decimal (15,2) null,
    Year_2013 decimal (15,2) null,
    GO
    ALTER TABLE Aer_Lingus_Income_Statement
    ADD CONSTRAINT PK_Aer_Lingus_Income_Statement PRIMARY KEY (ID)
    GO
    INSERT INTO Aer_Lingus_Income_Statement
    SELECT *
    FROM Aer_Lingus_data_Income
    IF OBJECT_ID('Aer_Lingus_Income_Statement_Historic') IS NOT NULL
    DROP VIEW Aer_Lingus_Income_Statement_Historic
    GO
    CREATE VIEW Aer_Lingus_Income_Statement_Historic
    as
    Select Level0_Account , sum(Year_2006) as Y2006, sum (Year_2007) as Y2007, sum (Year_2008) as Y2008, sum (Year_2009) as Y2009, sum (Year_2010) as Y2010,
    sum (Year_2011) as Y2011, sum (Year_2012) as Y2012, sum (Year_2013) as Y2013
    FROM Aer_Lingus_data_Income
    Where Level0_Account ='Revenue'
    Group by Level0_Account
    UNION ALL
    Select Name_Account , sum(Year_2006) as Y2006, sum (Year_2007) as Y2007, sum (Year_2008) as Y2008, sum (Year_2009) as Y2009, sum (Year_2010) as Y2010,
    sum (Year_2011) as Y2011, sum (Year_2012) as Y2012, sum (Year_2013) as Y2013
    FROM Aer_Lingus_data_Income
    Where Name_Account= 'Passenger revenue' and Level0_Account ='Revenue'
    Group by Name_Account
    UNION ALL
    Select Name_Account , sum(Year_2006) as Y2006, sum (Year_2007) as Y2007, sum (Year_2008) as Y2008, sum (Year_2009) as Y2009, sum (Year_2010) as Y2010,
    sum (Year_2011) as Y2011, sum (Year_2012) as Y2012, sum (Year_2013) as Y2013
    FROM Aer_Lingus_data_Income
    Where Name_Account= 'Ancillary revenue' and Level0_Account ='Revenue'
    Group by Name_Account
    UNION ALL
    Select Name_Account , sum(Year_2006) as Y2006, sum (Year_2007) as Y2007, sum (Year_2008) as Y2008, sum (Year_2009) as Y2009, sum (Year_2010) as Y2010,
    sum (Year_2011) as Y2011, sum (Year_2012) as Y2012, sum (Year_2013) as Y2013
    FROM Aer_Lingus_data_Income
    Where Name_Account= 'Other revenue' and Level0_Account ='Revenue'
    Group by Name_Account
    UNION ALL
    Select Name_Account , sum(Year_2006) as Y2006, sum (Year_2007) as Y2007, sum (Year_2008) as Y2008, sum (Year_2009) as Y2009, sum (Year_2010) as Y2010,
    sum (Year_2011) as Y2011, sum (Year_2012) as Y2012, sum (Year_2013) as Y2013
    FROM Aer_Lingus_data_Income
    Where Name_Account= 'Cargo revenue' and Level0_Account ='Revenue'
    Group by Name_Account
    UNION ALL
    Select Level0_Account , sum(Year_2006) as Y2006, sum (Year_2007) as Y2007, sum (Year_2008) as Y2008, sum (Year_2009) as Y2009, sum (Year_2010) as Y2010,
    sum (Year_2011) as Y2011, sum (Year_2012) as Y2012, sum (Year_2013) as Y2013
    FROM Aer_Lingus_data_Income
    Where Level0_Account ='Operating expenses'
    Group by Level0_Account
    UNION ALL
    Select Level1_Account , sum(Year_2006) as Y2006, sum (Year_2007) as Y2007, sum (Year_2008) as Y2008, sum (Year_2009) as Y2009, sum (Year_2010) as Y2010,
    sum (Year_2011) as Y2011, sum (Year_2012) as Y2012, sum (Year_2013) as Y2013
    FROM Aer_Lingus_data_Income
    Where Level1_Account ='Staff costs' and Level0_Account ='Operating expenses'
    Group by Level1_Account
    UNION ALL
    Select Level1_Account , sum(Year_2006) as Y2006, sum (Year_2007) as Y2007, sum (Year_2008) as Y2008, sum (Year_2009) as Y2009, sum (Year_2010) as Y2010,
    sum (Year_2011) as Y2011, sum (Year_2012) as Y2012, sum (Year_2013) as Y2013
    FROM Aer_Lingus_data_Income
    Where Level1_Account ='Depreciation, amortisation and impairment' and Level0_Account ='Operating expenses'
    Group by Level1_Account
    UNION ALL
    Select Name_Account , sum(Year_2006) as Y2006, sum (Year_2007) as Y2007, sum (Year_2008) as Y2008, sum (Year_2009) as Y2009, sum (Year_2010) as Y2010,
    sum (Year_2011) as Y2011, sum (Year_2012) as Y2012, sum (Year_2013) as Y2013
    FROM Aer_Lingus_data_Income
    Where Name_Account ='Aircraft operating lease costs' and Level0_Account ='Operating expenses'
    Group by Name_Account
    UNION ALL
    Select Name_Account , sum(Year_2006) as Y2006, sum (Year_2007) as Y2007, sum (Year_2008) as Y2008, sum (Year_2009) as Y2009, sum (Year_2010) as Y2010,
    sum (Year_2011) as Y2011, sum (Year_2012) as Y2012, sum (Year_2013) as Y2013
    FROM Aer_Lingus_data_Income
    Where Name_Account ='Fuel and oil costs' and Level0_Account ='Operating expenses'
    Group by Name_Account
    UNION ALL
    Select Name_Account , sum(Year_2006) as Y2006, sum (Year_2007) as Y2007, sum (Year_2008) as Y2008, sum (Year_2009) as Y2009, sum (Year_2010) as Y2010,
    sum (Year_2011) as Y2011, sum (Year_2012) as Y2012, sum (Year_2013) as Y2013
    FROM Aer_Lingus_data_Income
    Where Name_Account ='Maintenance expenses' and Level0_Account ='Operating expenses'
    Group by Name_Account
    UNION ALL
    Select Name_Account , sum(Year_2006) as Y2006, sum (Year_2007) as Y2007, sum (Year_2008) as Y2008, sum (Year_2009) as Y2009, sum (Year_2010) as Y2010,
    sum (Year_2011) as Y2011, sum (Year_2012) as Y2012, sum (Year_2013) as Y2013
    FROM Aer_Lingus_data_Income
    Where Name_Account ='Airport charges' and Level0_Account ='Operating expenses'
    Group by Name_Account
    UNION ALL
    Select Name_Account , sum(Year_2006) as Y2006, sum (Year_2007) as Y2007, sum (Year_2008) as Y2008, sum (Year_2009) as Y2009, sum (Year_2010) as Y2010,
    sum (Year_2011) as Y2011, sum (Year_2012) as Y2012, sum (Year_2013) as Y2013
    FROM Aer_Lingus_data_Income
    Where Name_Account ='En-route charges' and Level0_Account ='Operating expenses'
    Group by Name_Account
    UNION ALL
    Select Name_Account , sum(Year_2006) as Y2006, sum (Year_2007) as Y2007, sum (Year_2008) as Y2008, sum (Year_2009) as Y2009, sum (Year_2010) as Y2010,
    sum (Year_2011) as Y2011, sum (Year_2012) as Y2012, sum (Year_2013) as Y2013
    FROM Aer_Lingus_data_Income
    Where Name_Account ='Distribution costs' and Level0_Account ='Operating expenses'
    Group by Name_Account
    UNION ALL
    Select Name_Account , sum(Year_2006) as Y2006, sum (Year_2007) as Y2007, sum (Year_2008) as Y2008, sum (Year_2009) as Y2009, sum (Year_2010) as Y2010,
    sum (Year_2011) as Y2011, sum (Year_2012) as Y2012, sum (Year_2013) as Y2013
    FROM Aer_Lingus_data_Income
    Where Name_Account ='Ground operations, catering and other operating costs' and Level0_Account ='Operating expenses'
    Group by Name_Account
    UNION ALL
    Select Level1_Account , sum(Year_2006) as Y2006, sum (Year_2007) as Y2007, sum (Year_2008) as Y2008, sum (Year_2009) as Y2009, sum (Year_2010) as Y2010,
    sum (Year_2011) as Y2011, sum (Year_2012) as Y2012, sum (Year_2013) as Y2013
    FROM Aer_Lingus_data_Income
    Where Level1_Account ='Other (gains)/losses - net' and Level0_Account ='Operating expenses'
    Group by Level1_Account
    UNION ALL
    Select Name_Account , sum(Year_2006) as Y2006, sum (Year_2007) as Y2007, sum (Year_2008) as Y2008, sum (Year_2009) as Y2009, sum (Year_2010) as Y2010,
    sum (Year_2011) as Y2011, sum (Year_2012) as Y2012, sum (Year_2013) as Y2013
    FROM Aer_Lingus_data_Income
    Where Name_Account ='Employee profit share' and Level0_Account ='Operating expenses'
    Group by Name_Account
    GO
    WITH sumasRevenue
    AS (
    SELECT Name_Account, ID
    , sum(Year_2006) AS Y2006, sum (Year_2007) as Y2007, sum (Year_2008) as Y2008, sum (Year_2009) as Y2009, sum (Year_2010) as Y2010,
    sum (Year_2011) as Y2011, sum (Year_2012) as Y2012, sum (Year_2013) as Y2013
    FROM Aer_Lingus_data_Income
    WHERE Level0_Account = 'Revenue'
    GROUP BY Name_Account, ID
    WITH ROLLUP
    , total
    AS (
    SELECT Y2006,Y2007 ,Y2008,Y2009 ,Y2010 ,Y2011 ,Y2012 ,Y2013
    FROM sumasRevenue
    WHERE Name_Account IS NULL
    sumasOperatingExpensive
    AS (
    SELECT Name_Account, ID
    , sum(Year_2006) AS Y2006, sum (Year_2007) as Y2007, sum (Year_2008) as Y2008, sum (Year_2009) as Y2009, sum (Year_2010) as Y2010,
    sum (Year_2011) as Y2011, sum (Year_2012) as Y2012, sum (Year_2013) as Y2013
    FROM Aer_Lingus_data_Income
    WHERE Level0_Account = 'Operating expenses'
    GROUP BY Name_Account, ID
    WITH ROLLUP
    , total1
    AS (
    SELECT Y2006,Y2007 ,Y2008,Y2009 ,Y2010 ,Y2011 ,Y2012 ,Y2013
    FROM sumasOperatingExpensive
    WHERE Name_Account IS NULL
    SELECT distinct ID , s.Name_Account,
    (s.Y2006* 1.0 - t.Y2006) AS [V2006] ,(s.Y2007* 1.0 -T.Y2007 ) as [V2007] , (s.Y2008* 1.0 /T.Y2008 ) as [V2008],(s.Y2009* 1.0 /T.Y2009 ) as [V2009],
    (s.Y2010* 1.0 /T.Y2010 ) as [V2010],(s.Y2011* 1.0 /T.Y2011 ) as [V2011],(s.Y2012* 1.0 /T.Y2012 ) as [V2012],(s.Y2013* 1.0 /T.Y2013 ) as [V2013]
    FROM sumasRevenue AS s , sumasOperatingExpensive AS t
    Where ID IS NOT NULL
    UNION ALL
    SELECT distinct ID,COALESCE(s.Name_Account,'NON CURRENT ASSETS') AS Name_Account ,
    sum (s.Y2006* 1.0 / t.Y2006) as V2006,sum (s.Y2007* 1.0 / t.Y2007) as V2007,sum (s.Y2008* 1.0/ t.Y2008) as V2008,sum (s.Y2009* 1.0/ t.Y2009) as V2009,sum (s.Y2010* 1.0/ t.Y2010) as V2010,
    sum (s.Y2011* 1.0 / t.Y2011) as V2011,sum (s.Y2012* 1.0/ t.Y2012) as V2012,sum (s.Y2013* 1.0/ t.Y2013) as V2013
    FROM sumasRevenue as s , sumasOperatingExpensive as t
    Where ID IS NULL and Name_Account IS NULL
    GROUP BY Name_Account, ID
    WITH ROLLUP
    select *
    from Aer_Lingus_Income_Statement_Historic
    Thank you in advance

  • Copy/Paste cells in the same table

    How can I copy/paste rows inside the same table?
    I tried with ITableModel, but its function CanPaste() returns me kFalse. And I tried with kTableCopyPasteCmdBoss/ITableCopyPasteCmdData, it crashed.
    Thank you in advance,
    David

    You are correct, but this behavior has always amazed me. ID *never* inserts the correct amount of copied rows inbetween others -- rather, you have to count how much you are going to copy, then insert blanks, then paste, then double-check you didn't accidentally overwrite existing ones!
    If you are writing a general plugin to handle tables, you might think about doing this automatically. I don't know, perhaps you can test how much rows are "in the copy buffer" at the time of pasting.

  • Two triggers in the same table and event

    If I created two triggers on the same table and event (before insert), which of them will be triggered first ?...
    The problem from the beginning is that I created the second one as after insert and in the body of the trigger I wrote (:new.xxx:= value) ... then an error (that it should be before insert trigger or update trigger), so I created it as before update ,,, but I have already before update trigger (for primary key)..... and the problem -I think- which of them start first...
    Can make the second one as after insert and make update statement instead of assigning (:new.xxx:= value).....
    Regards

    If I created two triggers on the same table and event
    (before insert), which of them will be triggered
    first ?...As already mentioned, prior to 11g the order of firing is undetermined.
    The problem from the beginning is that I created the
    second one as after insert and in the body of the
    trigger I wrote (:new.xxx:= value) ... then an error
    (that it should be before insert trigger or update
    trigger), so I created it as before update ,,, but I
    have already before update trigger (for primary
    key)..... and the problem -I think- which of them
    start first...If there is a conflict of interest inside the code then you will have to alter your design principle around this to cater for it. Also consider combining the code into a single before insert trigger to prevent any confusion.
    Can make the second one as after insert and make
    update statement instead of assigning (:new.xxx:=
    value).....Attempting to update or query the same table as is causing the trigger to fire will result in a mutating table error. You can't do this.

  • Two Headers in the same table

    Hi people,
    Since i guess this is a pretty common question, i did make a search in the forum and Google. I did not find the way to have 2 Headers in the same table.
    I have a 4 pages long table. The same Header is quite useful in the first 2 pages but not in the last one and for design purposes (autoflow) is nice to have a long table not broken in smaller ones. I mean than in the last 2 pages i would need a different Header than the initial one.
    Any idea?
    THanks and cheers,
    Sebastian

    >does your script [will] work on CS3 and Mac?
    You mean the tagged text? (I see now I accidentally called it "INX" -- that's something else.) Yes, it's compatible all the way down to CS, but since it describes Javascript objects for CS4 only, the textual contents are of limited usefulness for CS3. However, you can inspect the document to see how to do the table trick.
    Create a new, empty InDesign document, preferably of A4 size (as the tables are designed to fit). "Place" the tagged text document as usual -- ID should tell you it's placing tagged text. From then on, wait (and wait and wait some more -- it's about 800 pages) until ID has digested the massive chunk. Then you should get a lot of colorful pages! Click inside any table and, using Table Setup, inspect the Header/Footer tab field. If you deselect "Skip First Header" and "Skip Last Footer", you can see them on every page. Selecting these again hides the first ('continued') and last ('continued from last page') occurrences again.

  • Duplicate records in the same table

    Hello.
    I want to duplicate records in the same table, changing just two date fields and id. Id is changed with sequence.
    Example:
    id name start_date end_date
    1 record_1 01.01.04 31.12.04
    2 record_2 01.01.03 31.12.03
    I want to duplicate record with the start_date year 04 and the duplicated record would change that start_date into year 05.
    After duplicate it should look like:
    1 record_1 01.01.04 31.12.04
    2 record_2 01.01.03 31.12.03
    3 record_1 01.01.05 31.12.05
    How should my insert look like?
    Thanks

    create sequence A_SEQ
       start with 3
       nocache
    insert into tableA
            (ID, name, start_date end_date)
       select
               A_SEQ.nextval   
              ,NAME
              ,start_date + add_months (12)
              ,end_date   + add_months (12)
         from
               tableA
        where
               start_date >= to_date('01.01.2004','dd.mm.yyyy')
          and  start_date <= to_date('01.01.2004','dd.mm.yyyy')

Maybe you are looking for

  • Reading a text File into a JTextArea

    I know this is really basic question, but what is the best and/or simplest way to read text from a .txt file into a JTextArea? I'm new to Java and any help anyone can provide would be greatly appreciated.

  • Crystal report runtime error on print preview

    Hi everybody I've built a CR report based on a 'SAP B1' connection type I pick my tables from the DBO menu and not from the B1 tables menu (not the one which is organized like  the SAP main menu) I  open CR application and the report I click on the p

  • Append two files with added time stamp

    Hi experts,' MY Requirement is I need to pick two files from two different FTP Locations and append them to file receiver FTP Location with Added timestamp. How to achive this as with append we do not get option of adding time stamp. Other thing is I

  • Showcase: Adobe Edge + DPS app

    Hi everyone! We finished our first app with Adobe Edge and it's a collection of Russian tales. http://itunes.apple.com/ru/app/zivye-skazki/id441131633?mt=8 Now there're only two tales. First was made usind Adobe Flash + Wallaby project and the second

  • How to select item in combobox using database?

    I inserted some data in oracle database using comboboxes and to retrieve that data from oracle database.my problem, How to select the item in combobox using that data(retrieve data)?