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: Rajesh Sharma <sharmar at ms dot com>
Subject: Re: BCP difficulties
Date: Oct 31 1997 5:06PM

On Oct 30, 11:40am,  wrote:
> Subject: BCP difficulties
>
>      Greetings,
>
>      Sybase 11.0.2, Sybase::DBlib, Perl 5.004
>
>      I recently modified a script I wrote some time back, and the original
>      script works fine and is almost in production.  I needed to modify
>      the script for a different project, and now I am getting the following
>      errors when I try to run it:
>
>      Server 'ERISDVLP', Line 1
>              The front end tool you are using does not support the feature
>      of bulk insert from host, please use the proper tools for this
>      command.
>      DB-Library error:
>              General SQL Server error: Check messages from the SQL Server.
>      DB-Library error:
>              bcp_init() must be called before any other bcp routines.
>
>
>      The last line get repeated several times until the script finally
>      dies.  Below is my main bcp routine.  This routine works in my
>      other script...any ideas/insight?  The line that bothers me the most
>      is the first one re: front-end tool.
>
>      Thanks guys..
>
>      -- Sal
>
>       ################################################
>
>      sub bcp_it {
>
>          my $err_file = "./bcp.errors";
>          my ($dbh, $tablename, $cols, $textfile) = @_;
>          my $bcp_string = "corpdir_test" . ".dbo." . $tablename;
>          my $delimiter = "\|";
>
>          &BCP_SETL(TRUE);
>
>          $dbh->bcp_init($bcp_string, undef, $err_file, DB_IN);
>
>          $dbh->bcp_meminit($cols);
>
>          open(DOWNLOAD, $textfile) || die "Fatal: couldn't open
>                 $textfile.\n";
>
>          while() {
>
>         next if ($_ == "\n");
>
>         chop;
>
>         @data = split(/\Q$delimiter\E/);
>
>         &exception (@data) if ($dbh->bcp_sendrow(@data) == FAIL);
>
>         ++$count;
>
>         if (($count % 1000) == 0) { $ret = $dbh->bcp_batch }
>
>          }
>
>          $ret = $dbh->bcp_done;
>
>      }
>-- End of excerpt from 



-- 
_________________________________________________________________
    _/_/_/_/_/   _/_/_/_/_/           Rajesh Sharma
   _/      _/   _/                    Morgan Stanley
  _/_/_/_/_/   _/_/_/_/_/         750 7th Ave., 7th Floor
 _/    _/             _/            New York, NY 10019
_/      _/   _/_/_/_/_/         212-762-2375(W), 212-762-0527(F)
                                sharmar@ms.com, http://www.ms.com