Skip to Content.
Sympa Menu

freetds - RE: [freetds] freebcp bulk load wont work with -f option

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Lowden, James K" <LowdenJK AT bernstein.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] freebcp bulk load wont work with -f option
  • Date: Wed, 28 May 2003 17:33:23 -0400

> From: Pothen, Abi [mailto:APothen AT nb.com]
> Sent: May 28, 2003 10:52 AM
>
> Freebcp utility has problem dealing with idenity fields and
> fields with defaults.

Thanks for the clear test case, Abi.

There was some discussion of identity columns recently (search the ML
archives for "identity" around 23 April). freebcp doesn't know about
identity columns, and doesn't ask the server to do anything special with
them. The same is true for defaults.

Microsoft and Sybase handle loading/generating identity column values
differently; I haven't even looked into default values.

Support for these things won't require any fundamental changes, but at the
moment we have our hands full with character set issues.

The workaround you already know: Load another table instead, then insert
into the real table by selecting from temporary one.

--jkl

>
> Please consider following example:
>
> CREATE TABLE [dbo].[test] (
> [FLD_IDENT] [numeric](18, 0) IDENTITY (1, 1) NOT NULL ,
> [FLD_VCHAR] [varchar] (15) NOT NULL ,
> [FLD_NUM] [numeric](22, 7) NULL
> )
>
> test.dat
> --------
> 100 TESTSCORE1 99.90
> 120 TESTSCORE2 98.40
> 130 TESTSCORE3 97.20
> 140 TESTSCORE4 96.10
>
> test.fmt
> --------
>
> 7.0
> 3
> 1 SYBCHAR 0 10 "\t" 0 FLD_IDENT
> 2 SYBCHAR 0 10 "\t" 2 FLD_VCHAR
> 3 SYBCHAR 0 10 "\n" 3 FLD_NUM
>
>
> test_1.fmt
> ----------
>
> 7.0
> 3
> 1 SYBCHAR 0 10 "\t" 1 FLD_IDENT
> 2 SYBCHAR 0 10 "\t" 2 FLD_VCHAR
> 3 SYBCHAR 0 10 "\n" 3 FLD_NUM
>
>
> When I use test.fmt, bcp fails with "Segmentation Fault (core dumped)"
> freebcp testdb.dbo.test in test.dat -f test.fmt -S
> SQLSERVER -U user -P
> password
>
> When I use test_1.fmt, bcp works
> freebcp testdb.dbo.test in test.dat -f test_1.fmt -S
> SQLSERVER -U user -P
> password
>
> Native bcp supports both the above cases without any problem.
>
> Can anyone please suggest any workarounds ?
>
>
> Thanks.
>
>
> -----Original Message-----
> From: Pothen, Abi
> Sent: Tuesday, May 27, 2003 3:27 PM
> To: 'FreeTDS Development Group'
> Subject: [freetds] freebcp bulk load wont work with -f option
>
>
>
> Hi,
>
> I have successfully installed FreeTds 0.61 in a Sun Solaris
> box to access
> MSSQL2K on WIN2K server and I am trying to use the freebcp
> utility ( with -f
> option) to bulk copy data into a table.
>
> But, bcp is failing with the following error message:
>
> Msg 20102, Level 7
> Unrecognized datatype found in format-file.
>
> When I searched the freetds mailing list archive, I have seen
> the similar
> problem posted with freetds 0.60 (
> https://lists.ibiblio.org/sympa/arc/freetds/2002q4/010205.html
> ) and the
> suggestion was to use its latest snapshot.
> I was wondering whether this problem has been fixed with the
> freetds 0.61
> version ?
>
> I have tried both tds versions 7.0 and 8.0.
>
> Thanks for your help.
> Abi.
>
>
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
> This message contains confidential information and is
> intended only for the
> individual named. If you are not the named addressee you should not
> disseminate, distribute or copy this e-mail. Please notify the sender
> immediately by e-mail if you have received this e-mail by
> mistake and delete
> this e-mail from your system.
> E-mail transmission cannot be guaranteed to be secure or
> error-free. The
> sender therefore does not accept liability for any errors or
> omissions in
> the contents of this message that arise as a result of e-mail
> transmission.
> This message is provided for informational purposes and should not be
> construed as a solicitation or offer to buy or sell any securities or
> related financial instruments.
> All e-mails at Neuberger Berman are, in accordance with Firm
> policy, to be
> used for Neuberger Berman business purposes only. E-mails
> sent from or to
> the Firm are subject to being reviewed by the Firm in
> accordance with the
> Firm's procedure for the review of correspondence
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
>
-----------------------------------------
The information contained in this transmission may contain privileged and
confidential information and is intended only for the use of the person(s)
named above. If you are not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient, any
review, dissemination, distribution or duplication of this communication is
strictly prohibited. If you are not the intended recipient, please contact
the sender immediately by reply e-mail and destroy all copies of the original
message. Please note that we do not accept account orders and/or instructions
by e-mail, and therefore will not be responsible for carrying out such orders
and/or instructions.






Archive powered by MHonArc 2.6.24.

Top of Page