0

Need to take each value from a column( say string) of a table (bucket) in Database1, then query for the same value under the same column name and table name in Database2.

is there an option to do that???

Need help...

1
  • can something like this be done?? pls help with syntax... DBI->connect( database1 ); 'SELECT string FROM bucket' foreach(value in string){ DBI->connect( database2); 'SELECT id,name,string FROM bucket where string = string of db1' Commented Feb 16, 2012 at 5:10

1 Answer 1

1

You can join the two databases with a statement similar to below. Of course putting in your database informaiton

SELECT database1.bucket.stringcolumn, database2.bucket.stringcolumn 
  FROM arbogast.node, mcguffin.node 
  WHERE database1.bucket.stringcolumn = Value 
   AND database1.bucket.stringcolumn = database2.bucket.stringcolumn;

Reference: http://www.dottedidesign.com/node/14

Sign up to request clarification or add additional context in comments.

2 Comments

I don't see why not. You just need to put it in the proper perl syntax. Check out this link: tizag.com/perlT/perldbiquery.php
Please do not link to Tizag. As of early 2012, it is probably the worst tutorial in the world. - The official documentation is on dbi.perl.org

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.