Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

I like to look at database issues but I've never used this module. It looks pretty awesome. So as curious as I was I decided to try it. In order to replicate the issue I made a little sample script. When I tried to use:

$oDB_Comparison->deep_compare(@aTable_Names);

I get several errors that are very familiar to me from some work with DBIx::Class. You need to have tables defined a certain way in DBIx::Class for the deep->compare to work (or so it seems to me). But you can use the basic compare without seeing the errors:

$oDB_Comparison->compare(@tables);

Also, unless I have this line in my code:

$oDB_Comparison->verbose;

no results print, so you want to add that in I think. You need to check your definition of $dbh1 and $dbh2 like mje said.

my $dbh1 = DBI->connect('DBI:DATABASE_TYPE:DATABASE_NAME:DATABASE_SERV +ER','USERNAME','PASSWORD') || die "Error Connecting to \$dbh1: ".$DBI +::errstr."\n";

Also see DBIx::Class

#!/usr/bin/perl use strict; use warnings; use DBI; use DBIx::Compare; my $dbh1 = #SEE sample connect line above my $dbh2 = #SEE sample connect line above my $oDB_Comparison = db_comparison->new($dbh1, $dbh2); my @tables = ('Table1', 'Table2); $oDB_Comparison->verbose; $oDB_Comparison->compare(@tables);

In reply to Re^2: Even though there are two separate database handles error shows need two separate database handles to compare by wallisds
in thread Even though there are two separate database handles error shows need two separate database handles to compare by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-04-19 19:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found