Skip to Content.
Sympa Menu

freetds - [freetds] Problem with SQLPrepare and Sybase ASA 9

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Michael Koch <michael AT michsoft.de>
  • To: freetds AT lists.ibiblio.org
  • Subject: [freetds] Problem with SQLPrepare and Sybase ASA 9
  • Date: Mon, 08 Dec 2014 14:04:31 +0100

Hello all,

In a table which has 3 varchar(...) fields I try to INSERT the following statement with the released FreeTDS 0.92:

INSERT INTO dba.michaelstest (dNummer, DateinameBild, Unterschrift) VALUES ('00002', 'lalala.bmp', 'abc')

We use:
retcode = SQLPrepare(stmt, "INSERT INTO dba.michaelstest (dNummer, DateinameBild, Unterschrift) VALUES ('00002', 'lalala.bmp', 'abc')", SQL_NTS);
recode is here SQL_SUCCESS!
then we use:
recode = SQLExecute(stmt);
The recode here is 100 (SQL_NO_DATA).

We also use a Statement with one ? for testing and SQLBindParameter, SQLPrepare, SQLExecute, SQLParam, SQLPutData << it always all returned SUCCESFULL return code, the right code that is needed.

Form the 1. example (without ?) we geht on Sybase ASA 9.0.2 the following Debuglog:

08 12:22:02.394 ** DONE conn: 1 CONNECT Conn=1
12/08 12:22:02.394 ** REQUEST conn: 1 DO_NOTHING
12/08 12:22:02.427 ** REQUEST conn: 1 STMT_EXECUTE_ANY_IMM "set textsize 64512 "
12/08 12:22:02.427 ** DONE conn: 1 STMT_EXECUTE_ANY_IMM
12/08 12:22:02.459 ** REQUEST conn: 1 STMT_EXECUTE_ANY_IMM "WHILE @@TRANCOUNT > 0 COMMIT"
12/08 12:22:02.459 ** WARNING conn: 1 code: 105 "Prozedur ist abgeschlossen"
12/08 12:22:02.460 ** DONE conn: 1 STMT_EXECUTE_ANY_IMM
12/08 12:22:02.497 ** REQUEST conn: 1 STMT_PREPARE "create proc u6f1706000 as INSERT INTO dba.michaelstest (dNummer, DateinameBild, Unterschrift) VALUES ('00002', 'lalala.bmp', 'abc')"
12/08 12:22:02.497 ** DONE conn: 1 STMT_PREPARE Stmt=65536
12/08 12:22:02.497 ** REQUEST conn: 1 STMT_DESCRIBE_OUTPUT Stmt=65536
12/08 12:22:02.497 ** DONE conn: 1 STMT_DESCRIBE_OUTPUT
12/08 12:22:02.497 ** REQUEST conn: 1 STMT_DESCRIBE_INPUT Stmt=65536
12/08 12:22:02.497 ** DONE conn: 1 STMT_DESCRIBE_INPUT
12/08 12:22:02.529 ** REQUEST conn: 1 STMT_EXECUTE_ANY Stmt=65536
12/08 12:22:02.529 ** PLAN conn: 1 SYSPROCEDURE<procedure_name>
12/08 12:22:02.531 ** PLAN conn: 1 SYSATTRIBUTE<sys_attribute_uniqueness>
12/08 12:22:02.531 ** PLAN conn: 1 SYSCOLSTAT<SYSCOLSTAT>
12/08 12:22:02.532 ** PLAN conn: 1 SYSCOLSTAT<SYSCOLSTAT>
12/08 12:22:02.532 ** PLAN conn: 1 SYSCOLSTAT<SYSCOLSTAT>
12/08 12:22:02.532 ** PLAN conn: 1 SYSCOLSTAT<SYSCOLSTAT>
12/08 12:22:02.532 ** PLAN conn: 1 SYSCOLSTAT<SYSCOLSTAT>
12/08 12:22:02.532 ** PLAN conn: 1 SYSCOLUMN<SYSTABLE>
12/08 12:22:02.532 ** PLAN conn: 1 SYSTABLE<SYSTABLE>
12/08 12:22:02.533 ** PLAN conn: 1 SYSPROCEDURE<SYSPROCEDURE>
12/08 12:22:02.536 ** PLAN conn: 1 SYSPROCPARM<SYSPROCPARM>
12/08 12:22:02.536 ** PLAN conn: 1 SYSPROCEDURE<procedure_name>
12/08 12:22:02.536 ** PLAN conn: 1 SYSPROCEDURE<SYSPROCEDURE>
12/08 12:22:02.537 ** DONE conn: 1 STMT_EXECUTE_ANY
12/08 12:22:02.570 ** REQUEST conn: 1 STMT_DROP Stmt=65536
12/08 12:22:02.570 ** DONE conn: 1 STMT_DROP

For all testings we use the dba-user so rights schould not be the problem.

And also after a commit and trying without commit NO data is inserted into the target table.

Any help would be very nice!

Thanks in advance,

Michael Koch





  • [freetds] Problem with SQLPrepare and Sybase ASA 9, Michael Koch, 12/08/2014

Archive powered by MHonArc 2.6.24.

Top of Page