- (with-foreign-object (hstmt-ptr 'sql-handle)
- (with-error-handling
- (:hdbc hdbc)
- (SQLAllocStmt hdbc hstmt-ptr)
- (deref-pointer hstmt-ptr 'sql-handle))))
-
+ (let ((statement-handle
+ (with-foreign-object (hstmt-ptr 'sql-handle)
+ (with-error-handling
+ (:hdbc hdbc)
+ (SQLAllocStmt hdbc hstmt-ptr)
+ (deref-pointer hstmt-ptr 'sql-handle)))))
+ (if (uffi:null-pointer-p statement-handle)
+ (error "Received null statement handle.")
+ statement-handle)))
+