Welcome Guest! Log in
×

Notice

The forum is in read only mode.
Stambia versions 2.x, 3.x, S17, S18, S19 and S20 are reaching End of Support January, 15th, 2024. Please consider upgrading to the supported Semarchy xDI versions. See Global Policy Support and the Semarchy Documentation.

The Stambia User Community is moving to Semarchy! All the applicable resources have already been moved or are currently being moved to their new location. Read more…

Topic-icon Solved How to replace a string in a file

More
12 Aug 2015 10:40 - 12 Aug 2015 11:48 #1 by zineddine007
How to replace a string in a file was created by zineddine007
Hello,
I have a rejection constraint before insertion into the table T lines that come from the file.
It looks if the foreign key exists in the destination table else it rejects this line.
there is a mechanism that makes a exceptionde rejection ??
because I want to insert a line in the even if the the foreign key does not exist in the table

if such mechanism does not exist I thought about this alternative:
The input file contains lines with /t as separation
I want to edit the file to each time I encounter a string 'xxx' by 'yyy'; because xxx is not existe like foreign key the template reject him

Thank you,

Zineddine
Last edit: 12 Aug 2015 11:48 by zineddine007.
More
12 Aug 2015 13:25 #2 by Pierre-Olivier Mazen
Replied by Pierre-Olivier Mazen on topic How to replace a string in a file
Hello,

when you use a REJECT template you have an option deleteRejectsOnCheckedTable. If you set this option to false the FK will be checked and traced into the error table but the corresponding record will be loaded in the target table.

I hope this helps
More
12 Aug 2015 16:35 #3 by zineddine007
Replied by zineddine007 on topic How to replace a string in a file
thank you Pierre-Olivier,
I want to include just the key 'yyy' and not integrate other string that come from the file if it does not exist in the table as FK, it is an exception for that key 'yyy'.
More
13 Aug 2015 09:49 #4 by Pierre-Olivier Mazen
Replied by Pierre-Olivier Mazen on topic How to replace a string in a file
Then, you have another possibility: make an external join to the Parent table and, in the Mapping expression of the column use something like :
CASE
WHEN FK.COL IS NULL THEN NULL
WHEN FK.COL IS NOT NULL AND PK.COL IS NULL THEN 'yyy'
ELSE FK.COL
END
More
26 Aug 2015 15:01 #5 by zineddine007
Replied by zineddine007 on topic How to replace a string in a file

Pierre-Olivier Mazen wrote: Then, you have another possibility: make an external join to the Parent table and, in the Mapping expression of the column use something like :
CASE
WHEN FK.COL IS NULL THEN NULL
WHEN FK.COL IS NOT NULL AND PK.COL IS NULL THEN 'yyy'
ELSE FK.COL
END