Michael Peppler
Sybase Consulting
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
Sybase on Linux FAQ
Sybperl FAQ
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Charles_Mire at Concentra dot com
Subject: Re: issues with Sybase::BLK
Date: Aug 18 2005 3:24PM

O.k. -- we got the library from one of our other servers and that resolved
the blk_alloc issue.

Now I've got a new issue when calling the method 'config' for Sybase::BLK.

Open Client Message:
Message number: LAYER = (6) ORIGIN = (8) SEVERITY = (5) NUMBER = (1)
Message String: ct_connect(): directory service layer: internal directory
control layer error: There was an error encountered while binding to the
directory service.
connection failed... at
 line 363.
Can't call method "config" on an undefined value at ./ line 60
    (F) You used the syntax of a method call, but the slot filled by the
    object reference or package name contains an undefined value.
    like this will reproduce the error:

        $BADREF = undef;
        process $BADREF 1,2,3;

Uncaught exception from user code:
        Can't call method "config" on an undefined value at ./
line 60.

All my variables are populated (they are hard-coded in the beginning of my
test script), so I'm not sure which value is ending up as undefined, or how
to debug to narrow it down.  I've eliminated the lines that were commented
out, but it seems like I need the rest, so I can't just do a process of
elimination.  The table defined in OUTPUT does exist and has correct
permissions for the user.  The columns listed are valid columns, and as the
table only has 5 columns (4 for data and 1 for identity), all columns are
accounted for in the config.  The BATCH_SIZE is set to 1000, but the test
file "out.file" only has a dozen or so rows -- it doesn't seem that it's
required to match the batch size.

     my $bcp = new Sybase::BLK $username, $password, $dbServer;
     $bcp->config(INPUT => 'out.file',
                 OUTPUT => 'db1.dbo.bcp_test',
                 BATCH_SIZE => 1000,
                 HAS_IDENTITY => 0,
                 IDENTITY_COL => 4,
                 REORDER => {1 => 'first_name',
                             2 => 'full_name',
                             4 => 'last_name',
                             3 => 'creation_dt'
                 SEPARATOR => '\|');

Thanks much -- Charles

Charles Mire
Programmer Analyst
ph. 972.364.8132

|         |                   "Michael       |
|         |                   Peppler"       |
|         |                           |
|         |                   Sent by:       |
|         |                   owner-sybperl-l|
|         |            |
|         |                   08/18/2005     |
|         |           12:19 AM               |
|         |                                  |
  |                                                                                                                        |
  |    To:                                                                             |
  |    cc:                                                                                  |
  |    Subject:       Re: issues with Sybase::BLK                                                                          |

On Wed, 2005-08-17 at 14:40 -0500, wrote:
> I'm having issues trying to do a bulk load using Sybase::BLK.  I've
> successfully used Sybase::BCP already, but I've found that it only works
> for tables without an identity column.  For tables with an identity
> it is my understanding that one must use Sybase::BLK.
> This is the error I'm getting:
> fatal: relocation error: file

>  symbol blk_alloc: referenced symbol not found

That's an installation (i.e. a Sybase installation) problem. The issue
is that your Sybase OCS install does not include the appropriate
libblk.a file. This is usually the case when you are on a 64bit version
of ASE but build sybperl in 32bit mode. Sybase usually doesn't include
the 32bit libblk.a library in this situation.

You need to talk to your DBAs and/or Sybase to get libblk.a (probably by
installing the OCS SDK.)

Michael Peppler  -  -
Sybase DBA/Developer
Sybase on Linux FAQ:

NOTICE: This e-mail message and all attachments transmitted with it may contain legally privileged and confidential information intended solely for the use of the addressee. If the reader of this message is not the intended recipient, you are hereby notified that any reading, dissemination, distribution, copying, or other use of this message or its attachments is strictly prohibited. If you have received this message in error, please notify the sender immediately and delete this message from your system. Thank you.