Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Can/Should we check for error on connection object after the followng calls

Normally after a call to the 'SQLDBC_Connection_connect' function we check for the possible errors by calling the

SQLDBC_ErrorHndl *errHndl = SQLDBC_Connection_getError(conn);

SQLDBC_ErrorHndl_getErrorText(errHndl); or SQLDBC_ErrorHndl_getErrorText(errHndl);

Should we be doing the same after the following calls too ? They all take 'SQLDBC_Connection*' as a parameter just like 'SQLDBC_Connection_connect' . In other words the question is is the SQLDBC_Connection object set with the error information (if any) in case any of the following call fails?

SQLDBC_Connection_createStatement

SQLDBC_Connection_close

SQLDBC_Connection_setAutoCommit

SQLDBC_Connection_commit

SQLDBC_Connection_releaseStatement

SQLDBC_Connection_close

Please advise.

Regards

Raj

Former Member
Former Member replied

Hello Raj

Usually checking the error is sensible, if the method in question returns a value of type SQLDBC_Retcode.

However, createStatement sets a memory allocation error, if no statement could be generated due to memory restrictions and therefore a NULL would be returned.

Regards Thomas

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question