Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Store Pig output to Oracle using DBStorage

Highlighted

Store Pig output to Oracle using DBStorage

Rising Star

Hi,

Would really appreciate if somebody can give me pointers how can I store the pig output using DBStorage to Oracle.

Below is my sample script :

REGISTER /TestDivya/Pig/ojdbc6.jar ;
REGISTER /TestDivya/Pig/piggybank-0.15.0.jar ;
A = LOAD '/tmp/TestDivya/Pig/PigTest.txt' using PigStorage(',') as (name: chararray, age: int);
STORE A into 'dummy' using org.apache.pig.piggybank.storage.DBStorage('oracle.jdbc.driver.OracleDriver','jdbc:oracle:thin:@xx.xxx.xxx.xx:1521:db_name','db_username','db_password','insert into TEST values(?,?)');
1 REPLY 1

Re: Store Pig output to Oracle using DBStorage

Mentor

@Divya Gehlot here's general dbstorage info. Link and examples

Don't have an account?
Coming from Hortonworks? Activate your account here