| 99 | } |
| 100 | |
| 101 | void 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! */ |
no test coverage detected