Search code examples
sqlsybasebcp

bcp error: conversion/operation resulted in overflow


I have a text file with 8-digit numbers that I want to copy into a Sybase table that I created as:

create table foo ( id numeric(20) )

I'm using numeric so I can join with another numeric column in an existing table.

The format information from my bcp command is: 10.0 1 1 SYBNUMERIC 1 12 "\n" 1 id 20 0

The bcp copy fails with the following message repeated several times:

CSLIB Message: - L0/O0/S0/N20/1/0: cs_convert: cslib user api layer: common library error: The conversion/operation resulted in overflow.

I don't see any numbers that could cause an overflow in my input text file.

Any suggestion on how I might copy this data and/or why this is failing? Thanks!


Solution

  • I altered my table for id to be int. bcp did not error out but the data was incorrect.

    So I altered the table for id as a varchar and bcp worked fine. Then I altered the id back to numeric(20) and it works.

    This does not solve the bcp question but did give me a solution to get at the data I need which is the real goal.