Reputation: 73
I would like to know if I will be able to execute a procedure and get results in Sqoop import command. I am not able to find any such scenario in the web. Please help
Upvotes: 0
Views: 2704
Reputation: 21
Sqoop export has a stored procedure parameter but you have to also provide a table that will be evaluated with the stored procedure.
If you want to "execute Stored_procedure" in oracle from sqoop you need to use eval and in the query use the SQL*plus execute command: 'BEGIN STORED_PROCEDURE; END;'
example: sqoop eval -Dmapred.job.queue.name=root.test.test-mis --connect jdbc:oracle:thin:@SERVER.NAME:PORT:INSTANCE --password **** --username MYSCHEMA --query "BEGIN MYSCHEMA.TEST_STORED_PROCEDURE_NAME; END;"
Upvotes: 0
Reputation: 11
I have tried something like this and it worked :
sqoop import --connect "jdbc:sqlserver://localhost;database=FADA" --username [name] --password [pdw] --query "print case when $CONDITIONS then 'yep' else 'yip' end exec dbo.ps" --target-dir /DIR/Psimport -m 1
Upvotes: 1
Reputation: 26
Have you tried the --query option in sqoop? The documentation for this option is here: http://sqoop.apache.org/docs/1.4.5/SqoopUserGuide.html#_free_form_query_imports
Upvotes: 0
Reputation: 163
https://issues.apache.org/jira/browse/SQOOP-769
It seems like Sqoop does not support it. Can you please let me know if there are any other tools which will help me to extract data from SQL server to HDFS
Upvotes: 0