Skip to Content.
Sympa Menu

freetds - Re: Re: [freetds] SQLPutData error

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: <brazilchina AT mail.goo.ne.jp>
  • To: freetds AT lists.ibiblio.org
  • Subject: Re: Re: [freetds] SQLPutData error
  • Date: 15 Mar 2004 17:36:41 +0900

I'm sorry, I have not known unittests,
and I tested it.

I could execute successfully "putdata.c(Revision 1.4)".
so I confirmed data after changeing table name "#putdata" to "putdata".
The data don't have 4 byte in head.
this result is only my environment?

please tell me advice.


> > Hi
> >
> > I have failed to insert data with below program.
> > Do i use "SQLPutData" invalidly ?
> >
> > I'm developing on these environment
> > -turbolinux workstation 8
> > -FreeTDS 0.62.1
> > -unixODBC 2.2.7
> > -SQL Server 2000
> >
> > please help me.
> >
> > source: -------------------------------
> > int rc;
> >
> > SWORD nId;
> > SDWORD strLen = 0;
> > PTR pToken;
> >
> > SDWORD cbName;
> >
> > rc = SQLPrepare( hstmt, "INSERT INTO TEST_TABLE1 (ID, NAME) VALUES (?,
> > ?)", SQL_NTS);
> > if( rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO ){
> > SQLBindParameter(hstmt,
> > 1,
> > SQL_PARAM_INPUT,
> > SQL_C_SSHORT,
> > SQL_SMALLINT,
> > 0,
> > 0,
> > &nId,
> > 0,
> > &strLen);
> > SQLBindParameter(hstmt,
> > 2,
> > SQL_PARAM_INPUT,
> > SQL_C_CHAR,
> > SQL_VARCHAR,
> > 50,
> > 0,
> > (PTR)2,
> > 0,
> > &cbName);
> >
> > cbName = SQL_LEN_DATA_AT_EXEC(0);
> > nId = 123;
> > rc = SQLExecute( hstmt );
> > while( rc == SQL_NEED_DATA ){
> > rc = SQLParamData( hstmt, &pToken );
> >
> > if( rc == SQL_NEED_DATA ){
> > SQLPutData( hstmt, "abc", 3);
> > }
> > }
> > }
> >
> > error message: -------------------------
> > Assertion failed: curcol->column_cur_size < curcol->column_size, file
> > prepare_query.c, line 510
> > Abort (core dumped)
>
> I imported this test in CVS. You are right, it fails but it shouldn't.
> On the other side I don't know the right behavior... you are trying to
> send 0 bytes so perhaps SQLExecute should return SQL_SUCCESS instead of
> SQL_NEED_DATA...
>
> freddy77
>
>
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
>




Archive powered by MHonArc 2.6.24.

Top of Page