cancel
Showing results for 
Search instead for 
Did you mean: 

Read contents of file, use replace function and store in a variable to pass as an arguement

former_member186082
Active Contributor
0 Kudos

Hi All,

My requirement is read contents of file, replace a string with a new string, store the result string in a variable. This variable has to be passed as an argument while calling HANA procedure. Is it possible to achieve this?

Regards,

Chandu.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello

Yes this is possible and there are various ways to implement it.  Which aspect in particular are you struggling with?

Michael

former_member186082
Active Contributor
0 Kudos

Hello Michael,

Text file will be placed in a shared folder, the file will have around 15K lines of text. As I said, it has to be read and replace function has to be executed on the content of the file. This result after replace function has to be stored in a variable, so that the variable can be passed as a parameter to the HANA procedure. Can you help me in designing, how the data flow has to be and I feel script will be required to work replacing string. If yes, can you help me in giving me an idea on entire flow.

Regards,
Chandu

Former Member
0 Kudos

Hello

Without knowing too much of your detail, I would recommend that you read the file, perform the transformation as you write the data into a table in HANA, then invoke a HANA procedure to read the contents of the table (because 15000 lines of text is not going to work for a scalar parameter in the HANA procedure).

See this white paper for an example of using table type input parameters with Data Services and HANA - http://www.saphana.com/docs/DOC-2289.

Michael

former_member186082
Active Contributor
0 Kudos

Thanks Michael. I had the same idea, was looking if any better implementation.