‎2024 May 20 11:06 AM - edited ‎2024 May 20 11:24 AM
Hello,
I would like to use bash script where beside other commands I have:
inline command:
./hdbsql -n localhost -u MYUSER -p <mypass> "IMPORT "SBODEMOCZ"."*" AS BINARY FROM '/mypath/SBODEMOCZ' WITH IGNORE EXISTING;"
but it returns:
* 257: sql syntax error: incorrect syntax near "*": line 1 col 18 (at pos 18) SQLSTATE: HY000
When I firstly login into hdbsql console:
./hdbsql -n localhost -u MYUSER -p <mypass>
then pass the command:
hdbsql NDB=>IMPORT "SBODEMOCZ"."*" AS BINARY FROM '/mypath/SBODEMOCZ' WITH IGNORE EXISTING;
it works properly.
Please how can I do it as inline command?
Thank You
Regards
Zdenek
Request clarification before answering.
Hello Zdenek,
I tried your inline command on Windows and Linux and got the same syntax error, but, if I escape the quotes around *, the syntax error goes away on both platforms. Could you please try that and see if it works for you as well?
./hdbsql -n localhost -u MYUSER -p <mypass> "IMPORT "SBODEMOCZ".\"*\" AS BINARY FROM '/mypath/SBODEMOCZ' WITH IGNORE EXISTING;"
Best regards,
Jyotsana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You need to escape the " from the IMPORT command, otherwise the HDBSQL will interpret the second " as the end of the command.
Also, you could store the commands in a file and call the HDBSQL (option -I <file>) to execute them. Official documentation here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 9 | |
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.