Skip to Content.
Sympa Menu

freetds - RE: [freetds] SQLRowCount failing after prepare and execute

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "ZIGLIO, Frediano, VF-IT" <Frediano.Ziglio AT vodafone.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] SQLRowCount failing after prepare and execute
  • Date: Mon, 16 Feb 2004 14:20:11 +0100

>
> Freddy,
>
> might we be able to use that short on the DONEINPROC to help
> us (remember the RAISERROR thing ?)
>
> If you send me the complete output packet from a prepared
>
> "select * from #tmp where i=2 delete from #tmp"
>
> and a prepared
>
> "delete from #tmp select * from #tmp where i=2"
>
> I might be able to find out some values :-)
>
> Bill
>
>

Ok, this is the code

#include "common.h"

/* Test for SQLPrepare */

static char software_version[] = "$Id$";
static void *no_unused_var_warn[] = { software_version,
no_unused_var_warn };

int
main(int argc, char *argv[])
{
Connect();

Command(Statement, "create table #tmp (i int) insert into #tmp
values(1)");

if (SQLPrepare(Statement, (SQLCHAR *) "delete from #tmp select *
from #tmp where i=2", SQL_NTS) != SQL_SUCCESS) {
printf("Unable to prepare statement\n");
exit(1);
}

if (SQLExecute(Statement) != SQL_SUCCESS) {
printf("Wrong result executing statement\n");
exit(1);
}

while(SQLMoreResults(Statement) == SQL_SUCCESS);

Disconnect();

printf("Done.\n");
return 0;
}

Outputs attached

freddy77

Attachment: out1.txt.gz
Description: out1.txt.gz

Attachment: out.txt.gz
Description: out.txt.gz




Archive powered by MHonArc 2.6.24.

Top of Page