cancel
Showing results for 
Search instead for 
Did you mean: 

How to chain HANA SQL input files in a HANA SQL Input file

andreas_zigann
Active Participant
0 Kudos
127

Hello,

I would like to simplify my configuration. I have written several sql scripts to create users, roles, policies, set parameters etc. Now I would like to chain these scripts in an input file for hdbsql. 

The best way on my opinion:

loggin on with <sid>adm 

hdbsql -d SYSTEMDB -u SYSTEM

\i configure_hana.script

Content of configure_hana.script:

\i create_roles.sql;

\i create_users.sql;

\i set_parameters.sql;

hdbsql executes the first script, but stucks after this. There are ; at the end of each line in the sql script. 

I do not want to store a user with admin authorisation in hdbuserstore and I do not want to execute hdbsql with password in command line. Because of this, I would like to logon first and then call the input file. 

I can`t find a syntax to terminate the input file. 

Can you give me a hint to the solution.

Best Regards

Andreas

 

View Entire Topic
Vitaliy-R
Developer Advocate
Developer Advocate

I hope I have a solution for you @andreas_zigann , but I still would need to validate it with the engineering team. Please, try to change you `configure_hana.script` to:

\read create_roles.sql;
\read create_users.sql;
\read set_parameters.sql;

Regards,
--Vitaliy

Vitaliy-R
Developer Advocate
Developer Advocate
0 Kudos
HDBCLI engineering team confirmed that READ should be used instead of the INPUT command.