cancel
Showing results for 
Search instead for 
Did you mean: 

adding timestamp to output file

matt_ellicott
Explorer
0 Kudos

in this blog you show how to set the delimiter using /f in interactive mode, but i have a request that requires the output of ~200 million lines and as we all know in this day and age, foreground processes get timed out for security reasons way before this finishes. i can run hqbsql in background using a script, but any attempt to set the /f value cause the process to fail. and you provide the syntax for setting the delimiter to "|"?

example - this runs, but default delimiter is comma, which is an issue since there are commas in the ARKTX field.

$DIR_EXECUTABLE/hdbsql -n <server> -u <user> -p <password> -x "select * from "SAPABAP1"."VBAP" " > /hana/backup/dump1/10232023_vbap.csv

i attempted this

$DIR_EXECUTABLE/hdbsql -n <server> -u <user> -p <password> /f | -x "select * from "SAPABAP1"."VBAP" " > /hana/backup/dump1/10232023_vbap.csv

and this

$DIR_EXECUTABLE/hdbsql -n <server> -u <user> -p <password> -x /f | "select * from "SAPABAP1"."VBAP" " > /hana/backup/dump1/10232023_vbap.csv

but neither worked.

Accepted Solutions (1)

Accepted Solutions (1)

klaus_u_paschke
Explorer
0 Kudos

Hello,

/f ? Not known to me

Have tried to set your preferred seperator using switch -F | ( keep in mind to use "F" in capital letter ! ) accordingly to the hdbsql command line reference ?



KR

Klaus

matt_ellicott
Explorer
0 Kudos

if you look at the blog, it shows f\ | and when running in interactive mode that command works. are you saying when running as a script iit should be -F | ? if this is correct, can you provide the proper syntax as trying various ways to write this all failed.

$DIR_EXECUTABLE/hdbsql -n <server> -u <user> -p <password> -F | -x "select * from "SAPABAP1"."VBAP" " > /hana/backup/dump1/10232023_vbap.csv - command -x not found.

$DIR_EXECUTABLE/hdbsql -n <server> -u <user> -p <password> -x "-F | select * from "SAPABAP1"."VBAP" " > /hana/backup/dump1/10232023_vbap.csv - tty not foiund - suspended.

klaus_u_paschke
Explorer
0 Kudos

Hello

yes, in interactive mode only it is \f | for pipe symbol as separator.

Explanation for formatting

So try for batch/script with default '|' separator

$DIR_EXECUTABLE/hdbsql -n <server> -u <user> -p <password> -F -x "select * from "SAPABAP1"."VBAP" " > /hana/backup/dump1/10232023_vbap.csv

If you will try a different separator e.g. semicolon try

$DIR_EXECUTABLE/hdbsql -n <server> -u <user> -p <password> -F ';' -x "select * from "SAPABAP1"."VBAP" " > /hana/backup/dump1/10232023_vbap.csv

KR

Klaus

matt_ellicott
Explorer
0 Kudos

your first example i end up with -x as the delimiter - -xMANDT-xBUKRS-xBELNR-xGJAHR-xBLART-xBLDAT-xBUDAT-xMONAT-xCPUDT-xCPUTM

so the default does not work, but the good news is the second does work -F '|' change the delimiter from ',' (default) to '|'

thank you for your help.

klaus_u_paschke
Explorer
0 Kudos

You are welcome. Please mark as "accepted" when helpful so other community members can use it as a solution if they face the same question.

Answers (0)