freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: "MATSUMOTO, Tadashi" <pineroot AT yahoo.co.jp>
- To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
- Subject: [freetds] missing records by bulk insert
- Date: Fri, 16 Nov 2007 22:33:03 +0900
Hi all,
I'm using FreeTds 0.64.
By using bulk library of ctlib/blk.c, I'm attempting to "bulk insert".
After calling "blk_rowxfer()" one record by one record,
error doesn't occur in executing "blk_done(blkdesc, CS_BLK_BATCH, &count) "
for five records in all.
But error ,as follows, occurred in executing "blk_done()" for six records in
all.
**************
Client Library error:
severity(0) number(38) origin(0) layer(0)
Write to SQL Server failed.
Client Library error:
severity(0) number(140) origin(5) layer(2)
blk_done: blk layer: intl library error: Failed when processing
results from server.
**************
In this case,only 3 head records are inserted into the table.
For example:
date item_cd iss_cd data updt_id updt_date updt_time
20051230 item000 iss000 1.1415
blktest 20071110 1200
20051230 item000 iss000 2.1415
blktest 20071110 1200
20051230 item000 iss000 3.1415
blktest 20071110 1200
And Evnet-Logs of " Event-ID 4014" from SQL Server occurred.
The number of execution parameters of the test program are 5;
SQLServer、 DB-Login、DB-password、the number of calling lines ,and the number
of CS_BLK_BATCH lines.
The success case( which is 5 records case) of TDSDUMP is "tdsdump-ok.txt",and
the error case ( which is 6 records case) of TDSDUMP is "tdsdump-err.txt.
And, error doesn't occur if we add "tds_set_state(tds, TDS_QUERYING);"
to CS_BLK_BATCH in blk_done() of ctlib/blk.c after "tds->out_flag = TDS_BULK;"
Thanks.
diff -r -u -1 -0 /opt/freetds_dev/freetds-0.64.org2/src/ctlib/blk.c
/opt/freetds_dev/freetds-0.64/src/ctlib/blk.c
--- /opt/freetds_dev/freetds-0.64.org2/src/ctlib/blk.c Tue Nov 13 15:32:46
2007
+++ /opt/freetds_dev/freetds-0.64/src/ctlib/blk.c Tue Nov 13 15:36:14
2007
@@ -246,20 +246,21 @@
if (outrow)
*outrow = tds->rows_affected;
tds_submit_query(tds, blkdesc->insert_stmt);
if (tds_process_simple_query(tds) != TDS_SUCCEED) {
_ctclient_msg(blkdesc->con, "blk_done", 2, 5, 1, 140,
"");
return CS_FAIL;
}
tds->out_flag = TDS_BULK;
+ tds_set_state(tds, TDS_QUERYING);
if (IS_TDS7_PLUS(tds)) {
_blk_send_colmetadata(blkdesc);
}
break;
case CS_BLK_ALL:
tds_flush_packet(tds);
Attachment:
to_ML_20071112.zip
Description: Zip compressed data
-
[freetds] missing records by bulk insert,
MATSUMOTO, Tadashi, 11/16/2007
- Re: [freetds] missing records by bulk insert, James K. Lowden, 11/16/2007
Archive powered by MHonArc 2.6.24.