Skip to Content.
Sympa Menu

freetds - [freetds] dbsqlok hangs following a dbwritetext()

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Navdeep Shergill" <jatshergill AT gmail.com>
  • To: freetds AT lists.ibiblio.org
  • Subject: [freetds] dbsqlok hangs following a dbwritetext()
  • Date: Mon, 5 Feb 2007 20:33:44 -0800

Hi all
I am using FreeTDS v0.64. I am running in on a windows machine,
while connecting to a SQL2000 server. Basically; I am trying to upload a
file to the database. The field in the table is type 'image'. I am following
the code listed in the unittest: t0013.c. I have found that my program is
hanging on the 'dbsqlok' command following a 'dbwritetext()'. Here is
relevant code; from the unit test.

=====================
sprintf(cmd, "insert into test_attachment(test_id,name,title,content)
values (10019,'test','testing file', '')");
fprintf(stdout, "%s\n", cmd);
dbcmd(dbproc, cmd);
dbsqlexec(dbproc);
while (dbresults(dbproc) != NO_MORE_RESULTS) {
/* nop */
}

sprintf(sqlCmd, "select content FROM test_attachment WHERE test_id =
10019");
dbcmd(dbproc, sqlCmd);
dbsqlexec(dbproc);
if (dbresults(dbproc) != SUCCEED) {
fprintf(stderr, "Error inserting blob\n");
return 4;
}

while ((result = dbnextrow(dbproc)) != NO_MORE_ROWS) {
result = REG_ROW;
result = DBTXPLEN;
strcpy(objname, "test_attachment.content");
textPtr = dbtxptr(dbproc, 1);
timeStamp = dbtxtimestamp(dbproc, 1);
}

if (dbwritetext(dbproc, objname, textPtr, DBTXPLEN, timeStamp, FALSE,
123435, NULL) != SUCCEED)
return 15;
dbsqlok(dbproc);
dbresults(dbproc);
================================================

So it is hanging on the last 'dbsqlok'.

Does anyone have the same experience? Can you issue a pointer to me?

Thanks!



  • [freetds] dbsqlok hangs following a dbwritetext(), Navdeep Shergill, 02/05/2007

Archive powered by MHonArc 2.6.24.

Top of Page