on 10-24-2016 3:55 AM
Hi All,
Can any one explain me how insert binary files(.txt,.csv,.pdf) files in database using SAP PI.
Thank you,
Narasaiah T.
You may need to check the respective XSD data type for your SQL Data type. A quick search takes me here:
https://www.w3.org/2001/sw/rdb2rdf/wiki/Mapping_SQL_datatypes_to_XML_Schema_datatypes
you can use either : xsd:hexBinary or xsd:base64Binary for FileData field. FileName will be xsd:string.
Going by receiver structure for JDBC adapter for Stored procedure, you can create your ESR structure similar to
<StatementName5> <storedProcedureName action=” EXECUTE”>
<table>realStoredProcedureeName</table>
<FileName isInput=”true” type=varchar>fileName from dyn config</FileName>
<FileData isInput=”true” type=varbinary>hes tring created</FileData>
</storedProcedureName > </StatementName5>
So you can read the file in binary format and write the entire payload to the field in the java mapping mentioned in Vila's reply (https://blogs.sap.com/2010/03/28/sap-xipi-storing-binaries-images-pdfs-etc-in-the-database-blobs-usi.../) while forming the XML. You just have add file name tag to the XML.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Aditya,
In above mention java code they didn't fill isInput and type attributes, is PI will take of those those things are where we can fill this attributes
do you any idea to add FileName field in target side using java mapping dynamic configuration?
Please help me....
Thank you,
Narasaiah T.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Naraiah,
In PI 7.0 i had one scenario to read a PDF from an Oracle database, i remember, may be im wrong, i had to do nothing the PI read the binary field and in the monitoring i only notice a codification similar to base64 and the size the double that the real file. I'm sorry i cant check right now because we had to change it because we had a huge files and the PI couldn't deal with them.
REgards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Narsaiah,
Have you checked this blog
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.