Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The following four options are described.

SQL_CLOSEstmt와 관련된 커서를 닫고 모든 보류중인 결과들을 폐기한다. 애플리케이션은 같은 또는 다른 변수들을 사용해 다시 SELECT 문을 수행함으로서 나중에 이 커서를 다시 열 수 있다. 만약 어떠한 커서도 열려 있지 않으면, 이 옵션 애플리케이션에 대해 아무런 영향을 주지 않는다.SQL_DROP입력 명령문 핸들과 연관된 자원이 해제되고 핸들이 무효화된다. 열린 커서가 있는 경우 닫히고 모든 미결인 결과가 삭제된다Close the cursor associated with stmt and discard all pending results. The application can reopen this cursor later by executing the SELECT statement again using the same or different variables. If no cursor is open, this option has no effect on the application.
SQL_DROPThe resources associated with the input statement handle are dropped and the handle is invalidated. If there is an open cursor, it is closed and all pending results are discarded.
SQL_UNBIND이 명령문 핸들에서 이전의 All rows bound by the previous SQLBindCol() 호출에 의해 바인드된 모든 열이 해제된다call on this statement handle are dropped.
SQL_RESET_PARAMS이 명령문 핸들에서 이전의 All parameters set by the previous SQLBindParameter() 호출에 의해 설정된 모든 매개변수가 해제된다. 애플리케이션 변수 또는 파일 참조와 명령문 핸들의 SQL문 매개변수 마커 사이의 연관이 깨진다.

 

call on this statement handle are dropped. The association between the application variable or file reference and the SQL statement parameter marker in the statement handle is broken.

Among these, SQL_CLOSE and SQL_DROP are mainly used.

  1. SQLFreeStmt(stmt, SQL_DROP): 
    This means that the resources for the prepared stmt (statement handle) are completely freed.
    That is, it only calls when that stmt is not being reused.
  2. SQLFreeStmt(stmt, SQL_CLOSE): 
    If all the retrieved data have not been fetched, an error will occur if you execute SQLExecute again without SQLFreeStmt(SQL_CLOSE).
    If SQLFreeStmt(stmt, SQL_CLOSE) is used, the existing stmt can be used without doing SQLAllocStmt().