freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: <brazilchina AT mail.goo.ne.jp>
- To: freetds AT lists.ibiblio.org
- Subject: Re: Re: RE: Re: [freetds] SQLPutData error
- Date: 16 Mar 2004 15:08:01 +0900
I'm sorry.
Sample code is wrong.
> if( rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO ){
is
if( !(rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO) ){
> ---------------------------------------------------------------------
> int testPutData( SQLHSTMT hstmt ){
> int rc;
> int i;
>
> SQLINTEGER ind;
> SQLPOINTER ptr;
> char test_text[] = "abcdefg";
> int len = strlen( test_text );
>
> //SQLBindParameter
> rc = SQLBindParameter( hstmt,
> 1,
> SQL_PARAM_INPUT,
> SQL_C_CHAR,
> SQL_VARCHAR,
> 0,
> 0,
> (SQLPOINTER)123,
> 0,
> &ind);
> if( rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO ){
> exit(1);
> }
> ind = SQL_LEN_DATA_AT_EXEC(len);
>
> //SQLPrepare
> //CREATE TABLE TEST_TABLE (c VARCHAR(255) NULL, b VARBINARY(255) NULL)
> rc = SQLPrepare( hstmt, (SQLCHAR *) "INSERT INTO TEST_TABLE(c)
> VALUES(?)", SQL_NTS);
> if( rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO ){
> exit(1);
> }
>
> //SQLExecute
> rc = SQLExecute( hstmt );
> while( rc == SQL_NEED_DATA ){
> rc = SQLParamData( hstmt, &ptr );
> if( rc == SQL_NEED_DATA ){
> if( ptr == (SQLPOINTER)123 ){
> SQLPutData( hstmt, test_text, len);
> }
> }
> }
> return 0;
> }
> ---------------------------------------------------------------------
>
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
>
-
[freetds] SQLPutData error,
brazilchina, 03/10/2004
- Re: [freetds] SQLPutData error, Frediano Ziglio, 03/11/2004
- <Possible follow-up(s)>
- Re: Re: [freetds] SQLPutData error, brazilchina, 03/12/2004
- Re: Re: [freetds] SQLPutData error, brazilchina, 03/15/2004
- RE: Re: [freetds] SQLPutData error, Lowden, James K, 03/15/2004
- Re: RE: Re: [freetds] SQLPutData error, brazilchina, 03/15/2004
- Re: Re: RE: Re: [freetds] SQLPutData error, brazilchina, 03/16/2004
Archive powered by MHonArc 2.6.24.