MCPcopy Create free account
hub / github.com/MapServer/MapServer / handleSQLError

Function handleSQLError

mapmssql2008.c:101–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101void handleSQLError(layerObj *layer)
102{
103 SQLCHAR SqlState[6], Msg[SQL_MAX_MESSAGE_LENGTH];
104 SQLINTEGER NativeError;
105 SQLSMALLINT i, MsgLen;
106 SQLRETURN rc;
107 msMSSQL2008LayerInfo *layerinfo = getMSSQL2008LayerInfo(layer);
108
109 if (layerinfo == NULL)
110 return;
111
112 // Get the status records.
113 i = 1;
114 while ((rc = SQLGetDiagRec(SQL_HANDLE_STMT, layerinfo->conn->hstmt, i, SqlState, &NativeError,
115 Msg, sizeof(Msg), &MsgLen)) != SQL_NO_DATA)
116 {
117 if(layer->debug)
118 {
119 msDebug("SQLError: %s\n", Msg);
120 }
121 i++;
122 }
123}
124
125/* remove white space */
126/* dont send in empty strings or strings with just " " in them! */

Callers 1

Calls 2

getMSSQL2008LayerInfoFunction · 0.85
msDebugFunction · 0.85

Tested by

no test coverage detected