How to load hierarchy from file into InfoObject with compounding Attr & LN

Hi,
I have created an InfoObject called YCOSTC0 which has a compounding attribute 0CO_AREA. and Text is Lanugage dependent, hence the key is YCOSTC0, 0CO_AREA and LANGUAGE, now when i load hierarchy from flat file as mentioned below, it creates duplicate blank rows in master data table, becuase the flat file contains only the YCOSTC0 Info Object and this data gets loaded into 0CO_AREA column in master data table which is the first column. how can i load hierarchies from flat file into an InfoObject that has a compounding attribute and Language dependent. please provide me a sample file structure with data.
NodeID     InfoObject     Node Name     Link Name     Parent ID     Language     Short Text     Medium Text     Long Text
1     0HIER_NODE     CC_HIER               EN     Cost Center Heirarchy     Cost Center Heirarchy     Cost Center Heirarchy
2     YCOSTC0     C001          1     EN     CC 1     Cost Center 1     Cost Center 1
3     YCOSTC0     C002          2     EN     CC 2     Cost Center 2     Cost Center 2
4     YCOSTC0     C003          2     EN     CC 3     Cost Center 3     Cost Center 3
5     YCOSTC0     C004          3     EN     CC 4     Cost Center 4     Cost Center 4
6     YCOSTC0     C005          3     EN     CC 7     Cost Center 7     Cost Center 7
7     YCOSTC0     C006          4     EN     CC 5     Cost Center 5     Cost Center 5
8     YCOSTC0     C007          4     EN     CC 8     Cost Center 8     Cost Center 8
9     YCOSTC0     C008          4     EN     CC 10     Cost Center 10     Cost Center 10
10     YCOSTC0     C009          7     EN     CC 6     Cost Center 6     Cost Center 6
11     YCOSTC0     C010          6     EN     CC 9     Cost Center 9     Cost Center 9
Thanks
Akila R

Hi -
    Check the following link.
Hierarchy Upload from Flat files
Anesh B

Similar Messages

  • How to load data from file contains rows with different number of columns

    hi all,
    a data file contains assets data ordered like this(location_id
    serial_number , quantity
    serial_number , quantity
    single column rows represents location, and two columns rows represents asset details for that location
    123
    12345 ,1
    32145 ,1
    124
    12348 ,12
    41239 ,22
    54189 ,2
    254
    22419 ,1
    I want to use sql loader to load these data after merging locations with thieir assets,like this order(location_id,serial number,quantity)
    123 ,12345 ,1
    123 ,25413 ,1
    123 ,32145 ,1
    124 ,12348 ,12
    124 ,41239 ,22
    124 ,54189 ,2
    254 ,22419 ,1
    Can one help me in that?
    thank you,

    Create external table and code sql query to do it.
    :p

  • How to load data from Quikbooks into PeopleSoft General Ledger module ?

    Folks,
    Hello.
    My client's data is currently stored in Quikbooks.
    After install PeopleSoft FSCM 9.0, I need to load the data from Quickbooks into PeopleSoft General Ledger module. But I don't know how to use PeopleSoft Integration Broker to integrate with Quikbooks.
    Can any folks tell me how to load data from Quikbooks into PeopleSoft General Ledger module ?

    Hi,
    If the data load is one time process, then you can use PL/SQL or datamover to load the data to PeopleSoft application.
    If you want to load the data in real time, then you need to create In-bound and out-bound nodes to perform the transaction.
    Thanks
    Soundappan

  • How to load a XML file into a table

    Hi,
    I've been working on Oracle for many years but for the first time I was asked to load a XML file into a table.
    As an example, I've found this on the web, but it doesn't work
    Can someone tell me why? I hoped this example could help me.
    the file acct.xml is this:
    <?xml version="1.0"?>
    <ACCOUNT_HEADER_ACK>
    <HEADER>
    <STATUS_CODE>100</STATUS_CODE>
    <STATUS_REMARKS>check</STATUS_REMARKS>
    </HEADER>
    <DETAILS>
    <DETAIL>
    <SEGMENT_NUMBER>2</SEGMENT_NUMBER>
    <REMARKS>rp polytechnic</REMARKS>
    </DETAIL>
    <DETAIL>
    <SEGMENT_NUMBER>3</SEGMENT_NUMBER>
    <REMARKS>rp polytechnic administration</REMARKS>
    </DETAIL>
    <DETAIL>
    <SEGMENT_NUMBER>4</SEGMENT_NUMBER>
    <REMARKS>rp polytechnic finance</REMARKS>
    </DETAIL>
    <DETAIL>
    <SEGMENT_NUMBER>5</SEGMENT_NUMBER>
    <REMARKS>rp polytechnic logistics</REMARKS>
    </DETAIL>
    </DETAILS>
    <HEADER>
    <STATUS_CODE>500</STATUS_CODE>
    <STATUS_REMARKS>process exception</STATUS_REMARKS>
    </HEADER>
    <DETAILS>
    <DETAIL>
    <SEGMENT_NUMBER>20</SEGMENT_NUMBER>
    <REMARKS> base polytechnic</REMARKS>
    </DETAIL>
    <DETAIL>
    <SEGMENT_NUMBER>30</SEGMENT_NUMBER>
    </DETAIL>
    <DETAIL>
    <SEGMENT_NUMBER>40</SEGMENT_NUMBER>
    <REMARKS> base polytechnic finance</REMARKS>
    </DETAIL>
    <DETAIL>
    <SEGMENT_NUMBER>50</SEGMENT_NUMBER>
    <REMARKS> base polytechnic logistics</REMARKS>
    </DETAIL>
    </DETAILS>
    </ACCOUNT_HEADER_ACK>
    For the two tags HEADER and DETAILS I have the table:
    create table xxrp_acct_details(
    status_code number,
    status_remarks varchar2(100),
    segment_number number,
    remarks varchar2(100)
    before I've created a
    create directory test_dir as 'c:\esterno'; -- where I have my acct.xml
    and after, can you give me a script for loading data by using XMLTABLE?
    I've tried this but it doesn't work:
    DECLARE
    acct_doc xmltype := xmltype( bfilename('TEST_DIR','acct.xml'), nls_charset_id('AL32UTF8') );
    BEGIN
    insert into xxrp_acct_details (status_code, status_remarks, segment_number, remarks)
    select x1.status_code,
            x1.status_remarks,
            x2.segment_number,
            x2.remarks
    from xmltable(
      '/ACCOUNT_HEADER_ACK/HEADER'
      passing acct_doc
      columns header_no      for ordinality,
              status_code    number        path 'STATUS_CODE',
              status_remarks varchar2(100) path 'STATUS_REMARKS'
    ) x1,
    xmltable(
      '$d/ACCOUNT_HEADER_ACK/DETAILS[$hn]/DETAIL'
      passing acct_doc as "d",
              x1.header_no as "hn"
      columns segment_number number        path 'SEGMENT_NUMBER',
              remarks        varchar2(100) path 'REMARKS'
    ) x2
    END;
    This should allow me to get something like this:
    select * from xxrp_acct_details;
    Statuscode status remarks segement remarks
    100 check 2 rp polytechnic
    100 check 3 rp polytechnic administration
    100 check 4 rp polytechnic finance
    100 check 5 rp polytechnic logistics
    500 process exception 20 base polytechnic
    500 process exception 30
    500 process exception 40 base polytechnic finance
    500 process exception 50 base polytechnic logistics
    but I get:
    Error report:
    ORA-06550: line 19, column 11:
    PL/SQL: ORA-00932: inconsistent datatypes: expected - got NUMBER
    ORA-06550: line 4, column 2:
    PL/SQL: SQL Statement ignored
    06550. 00000 -  "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    and if I try to change the script without using the column HEADER_NO to keep track of the header rank inside the document:
    DECLARE
    acct_doc xmltype := xmltype( bfilename('TEST_DIR','acct.xml'), nls_charset_id('AL32UTF8') );
    BEGIN
    insert into xxrp_acct_details (status_code, status_remarks, segment_number, remarks)
    select x1.status_code,
            x1.status_remarks,
            x2.segment_number,
            x2.remarks
    from xmltable(
      '/ACCOUNT_HEADER_ACK/HEADER'
      passing acct_doc
      columns status_code    number        path 'STATUS_CODE',
              status_remarks varchar2(100) path 'STATUS_REMARKS'
    ) x1,
    xmltable(
      '/ACCOUNT_HEADER_ACK/DETAILS'
      passing acct_doc
      columns segment_number number        path 'SEGMENT_NUMBER',
              remarks        varchar2(100) path 'REMARKS'
    ) x2
    END;
    I get this message:
    Error report:
    ORA-19114: error during parsing the XQuery expression: 
    ORA-06550: line 1, column 13:
    PLS-00201: identifier 'SYS.DBMS_XQUERYINT' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    ORA-06512: at line 4
    19114. 00000 -  "error during parsing the XQuery expression: %s"
    *Cause:    An error occurred during the parsing of the XQuery expression.
    *Action:   Check the detailed error message for the possible causes.
    My oracle version is 10gR2 Express Edition
    I do need a script for loading xml files into a table as soon as possible, Give me please a simple example for understanding and that works on 10gR2 Express Edition
    Thanks in advance!

    The reason your first SQL statement
    select x1.status_code,
            x1.status_remarks,
            x2.segment_number,
            x2.remarks
    from xmltable(
      '/ACCOUNT_HEADER_ACK/HEADER'
      passing acct_doc
      columns header_no      for ordinality,
              status_code    number        path 'STATUS_CODE',
              status_remarks varchar2(100) path 'STATUS_REMARKS'
    ) x1,
    xmltable(
      '$d/ACCOUNT_HEADER_ACK/DETAILS[$hn]/DETAIL'
      passing acct_doc as "d",
              x1.header_no as "hn"
      columns segment_number number        path 'SEGMENT_NUMBER',
              remarks        varchar2(100) path 'REMARKS'
    ) x2
    returns the error you noticed
    PL/SQL: ORA-00932: inconsistent datatypes: expected - got NUMBER
    is because Oracle is expecting XML to be passed in.  At the moment I forget if it requires a certain format or not, but it is simply expecting the value to be wrapped in simple XML.
    Your query actually runs as is on 11.1 as Oracle changed how that functionality worked when 11.1 was released.  Your query runs slowly, but it does run.
    As you are dealing with groups, is there any way the input XML can be modified to be like
    <ACCOUNT_HEADER_ACK>
    <ACCOUNT_GROUP>
    <HEADER>....</HEADER>
    <DETAILS>....</DETAILS>
    </ACCOUNT_GROUP>
      <ACCOUNT_GROUP>
      <HEADER>....</HEADER>
      <DETAILS>....</DETAILS>
      </ACCOUNT_GROUP>
    </ACCOUNT_HEADER_ACK>
    so that it is easier to associate a HEADER/DETAILS combination?  If so, it would make parsing the XML much easier.
    Assuming the answer is no, here is one hack to accomplish your goal
    select x1.status_code,
            x1.status_remarks,
            x3.segment_number,
            x3.remarks
    from xmltable(
      '/ACCOUNT_HEADER_ACK/HEADER'
      passing acct_doc
      columns header_no      for ordinality,
              status_code    number        path 'STATUS_CODE',
              status_remarks varchar2(100) path 'STATUS_REMARKS'
    ) x1,
    xmltable(
      '$d/ACCOUNT_HEADER_ACK/DETAILS'
      passing acct_doc as "d",
      columns detail_no      for ordinality,
              detail_xml     xmltype       path 'DETAIL'
    ) x2,
    xmltable(
      'DETAIL'
      passing x2.detail_xml
      columns segment_number number        path 'SEGMENT_NUMBER',
              remarks        varchar2(100) path 'REMARKS') x3
    WHERE x1.header_no = x2.detail_no;
    This follows the approach you started with.  Table x1 creates a row for each HEADER node and table x2 creates a row for each DETAILS node.  It assumes there is always a one and only one association between the two.  I use table x3, which is joined to x2, to parse the many DETAIL nodes.  The WHERE clause then joins each header row to the corresponding details row and produces the eight rows you are seeking.
    There is another approach that I know of, and that would be using XQuery within the XMLTable.  It should require using only one XMLTable but I would have to spend some time coming up with that solution and I can't recall whether restrictions exist in 10gR2 Express Edition compared to what can run in 10.2 Enterprise Edition for XQuery.

  • How to load a BDB file into memory?

    The entire BDB database needs to reside in memory for performance reasons, it needs to be in memory all the time, not paged in on demand. The physical memory and virtual process address space are large enough to hold this file. How can I load it into memory just before accessing the first entry? I've read the C++ API reference, and it seems that I can do the following:
    1, Create a DB environment;
    2, Call DB_ENV->set_cachesize() to set a memory pool large enough to hold the BDB file;
    3, Call DB_MPOOLFILE->open() to open the BDB file in memory pool of that DB environment;
    4, Create a DB handle in that DB environment and open the BDB file (again) via this DB handle.
    My questions are:
    1, Is there a more elegant way instead of using that DB environment? If the DB environment is a must, then:
    2, Does step 3 above load the BDB file into memory pool or just reserve enough space for that file?
    Thanks in advance,
    Feng

    Hello,
    Does the documentation on "Memory-only or Flash configurations" at:
    http://download.oracle.com/docs/cd/E17076_02/html/programmer_reference/program_ram.html
    answer the question?
    From there we have:
    By default, databases are periodically flushed from the Berkeley DB memory cache to backing physical files in the filesystem. To keep databases from being written to backing physical files, pass the DB_MPOOL_NOFILE flag to the DB_MPOOLFILE->set_flags() method. This flag implies the application's databases must fit entirely in the Berkeley DB cache, of course. To avoid a database file growing to consume the entire cache, applications can limit the size of individual databases in the cache by calling the DB_MPOOLFILE->set_maxsize() method.
    Thanks,
    Sandra

  • How to load a java file into Oracle?

    Hello,
    I have some problem in loading a java file into Oracle 8i. I used "loadjava -user <userName/Password> -resolve <javaClassName>" command.
    JAVA Version used JDK 1.5
    When calling this class file from a trigger gives this error
    ORA-29541: class ANTONY1.DBTrigger could not be resolved.
    Can anyone help me to resolve this problem?

    Hello,
    Which username did you use to load the class, and which user is running the trigger?
    The default resolver searches only the current user's schema and PUBLIC so the java class needs to be loaded into one of these.
    cheers,
    Anthony

  • How to import a PSD file into Indesign WITH layers so it can be edited/saved as an InDesign file?

    How to import a Photoshop file into Indesign CS6 so that it's layers show in InDesign and it can then be edited/saved as an InDesign file?

    MyTienN wrote:
    Someone had mentioned the possibility of saving each individual layer in Photoshop as a png file and importing into Indesign and adjusting it in there
    What do you mean by "adjust"? Editing of Photoshop images should be done in Photoshop.
    Sure, it's possible to save individual layers from an image in Photoshop as inidvidual files in a variety of formats, but what's the point? You could just as easily import the layered file, then copy/paste it into a new layer for each layer in the image and use layer visibility to control which ones show. I don't think that will do you a lot of good, though, if you use adjustment layers or opacity controls on the layer in Photoshop.

  • How to load a XML file into a table using PL/SQL

    Hi Guru,
    I have a requirement, that i have to create a procedure or a package in PL/SQL to load  XML file into a table.
    How we can achive this.

    ODI_NewUser wrote:
    Hi Guru,
    I have a requirement, that i have to create a procedure or a package in PL/SQL to load  XML file into a table.
    How we can achive this.
    Not a perfectly framed question. How do you want to load the XML file? Hoping you want to parse the xml file and load it into a table you can do this.
    This is the xml file
    karthick% cat emp_details.xml
    <?xml version="1.0"?>
    <ROWSET>
    <ROW>
      <EMPNO>7782</EMPNO>
      <ENAME>CLARK</ENAME>
      <JOB>MANAGER</JOB>
      <MGR>7839</MGR>
      <HIREDATE>09-JUN-1981</HIREDATE>
      <SAL>2450</SAL>
      <COM>0</COM>
      <DEPTNO>10</DEPTNO>
    </ROW>
    <ROW>
      <EMPNO>7839</EMPNO>
      <ENAME>KING</ENAME>
      <JOB>PRESIDENT</JOB>
      <HIREDATE>17-NOV-1981</HIREDATE>
      <SAL>5000</SAL>
      <COM>0</COM>
      <DEPTNO>10</DEPTNO>
    </ROW>
    </ROWSET>
    You can write a query like this.
    SQL> select *
      2    from xmltable
      3         (
      4            '/ROWSET/ROW'  passing xmltype
      5            (
      6                 bfilename('SDAARBORDIRLOG', 'emp_details.xml')
      7               , nls_charset_id('AL32UTF8')
      8            )
      9            columns empno    number      path 'EMPNO'
    10                  , ename    varchar2(6) path 'ENAME'
    11                  , job      varchar2(9) path 'JOB'
    12                  , mgr      number      path 'MGR'
    13                  , hiredate varchar2(20)path 'HIREDATE'
    14                  , sal      number      path 'SAL'
    15                  , com      number      path 'COM'
    16                  , deptno   number      path 'DEPTNO'
    17         );
         EMPNO ENAME  JOB              MGR HIREDATE                    SAL        COM     DEPTNO
          7782 CLARK  MANAGER         7839 09-JUN-1981                2450          0         10
          7839 KING   PRESIDENT            17-NOV-1981                5000          0         10
    SQL>

  • How to load excel-csv file into oracle database

    Hi
    I wanted to load excel file with csv extension(named as trial.csv) into
    oracle database table(named as dept),I have given below my experiment here.
    I am getting the following error,how should I rectify this?
    For ID column I have defined as number(5) datatype, in my control file I have defined as interger external(5),where as in the Error log file why the datatype for ID column is comming as character?
    1)my oracle database table is
    SQL> desc dept;
    Name Null? Type
    ID NUMBER(5)
    DNAME CHAR(20)
    2)my data file is(trial.csv)
    ID     DNAME
    11     production
    22     purchase
    33     inspection
    3)my control file is(trial.ctl)
    LOAD DATA
    INFILE 'trial.csv'
    BADFILE 'trial.bad'
    DISCARDFILE 'trial.dsc'
    APPEND
    INTO TABLE dept
    FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    (ID POSITION(1:5) INTEGER EXTERNAL(5)      
    NULLIF ID=BLANKS,
    DNAME POSITION(6:25) CHAR
         NULLIF DNAME=BLANKS
    3)my syntax on cmd prompt is
    c:\>sqlldr scott/tiger@xxx control=trial.ctl direct=true;
    Load completed - logical record count 21.
    4)my log file error message is
    Column Name Position Len Term Encl Datatype
    ID           1:5 5 , O(") CHARACTER
    NULL if ID = BLANKS
    DNAME 6:25 20 , O(") CHARACTER
    NULL if DNAME = BLANKS
    Record 1: Rejected - Error on table DEPT, column ID.
    ORA-01722: invalid number
    Record 21: Rejected - Error on table DEPT, column ID.
    ORA-01722: invalid number
    Table DEPT:
    0 Rows successfully loaded.
    21 Rows not loaded due to data errors.
    0 Rows not loaded because all WHEN clauses were failed.
    0 Rows not loaded because all fields were null.
    Bind array size not used in direct path.
    Column array rows : 5000
    Stream buffer bytes: 256000
    Read buffer bytes: 1048576
    Total logical records skipped: 0
    Total logical records read: 21
    Total logical records rejected: 21
    Total logical records discarded: 0
    Total stream buffers loaded by SQL*Loader main thread: 0
    Total stream buffers loaded by SQL*Loader load thread: 0
    5)Result
    SQL> select * from dept;
    no rows selected
    by
    balamuralikrishnan.s

    Hi everyone!
    The following are the steps to load a excell sheet to oracle table.i tried to be as simple as possible.
    thanks
    Step # 1
    Prapare a data file (excel sheet) that would be uploaded to oracle table.
    "Save As" a excel sheet to ".csv" (comma seperated values) format.
    Then save as to " .dat " file.
    e.g datafile.bat
    1,Category Wise Consumption Summary,Expected Receipts Report
    2,Category Wise Receipts Summary,Forecast Detail Report
    3,Current Stock List Category Wise,Forecast rule listing
    4,Daily Production Report,Freight carrier listing
    5,Daily Transactions Report,Inventory Value Report
    Step # 2
    Prapare a control file that define the data file to be loaded ,columns seperation value,name and type of the table columns to which data is to be loaded.The control file extension should be " .ctl " !
    e.g i want to load the data into tasks table ,from the datafile.dat file and having controlfile.ctl control file.
    SQL> desc tasks;
    Name Null? Type
    TASK_ID NOT NULL NUMBER(14)
    TASK_NAME VARCHAR2(120)
    TASK_CODE VARCHAR2(120)
    : controlfile.ctl
    LOAD DATA
    INFILE 'e:\datafile.dat'
    INTO TABLE tasks
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    (TASK_ID INTEGER EXTERNAL,
    TASK_NAME CHAR,
    TASK_CODE CHAR)
    The above is the structure for a control file.
    Step # 3
    the final step is to give the sqlldr command to execute the process.
    sqlldr userid=scott/tiger@abc control=e:\controlfile.ctl log=e:\logfile.log
    Message was edited by:
    user578762

  • How to load a XML file into the database

    Hi,
    I've always only loaded data into the database by using SQL-Loader and the data format was Excel or ASCII
    Now I have to load a XML.
    How can I do?
    The company where I work has Oracle vers. 8i (don't laugh, please)
    Thanks in advance!

    Hi,
    Tough job especially if the XML data is complex. The have been some similar question in the forum:
    Using SQL Loader to load an XML File -- use 1 field's data for many records
    SQL Loader to upload XML file
    Hope they help.
    Regards,
    Sujoy

  • How to insert data from file into matlab script node

    I have interfaced input data from file to be processed using matlab script node. But the problem is that I could not capture the multiple data into matlab script node and to convert it into matrix. Further to this I need to process the data by plotting graphs from it. Thank you in advance for the advice

    Zarina,
    To clarify your problem, you have a script node contaning your Matlab code. Are you then using the standard LV functions to load in your data from a file and pass it into the script node?
    Regards
    Tristan

  • In PSE 9.0, how do I import from files into organizer without duplicating images already in the orga

    In PSE 9.0, how do I import images from hard drive files into the organizer without importing duplicated files already in the organizer or
    How do I find duplicated images within the organizer so that I can delete them?

    I imported a bunch of photos from iPhoto 4 on one machine to iPhoto 5 on another, expecting it to catch duplicates, without testing beforehand (duh). It didn't catch them, and now I'm trying to figure out which were the imported ones so I can delete them.
    As this looks to be a laborious task if done from within iPhoto, and deleting the files via the Finder is a no-no -- assuming I can even identify the duplicates -- is there a third-party app, or even a good trick, for doing this?

  • How to load data from a virtual cube with services

    Hello all,
    we have set up a virtual cube with service and create a BEx report to get the data from an external database. That works fine. The question is now:
    Is it some how possible to "load" the data from this virtual cube with service (I know that there are not really data...) into an other InfoCube?
    If that is possible, can you please give my some guidance how to set up this scenario.
    Thanks in advance
    Jürgen

    Hi:
    I don't have system before me, so try this.
    I know it works for Remote Cube.
    Right Click on the Cube and Select Generate Export Data Source.
    If you can do this successfully, then go to Source Systems tab and select the BW. Here, Right CLick on select Replicate DataSources.
    Next, go to InfoSOurces, click on Refresh. Copy the name of Virtual Cube and add 8 as a prefix and search for the infosource.
    If you can see it, that means, you can load data from this cube to anywhere you want, just like you do to ODS.
    ELSE.
    Try and see if you can create an InfoSpoke in Virtual Cube. Tran - RSBO.
    Here, you can load to a database table and then, from this table, you can create datasource, etc.
    ELSE.
    Create query and save it as CSV file and load it anywhere you want. This is more difficult.
    Good luck
    Ram Chamarthy

  • How do I convert a file into inx with cs5.5?

    Hello,
    How do I convert a file in indesign cs5.5 into the interchange format?
    Thanks for your answers

    A complete review can be found here, but basically, you can't. CS4 was the last version that was able to generate INX - the format was replaced with IDML. You must export IDML with CS5.5, open that IDML in CS4, then export INX from CS4.
    Why do you need INX? If it's for someone with CS3, then that person may not get a useable file, if any features introduced after CS3 were used in the CS5.5 document.

  • How do I insert one file into another with track changes intact?

    I gather that Pages does not have a way to insert a file into a document in the way that Word has insert file. So all we can do is copy an entire document and then paste it into the second document. But when I do that I lose the track changes, except for the odd comment. What is the way around this?

    I'm assuming you're wanting to insert the contents of one Pages document into another. I don't have a need to use tracking, so I'm not sure if this applies but I think it should.
    You can insert sections from one Pages document into another. Open your files & show thumbnails. Sections have a yellow border around all of the pages in that section. Now click on the page in the thumbnail pane & copy. If the file is more than one page & you only want one, you'll need to insert a section break to separate the pages. Then go to your other file, click in the thumbnail pane & paste. If you want to insert the other content into the middle of a section in the receiving document, you will need to insert section breaks at the point you want to insert. The whole copied page will be pasted in. Repeat with another section. Styles will copy over with the sections but headers & footers will not.

Maybe you are looking for