PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Michael Peppler <mpeppler at MBAY dot NET>
Subject: bcp sql
Date: Sep 15 1998 11:48PM

Lian Hang writes:
 > I'm trying to copy selected rows from table in 
 > one database and archive them to another.  I like to avoid writing 15
 > different inserts and select 
 > functions and was wondering if sybperl support
 > bcp like query methods where I can selectively query
 > rows to be copied out in bcp format.  Any suggestions?

In general I do:

$" = "\t";
open(OUT, ">the_table.bcp");
$dbh->sql("select * from the_table where $condition", 
	sub { print OUT "@_\n"; });

Or did I mis-understand the question?

Michael
-- 
Michael Peppler         -||-  Data Migrations Inc.
mpeppler@mbay.net       -||-  http://www.mbay.net/~mpeppler
Int. Sybase User Group  -||-  http://www.isug.com