Skip to Content.
Sympa Menu

freetds - Re: [freetds] bcp timestamp trace

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT schemamania.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] bcp timestamp trace
  • Date: Wed, 7 Apr 2004 01:49:52 -0400

On Mon, 5 Apr, "Lowden, James K" <LowdenJK AT bernstein.com> wrote:
>
> 2. "insert bulk dbname..tablename (ts int)".
>
> The DDL for the table:
>
> CREATE TABLE ts (ts int, cc timestamp)
>
> So (in contradiction to comments I just committed), the timestamp column
> is simply omitted from the query.

I spent a couple of hours looking at how to handle this.

Basically, we want to pretend the target table has no timestamp column,
and we want to ignore the timestamp data in the file. That's very similar
to what a bcp format file can do, IIRC. Trouble is, that code is
uncommented and, well, not as transparent as glass. And I can't seem to
find the format of bcp.fmt on Sybase's site.

The strategy I have in mind: when we read the table metadata from the
server, mark any timestamp column (user data type 0x50) as "do not load".
When building the bulk insert statement, exclude that column. When
reading the datafile, skip it, and do not allocate a field in the row
buffer for the data. It seems to me there should be some way to indicate
that a datafile column does not map to any column in the target table,
but, again, I didn't find a way.

So, Bill, when you read this, I'd be interested in your thoughts.

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page