Ea has asked for the wisdom of the Perl Monks concerning the following question:

Hi all,

I'm trying to dbicdump an Oracle database and I get a fatal error on a table that I'm not even interested in. ORA-24345: A Truncation or null fetch error occurred (DBD ERROR: ORA-01406 error on field 1 of 1, ora_type 8,LongReadLen too small and/or LongTruncOk not set

How can I tell dbicdump that I only want certain tables or views? I'm not seeing anything likely using the -o switches.

Many thanks,

Edit: looking at constraints and trying to get them to work.

Ea

Sometimes I can think of 6 impossible LDAP attributes before breakfast.

YAPC::Europe::2018 — Hmmm, need to talk to work about sending me there or to Mojoconf.

Replies are listed 'Best First'.
Re: dbicdump selected tables
by 1nickt (Canon) on Dec 12, 2018 at 16:46 UTC
      Yes, it works, although I swear that I had that an hour ago and it didn't <sigh>

      I finally passed through the argument that fixed the error {LongTruncOk => 1}, removed the extraneous quotes that I had introduced around the constraint and all of a sudden it works even better than I wanted it to an hour ago.

      have you ever wanted to strangle a bit of code?

      Thanks!

      Edit

      For completeness, here's the code fragment that works
      my @args = ('-o', 'dump_directory='. $root .'/lib/', '-o', q/components=["InflateColumn::DateTime"]/, '-o', 'constraint=qr/'. $table_prefix .'/', 'Timetable::Schema', "dbi:Oracle:$database", $username, $password, '{ LongTruncOk => 1 }', ); system( '/usr/local/bin/dbicdump', @args );
      which I'm re-writing to use DBIx::Class::Schema::Loader

      Ea

      Sometimes I can think of 6 impossible LDAP attributes before breakfast.

      YAPC::Europe::2018 — Hmmm, need to talk to work about sending me there or to Mojoconf.