Support Questions

Find answers, ask questions, and share your expertise

Sqoop import data using stored procedure

avatar
Rising Star
Hi,
 
I have a Stored Procedure (that runs a select query ) to import data from a DB2 database
 
How can I use it in sqoop?
I'm using the version 1.4.4-cdh5.0.2 of sqoop
 
 
I have tried to launch this command:
 
sqoop import --verbose --connect jdbc:db2://hostname:5300/db --username username --password password  --call NameStoredProcedure -m 1 --target-dir /tmp/DeltaY0/

 

 
But this doesn't work !!!
 
Have you any idea ? How can I solve it ?
 
Thanks
Alessio
 
 
 
 
1 ACCEPTED SOLUTION

avatar
Expert Contributor
Stored procedures are an export only feature. See https://issues.apache.org/jira/browse/SQOOP-769 for more information.

View solution in original post

4 REPLIES 4

avatar
Expert Contributor
Stored procedures are an export only feature. See https://issues.apache.org/jira/browse/SQOOP-769 for more information.

avatar
New Contributor

 How do we import more than one table in sqoop, lets say i have two table one is employee and other one is department and both are having primary-foreign key constraints , i want to import some columns from employee table and some from department based on primary-foreign key.

avatar
New Contributor

2 options.

 

1) import all the data (it's called big data for a reason)

 

2) create a View in your RDBS and sqoop will treat that like a table.

 

Cheers

Pete

 

avatar
New Contributor

for this requirment you can write join quiry withing sqoop import statement..coz of this u can import only required data in hadoop ecosystem.