QUICK DESCRIPTION Bulk copies data into a Sybase table. Data sources can include a) another Sybase table, b) the results of any sql, c) the return values from a perl subroutine called repetitively, or d) a flat file. Comes with robust error reporting, handling, and intercepting and perl call back hooks to intercept data before it's sent to the server and after (if errors.) Also comes with a command line wrapper, sybxfer. SYNOPSIS #!/usr/bin/perl use Sybase::Xfer; my %switches = (-from_server=>'CIA', -to_server=>'NSA', -table => 'x-files'); my $h = Sybase::Xfer->new( %switches ); my %status = $h->xfer(-return=>"HASH"); print "xref failed. $status{last_error_msg}\n" unless $status{ok}; #!/bin/ksh sybxfer -from_server 'CIA' -to_server 'NSA' -table 'x-files' if [[ $? != 0 ]]; then print "transfer problems"; fi INSTALLATION (the usual) perl Makefile.PL [ LIB= ] make make test make install DEPENDENCIES Requires Perl Version 5.005 or beyond Requires packages: Sybase::DBlib CONTACTS my e-mail: stephen.sprague@morganstanley.com CHANGE LOG: ------------------------ Version 0.51 15-jun-2001 ------------------------ * added -to_database documentation (Suresh Balakrishnan) * added use 5.005. (Merijn Broeren) * added new option -timeout [secs] (Ron Isaacson) * added new option, -drop_and_recreate_indices | dari [syts:server.database] instructs xfer to drop the indices on the target table before the transfer begins and to recreate them after the transfer is complete. * defined scalar return context of method xfer as follows: 0 = success w/o any hitches >0 = success w/ n number of rows not transferred -1 = aborted. unrecoverable error -2 = aborted. interrupt signal -3 = aborted. timeout signal * added above scalar return code as 4th element to list return context. ie. array is as follows: [0] = num rows read from source [1] = num rows transferred to target [2] = last known error message [3] = scalar return code * new switch added. -return=> 'HASH' | 'ARRAY' | 'SCALAR' default is SCALAR if called in scalar context and ARRAY if called in list context. This is backward compatible default behavior. However, if HASH is specified the method will now return: {rows_read} = number of rows read from target {rows_transferred} = number of rows transferred to target {last_error_msg} = last error message encountered {scalar_return} = scalar return. see above. {ok} = 1 if all rows were transferred regardless of retries or warnings along the way. = 0 if not * added 'Xfer info' portion to std out. This echoes -from_table, -to_table and logs pre-xfer activities like deleting rows, truncating table, dropping indices etc. * can now specify -to_table as: [source.][server.][database.][owner.][table] where source = 'Sybase' is the only supported source right now. -to_table settings override -to_server, -to_database settings. * fixed double mapping bug when using -from_file_map. Also, can now use -from_file_map with any source. * fixed bug with -retry_verbose (Ilya Shulimovich) * fixed bug when using -from_file and file had trailing null fields. (Thomas Boccafola) * rigorous deadlock testing performed by Ilya Shulimovich (i think) * huge thanks to Ron Isaacson for enlightening me on many various perl oddities and for volunteering to help me with more releases of this module. Hell, he's even starting in own xfer module that'll stretch past this one. * documentation on error handling expanded. * added documentation in the bugs section that -to_tables residing on Sybase Openserver's are not supported for the target table. (Peter Somu)