{"id":7914,"date":"2021-10-28t11:00:14","date_gmt":"2021-10-28t15:00:14","guid":{"rendered":"\/\/www.deco-dalles.com\/?p=1730"},"modified":"2021-11-09t10:26:18","modified_gmt":"2021-11-09t15:26:18","slug":"understanding-primavera-xer-files","status":"publish","type":"post","link":"\/\/www.deco-dalles.com\/understanding-primavera-xer-files\/","title":{"rendered":"understanding primavera xer files"},"content":{"rendered":"

in this second part of primavera p6 databases and data cleansing series<\/a>, we will discuss the data structure of an xer file, and how the xer file parser & builder works. as the xer file parser is a manual process (it does not honour p6 business rules), it is handy for the user to have a working knowledge of the p6 database. that\u2019s why in this p6 tutorial we will show a general overview of p6’s data structure, and basic concepts in p6’s database management ( tables, fields , primary key).<\/p>\n

1) a quick understanding of primavera’s p6 data structure<\/strong><\/h2>\n

1.1) how is data stored in the p6 pmdb database?\u00a0<\/strong><\/h3>\n

primavera p6 stores data in a more then 170 tables<\/a>, every tables contains fields<\/a>, and every field stores records<\/a>.<\/p>\n

the tables are referenced to each other by relations between primary<\/a> key and foreign<\/a> key,<\/p>\n

for a description of all the tables check this primavera documentation<\/a> , unzip the file, then read the file called pmschema.html.<\/p>\n

fortunately, you don\u2019t need to understand the relations between all 170 tables (whew!). in reality there are only around 20 most used tables that you need really to be familiar with.<\/p>\n

calculated fields are not stored in primavera’s database as they are calculated on the fly based on other stored fields. for example, resource spread data are not stored in the database at all.<\/p>\n

for illustration only, here an example of a p6 database diagrams (showing only some tables) that illustrates the many interconnections.<\/p>\n

\"understanding<\/p>\n

nb:\u00a0 g<\/em>enerated by pl\/sql developer<\/a> \u00a0 (using a demo version)<\/p>\n

1.2) an example – where data is written in the p6 db<\/strong><\/h3>\n

we will use a simple example to show how data you input into p6 client are stored in the database.<\/p>\n

let\u2019s take project codes as an example.<\/p>\n

let’s say you define a new project code in p6. \u00a0you then define values for your new project code.<\/p>\n

\"understanding<\/p>\n

now let\u2019s see how p6 stores the data in the database with the help of excel.<\/p>\n

the project code definitions are stored in a table called pcattype. here’s what that table looks like.<\/p>\n

\"understanding<\/p>\n

the project code values are stored in a table called pcatval. here’s what the pcatval table looks like.<\/p>\n

\"understanding<\/p>\n

the foreign key 93 references these values to the same primary key in the table\u00a0 pcattype, which essentially links the project code values to their project code across tables.<\/p>\n

now if in the xer file parser you delete the primary key 93 and you leave it in the table pcatval, you will create an orphaned record, and your xer file will be corrupted and cannot be imported. but more on that later.<\/p>\n

2) how primavera p6 \u00a0exchanges data<\/strong><\/h2>\n

xer is the most used format to exchange data with other p6 databases, as xml had some limitations ( limited to one project, less data is exported comparing to xer). in version 8.3, those limitation are removed and there are option to change global data attributes including<\/p>\n