cancel
Showing results for 
Search instead for 
Did you mean: 

Entire Flat File to one database field

Former Member
0 Kudos

Hi guys,

I'd like to insert a flat file into a database using PI, but, the only consideration It is that I have to insert the entire file into just one Database field.

So I think, I don't have to make any kind of content conversion (because I don't need to split the fields or rows); but if I don't use content conversion I can't make the mapping to the Database field.

Anybody can help me?

Thanks in advance!!

Martin

Accepted Solutions (0)

Answers (5)

Answers (5)

Shabarish_Nair
Active Contributor
0 Kudos

>

> Hi guys,

> I'd like to insert a flat file into a database using PI, but, the only consideration It is that I have to insert the entire file into just one Database field.

> Martin

Its answered above but let me try an make a clear explanation.

1. Since you need an entire file to be transmitted to a field in the DB, you will have to declare the type of the field in the DB as a BLOB. BLOBs can handle large data - http://www.faqts.com/knowledge_base/view.phtml/aid/416

2. The easiest way to get the whole file in is using Message protocol as FILE in the sender i.e not use FCC. Now refer my wiki post that will help you pass the whole payload i.e file to an xml field - https://wiki.sdn.sap.com/wiki/display/XI/WholePayloadtoaXML+field

The only thing that you need to take care is to create the target XML in the java mapping as per the document format expected by the JDBC adapter - http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm

You can also try using the protocol Native SQL String in the adapter and the java mapping should write out the query itself.

Former Member
0 Kudos

Hi Javier,

The easiest way is as mentioned by sarvesh, Wki by Shabz on "Whole Payload in XML field".

Just make sure u have selected BLOB on the DB side for the above.

prateek
Active Contributor
0 Kudos

You may also use this

/people/michal.krawczyk2/blog/2005/11/01/xi-xml-node-into-a-string-with-graphical-mapping

Regards,

Prateek

Former Member
0 Kudos

I think you are looking for this...

https://www.sdn.sap.com/irj/scn/wiki?path=/display/xi/wholePayloadtoaXML+field

Former Member
0 Kudos

Hi,

The File adapter with FCC is capable of reading the entire file in one field. Once you do this, the rest is pretty much easy. Then, map this input field to a database field in the target structure using a message mapping, use a jdbc adapter to push the mapped target field to the target databse.

This is explained in https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/482aae19-0301-0010-3485-8efd6188...

Do the following:

create a DT with one field something like :

input_DT

RecordSet

Record

in_field

Then define your target DT as per the jdbc structure.

create MT's and Message Interfaces, in the Message mapping, map the in_field to the target db field and complete the Interface mapping.

In the configuration: create a file adapter with FCC as described in page 15 of the guide (above link)

Complete the configuration as usual.

The guide talks about using java mapping. But i guess you can use graphical mapping

Regards,

Balaji.M