cancel
Showing results for 
Search instead for 
Did you mean: 

hdbsql - inline command to import database

chladek
Participant
0 Kudos

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

View Entire Topic
jyotsana_gupta
Advisor
Advisor

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