MCPcopy Create free account
hub / github.com/OSGeo/gdal / ExecuteSQL

Method ExecuteSQL

port/cpl_odbc.cpp:820–860  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

818 */
819
820int CPLODBCStatement::ExecuteSQL(const char *pszStatement)
821
822{
823 if (m_poSession == nullptr || m_hStmt == nullptr)
824 {
825 // We should post an error.
826 return FALSE;
827 }
828
829 if (pszStatement != nullptr)
830 {
831 Clear();
832 Append(pszStatement);
833 }
834
835#if (ODBCVER >= 0x0300)
836
837 if (!m_poSession->IsInTransaction())
838 {
839 // Commit pending transactions and set to autocommit mode.
840 m_poSession->ClearTransaction();
841 }
842
843#endif
844
845 // SQL_NTS=-3 is a valid value for SQLExecDirect.
846 if (Failed(SQLExecDirect(m_hStmt,
847 reinterpret_cast<SQLCHAR *>(m_pszStatement),
848#ifdef __COVERITY__
849
850 static_cast<SQLINTEGER>(strlen(m_pszStatement))
851#else
852 SQL_NTS
853#endif
854 )))
855 {
856 return FALSE;
857 }
858
859 return CollectResultsInfo();
860}
861
862/************************************************************************/
863/* CollectResultsInfo() */

Callers 15

mainFunction · 0.45
_gpkg_get_src_table_sizeFunction · 0.45
_gpkg_has_spatial_indexFunction · 0.45
_gpkg_get_srs_idFunction · 0.45
_gpkg_ogrmergeFunction · 0.45
mainFunction · 0.45
build_junction_tableFunction · 0.45
fixFunction · 0.45
mainFunction · 0.45
LoadGeometryMethod · 0.45

Calls 3

ClearTransactionMethod · 0.80
ClearFunction · 0.70
IsInTransactionMethod · 0.45

Tested by

no test coverage detected