0
votes

Trying to import data from SAP Hana using table that contains a forward slash '/'. Not sure if escaping the '/' will work.

My connection attempt:

sqoop import –connect jdbc:sap://mysaphost:30015 --driver com.sap.db.jdbc.Driver --username xxxxxx --password xxxx --table xxx./xxx/xxx

Produces the following error:

2016-05-20 13:12:23,098 ERROR - [main:] ~ Error executing statement: com.sap.db.jdbc.exceptions.JDBCDriverException: SAP DBTech JDBC: [257]: sql syntax error: incorrect syntax near "/": line 1 col 24 (at pos 24) (SqlManager:43) com.sap.db.jdbc.exceptions.JDBCDriverException: SAP DBTech JDBC: [257]: sql syntax error: incorrect syntax near "/": line 1 col 24 (at pos 24)

4

4 Answers

0
votes

In order to use object names with slashes (or other special characters) you need to enclose them into double quotation marks (").

As you seem to use a command line interface and want to pass the table name as an argument, you most likely have to escape those quotation.

Try something like

sqoop import –connect jdbc:sap://mysaphost:30015 --driver com.sap.db.jdbc.Driver 
--username xxxxxx --password xxxx --table \"xxx./xxx/xxx\"

(still just one line!) and see how that goes.

0
votes

Not sure, But maybe you can just try to enclose table name with double quotations (")

sqoop import –connect jdbc:sap://mysaphost:30015 --driver com.sap.db.jdbc.Driver --username xxxxxx --password xxxx --table xxx."/xxx/xxx" 
0
votes

Can you try something like --table "XXX".\" XYZ\"

0
votes

Updated to latest version of JDBC driver for SAP Hana.