'Database'에 해당되는 글 1건

  1. 2009/09/03 김성민 ODBC로 TEXT/BLOB 처리할 때 주의할 점

TEXT/BLOB 이 들어있는 테이블을 긁어올 때는 TEXT/BLOB 컬럼을 SELECT 리스트의 맨 뒤에다 둬야 한다.

SELECT ID, BLOB_COLUMN, INT_COLUMN FROM SomeTable --> X
SELECT ID, INT_COLUMN, BLOB_COLUMN FROM SomeTable --> O

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbcgetting_long_data.asp

There are a number of restrictions on using SQLGetData. In general, columns accessed with SQLGetData:
  • Must be accessed in order of increasing column number (because of the way the columns of a result set are read from the data source). For example, it is an error to call SQLGetData for column 5 and then call it for column 4.
  • Cannot be bound.
  • Must have a higher column number than the last bound column. For example, if the last bound column is column 3, it is an error to call SQLGetData for column 2. For this reason, applications should be careful to place long data columns at the end of the select list.
  • Cannot be used if SQLFetch or SQLFetchScroll was called to retrieve more than one row.

시팍, 프로그램 잘못 짠 줄 알고 한참 찾았다.

2009/09/03 08:49 2009/09/03 08:49
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://serious-code.net/tc/rss/response/2

댓글+트랙백 ATOM :: http://serious-code.net/tc/atom/response/2