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: "Sabherwal, Balvinder (MBS)" <Balvinder dot Sabherwal at mortgagefamily dot com>
Subject: Sybase::Blk
Date: Aug 9 2004 3:30PM

I have a script as below that I'm trying to execute. I want to do a select *
from one table and insert into another table without writing the data to a
flat file. When I execute the script, I get error as below

 

$ x.pl   

Connection OK to Server

INPUT parameter is a ref but not a CODE ref at x.pl line 24

 

What is that I'm missing here? Is it doable what I'm trying in here?

 

Thanks for all your help.

 

 

#!/usr/local/ActivePerl-5.6/bin/perl

use Sybase::CTlib;

use Sybase::BLK;

 

 

$dbh = Sybase::CTlib->ct_connect('MyUser','password',SYB_UNIX);

 

if($dbh eq undef)

{

        print "Connection Failed to Server\n";

}

else

{

        print "Connection OK to Server\n";

}

 

 

 

 

    $bcp = new Sybase::BLK MyUser, 'password', SYB_UNIX;

    $bcp->config(INPUT => getdata($dbh),

                 OUTPUT => 'BatchControl.dbo.b',

                 BATCH_SIZE => 200);

    $bcp->run;

 

sub getdata

{

   ( $dbh ) = @_;

   $data=$dbh->ct_sql('select * from BatchControl.dbo.a');

   return $data;

}