Page 1 of 1

Schema File - Select few columns

Posted: Mon May 06, 2013 9:54 am
by reachmexyz
Hi,

I have a file like

col1, col2, col3,col4
1,2,3,4
2,3,4,5
3,4,5,6

Now i have requirement to load col1, col2,col3 values to one table and col1, col3, col4 to another table.
To acheive this, i have create two schema files, one with col1,col2,col3 and other wiht col1, col3,col4.

When i executed the job individually for two schema files, everytime i am getting all four columns. How can i restrict the job to select only required columns?

How can i perform any transformations like adding col3+col4 when i do not see any metadata in columns definitions?

What is the purpose of intact property and how should i use it?

I appreciate your responses.

Posted: Mon May 06, 2013 1:14 pm
by mobashshar
What have you tries so far?
Try using copy stage and see how it goes.

Posted: Mon May 06, 2013 2:03 pm
by reachmexyz
I have close to 40 different layouts to load 40 different tables. This is the reason why i have picked schema files instead of canvassing 40 sequential file stages.

Posted: Tue May 07, 2013 2:56 am
by eph
Hi,

You can use 'drop' in your schema file at column level:

Code: Select all

record
  {final_delim=none, record_delim_string='~~~~', delim=none, charset='UTF8'}
(
  BUSINESS_UNIT:ustring[max=5] {drop};
  JOURNAL_ID:ustring[max=10];
  JOURNAL_DATE:timestamp;
  IU_ANCHOR_FLG:ustring[max=1];
)
Eric

Posted: Tue May 07, 2013 6:56 am
by chulett
reachmexyz wrote:I have close to 40 different layouts to load 40 different tables. This is the reason why i have picked schema files instead of canvassing 40 sequential file stages.
Schema files and one RCP enabled job, yes?

All fields must always be read from a sequential file, that's their nature. Eric's "drop" sounds like the ticket when you only need to process a subset of the fields. However...
reachmexyz also wrote:How can i perform any transformations like adding col3+col4 when i do not see any metadata in columns definitions?
With RCP in control of the columns, you cannot.