Using Sqoop1 with SAP Hana using a table name that contains forward slash '/' causes error

北战南征 提交于 2019-12-13 07:29:48

问题


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)


回答1:


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.




回答2:


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" 



回答3:


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




回答4:


Updated to latest version of JDBC driver for SAP Hana.



来源:https://stackoverflow.com/questions/37356777/using-sqoop1-with-sap-hana-using-a-table-name-that-contains-forward-slash-ca

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!