Skip to content

Commit

Permalink
add -E option to filepath command (#42)
Browse files Browse the repository at this point in the history
* add -E option to filepath command

-E	
Specifies the <exit-code> if HDBSQL returns an error. Values are: OKAY = 0, ERROR = 1, USAGE = 2, SQLERROR = 3, and VAR = 4.

if -E is not set when using-I option the sql will not fail on first error and still continue running the sql commands inside the file. If the last command is successfully, the whole run is market as successfully

* Create 0044-hdbsql_sqlfile_faile_on_first_error.yaml

* Update 0044-hdbsql_sqlfile_faile_on_first_error.yaml

* Update and rename 0044-hdbsql_sqlfile_faile_on_first_error.yaml to 0044-hdbsql_sqlfile_fail_on_first_error.yaml

---------

Co-authored-by: Rainer Leber <[email protected]>
  • Loading branch information
stm85 and rainerleber authored Apr 29, 2024
1 parent f9d3cce commit 7d8bc0f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- Add -E 3 Option to hdbsql run, if filepaht is selected, to fail on first sql error
2 changes: 1 addition & 1 deletion plugins/modules/sap_hdbsql.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def main():
command.extend(['-x', '-i', instance, '-u', user, '-p', password])

if filepath is not None:
command.extend(['-I'])
command.extend(['-E 3', '-I'])
for p in filepath:
# makes a command like hdbsql -i 01 -u SYSTEM -p secret123# -I /tmp/HANA_CPU_UtilizationPerCore_2.00.020+.txt,
# iterates through files and append the output to var out.
Expand Down

0 comments on commit 7d8bc0f

Please sign in to comment.