pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Han <zhouhanok@vip.sina.com>
To: pgsql-odbc@postgresql.org <pgsql-odbc@postgresql.org>
Cc: Hiroshi Inoue <Inoue@tpf.co.jp>
Subject: Problem with SQL_LONGVARBINAY
Date: Mon, 17 Mar 2003 17:6:51 +0800
Message-ID: <20030317090032.3D0B7476105@postgresql.org> (raw)

Hi,
 	There's a problem when insert a SQL_LONGVARBINARY(lo) column in the following way:
	Use SQLBindParameter(...SQL_DATA_AT_EXEC)
	and SQLParamData, SQLPutData.
	The last time SQLParamData revoke a crash!
	This is the sample code:
	for (...)
	{
		sdw = SQL_DATA_AT_EXEC;
		rc = SQLBindParameter(hstmt, w, SQL_PARAM_INPUT,
				SQL_C_TCHAR, rgFields[ind].wSQLType,
				rgFields[ind].precision, rgFields[ind].scale,
				(LPTSTR)(((UDWORD)ind)+BIND_PARM_OFFSET), 0, &sdw);
	}
	rc = SQLExecDirect(hstmt, lpqt->sz, SQL_NTS);
	if (SQL_NEED_DATA != rc)
		return;
	for(ind = 0; ind <= cTypes; ind++)
	{
		rc = SQLParamData(hstmt, &ptr);
		if(rc != SQL_NEED_DATA)
			break;

		pch = qtMakeData(...);

		if(*pch) {
			rc = SQLPutData(hstmt, pch, SQL_NTS);
		} else {
			rc = SQLPutData(hstmt, (LPTSTR)IGNORED, SQL_NULL_DATA);
		}
	}

    please check, thanks and regards!
	

        
 				

        Han
        zhouhanok@vip.sina.com
          2003-03-17






view thread (2+ messages)  latest in thread

Message-ID: <20030317090032.3D0B7476105@postgresql.org>
Permalink:  ../20030317090032.3D0B7476105@postgresql.org/
Also on:    postgresql.org/message-id/20030317090032.3D0B7476105@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: zhouhanok@vip.sina.com, Inoue@tpf.co.jp
  Subject: Re: Problem with SQL_LONGVARBINAY
  In-Reply-To: <20030317090032.3D0B7476105@postgresql.org>
  References: <20030317090032.3D0B7476105@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox