cancel
Showing results for 
Search instead for 
Did you mean: 

EXPORT/IMPORT table with "/" character

Patrice1
Explorer
0 Kudos

Hello All

I do not find how to export/import tables with slahes

i read that tables with slashes should be double-quoted in SQL statements.

with export/import command seems it doesn't work

here is my command :

hdbsql -U CLONE "EXPORT schema.'"/BDL/_GENER"' AS BINARY INTO '/mnt/SAP/clone/SID/BR' WITH REPLACE THREADS 12"

i try with '"/table"' or "/table" no way

always the error :

* 257: sql syntax error: incorrect syntax near "/BDL/_GENER": line 1 col 15 (at pos 15) SQLSTATE: HY000

any idea?

thank you very much for your help

regards

Patrice

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

As for Lars's suggestion:

It's -I option. i.e. a capital i, not a lowercase l !

Or in case you prefer to do without an input script:

Starting from the command in your original post, the correct way of Linux special character escaping is this:

hdbsql -U CLONE "EXPORT schema.\"/BDL/_GENER\" AS BINARY INTO '/mnt/SAP/clone/SID/BR' WITH REPLACE THREADS 12"

Mind the \" around your table name!

regards

Patrice1
Explorer
0 Kudos

Hello Josef, Lars

thank you very much for your answers

it works now for the two way.

best regards

Patrice

Answers (1)

Answers (1)

lbreddemann
Active Contributor
0 Kudos

You're just hitting the limits of special character escaping in your shell.

Why don't you make your life easy and put the command into a script file that you then refer to with the -I option?

- Lars

Patrice1
Explorer
0 Kudos

Hello Lars

thank you fisrt for your reply.

i tried this with the -l option but without success.

i execute the command : hdbsql -U CLONE -l export.sql

i got the following :

Welcome to the SAP HANA Database interactive terminal.

Type:  \h for help with commands
       \q to quit

hdbsql=>

i have to press enter to get the DB prompt and then that's all, nothing else!?!

in my export.sql file i have the following:

EXPORT schema./BDL/_GENER AS BINARY INTO '/mnt/SAP/clone/SID/BR' WITH REPLACE THREADS 12

what do i do wrong?

can i get rid of this "hdbsql=>" prompt?

thank you for your help

best regards

Patrice

lbreddemann
Active Contributor
0 Kudos

Have you tried your CLONE hdbuserkey to work properly?

Also: the double quotes for the / in your object names are still required.

So your export.sql should contain


EXPORT schema."/BDL/_GENER" AS BINARY INTO '/mnt/SAP/clone/SID/BR' WITH REPLACE THREADS 12


Also, I assume that you replace "schema" with the actual schema name, don't you?


Patrice1
Explorer
0 Kudos

yes my CLONE hdbuserkey work properly

example:

hdbsql -U clone "\s"
host          : dtcgembwdbt01:30015
database      : TB1
user          : SAPRBW
kernel version: 1.00.74.04.393829
SQLDBC version: libSQLDBCHDB 1.00.74.04 Build 0393829-1510
autocommit    : ON
locale        : C
input encoding: UTF8

or hdbsql -U clone -x -a "select value from M_SYSTEM_OVERVIEW where name='Instance Number'"

work fine

so my export.sql file is like you said

but the result of my command  hdbsql -U CLONE -l export.sql is

Welcome to the SAP HANA Database interactive terminal.

Type:  \h for help with commands
       \q to quit

hdbsql=>

why?

thank's

Patrice