Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

IFR_ErrorHndl.dxy

Go to the documentation of this file.
00001 #include <string.h>
00002 #include <stdarg.h>
00003 #include <stdio.h>
00004 
00005 #include "Interfaces/Runtime/IFR_ErrorHndl.h"
00006 #include "Interfaces/Runtime/IFR_Trace.h"
00007 #include "Interfaces/Runtime/IFR_TraceContext.h"
00008 #include "hsp77.h"
00009 #include "hsp78_0.h"
00010 
00011 IFR_BEGIN_NAMESPACE
00012 
00035 static const IFR_ErrorData errordata[] =
00036 {
00037     { IFR_ERR_UNKNOWN,                 -10899,     "",     "Unknown error"    },
00038     //**********************************************************************
00039     //******** Environment, Tracing, Filehandling 10000 - 10099 *********
00040 
00041     { IFR_ERR_ALLOCSHMEM_FAILED_SI,              -10803, "",      "Allocation of shared memory failed \"%s\" of size %d failed" },
00042     { IFR_ERR_ALLOCSHMEM_FAILED_S,               -10803, "",      "Allocation of shared memory failed (%s)" },
00043     // Use the macro IFR_ERR_NOT_IMPLEMENTED(x)
00044     { IFR_ERR_NOT_IMPLEMENTED_SSI,               -10808, "",      "Feature (%s) not implemented yet in module: %s line: %d" },
00045     { IFR_ERR_SYSTEM_ERROR_S,                    -10001, "",      "System error: %s." },
00046     { IFR_ERR_WRONG_KERNEL_VERSION_I,            -10003, "",      "Feature not supported for kernel version %d" },
00047     { IFR_ERR_SESSION_ALREADY_IN_USE,            -10810, "",      "Session already in use" },
00048     //**********************************************************************
00049     //******** Connection 10100 - 10199 *********
00050 
00051     { IFR_ERR_CONNECTION_DOWN_IIS,               -10807, "",      "Connection down: [%d] %.*s"  },
00052     { IFR_ERR_SERVERDB_MISSING,                  -10857, "",      "Missing database name for connection" },
00053     { IFR_ERR_USERNAME_MISSING,                  -10715, "",      "Missing user name for connection" },
00054     { IFR_ERR_PASSWORD_MISSING,                  -10715, "",      "Missing password for connection" },
00055     { IFR_ERR_CONNECTFAILED_INTERNAL_SS,         -10709, "",      "Connection failed (%s:%s)" },
00056     { IFR_ERR_INVALID_CONNECT_PROPERTY_S,        -10100, "",      "Invalid value for option \'%s\' of SQLDBC_ConnectProperties" },
00057     { IFR_ERR_INVALID_ISOLATIONLEVEL_S,          -10101, "",      "Invalid value for ISOLATIONLEVEL (%s)" },
00058     { IFR_ERR_INVALID_ISOLATIONLEVEL_I,          -10101, "",      "Invalid value for ISOLATIONLEVEL (%d)" },
00059     { IFR_ERR_INVALID_PACKETCOUNT_S,             -10102, "",      "Invalid value for PACKETCOUNT (%s)" },
00060     { IFR_ERR_INVALID_STATEMENTCACHESIZE_S,      -10103, "",      "Invalid value for STATEMENTCACHESIZE (%s)" },
00061     { IFR_ERR_INVALID_XUSERKEY,                  -10104, "",      "Invalid value for KEY" },
00062     { IFR_ERR_CODEPAGE_NOT_SUPPORTED_S,          -10105, "01S02", "Codepage not supported (%s)" },
00063     { IFR_ERR_INVALID_CLIENTAPPLICATION_S,       -10106, "",      "Invalid client application id (%s)" },
00064     { IFR_ERR_XUSER_ERROR_S,                     -10757, "",      "XUSER error (%s)"},
00065     { IFR_ERR_AUTHENTICATION_FAILED,             -10107, "",      "Authentication failed." },
00066     { IFR_ERR_AUTHENTICATION_FAILED_S,           -10107, "",      "Authentication failed (%s)." },
00067     { IFR_ERR_SESSION_RECONNECTED,               -10108, "",      "Session has been reconnected." },
00068 
00069     //***********************************************************
00070     //******** API handling 10200 - 10299               *********
00071 
00072     { IFR_ERR_SQLCMD_DATA_EXPECTED,              -10200, "HY010", "Function sequence error (data for execution expected)" },
00073     { IFR_ERR_SQLCMD_NO_DATA_EXPECTED,           -10201, "HY010", "Function sequence error (no data for execution expected)" },
00074     { IFR_ERR_SQLCMD_RECONNECT,                  -10202, "HY010", "Function sequence error (operation was aborted by disconnect)" },
00075     { IFR_ERR_SQLCMD_NOTPREPARED,                -10210, "HY010", "Invalid command state (No prepared SQL command)" },
00076     { IFR_ERR_METHOD_NOT_ALLOWED,                -10220, "HY010", "Calling %s is not allowed for %s." },
00077     { IFR_ERR_COMMAND_INFO_TOOLONG,              -10221, "HY010", "Command info to long [length is %d maximum length %d]" },
00078 
00079     //***********************************************************
00080     //******** Parameter, Column handling 10300 - 10399 *********
00081     { IFR_ERR_INVALID_PARAMETERINDEX,            -10300, "07009", "Invalid parameter index" },
00082     { IFR_ERR_INVALID_PARAMETERINDEX_I,          -10300, "07009", "Invalid parameter index %d" },
00083     { IFR_ERR_PARAMETERINDEX_NULL,               -10300, "07009", "Invalid parameter index 0" },
00084     { IFR_ERR_INVALID_HOSTTYPE_SI,               -10301, ""     , "Invalid host type (%s) for parameter (%d)" },
00085     { IFR_ERR_PARAMETER_NOT_SET_I,               -10304, "07002", "Parameter/Column (%d) not bound." },
00086     { IFR_ERR_NULL_PARAMETERADDR_I,              -10305, "HY090", "Parameter (%d) contains null pointer" },
00087     { IFR_ERR_NEGATIVE_BUFFERLEN_II,             -10306, "HY090", "Negative buffer length for parameter (%d) not allowed (found %d)" },
00088     { IFR_ERR_INVALID_LENGTHINDICATOR_I,         -10307, "HY090", "Invalid length or indicator value for parameter (%d)" },
00089     { IFR_ERR_NOPIECEWISE_DATA_WRITE_I,          -10308, "HY019", "Non-character and non-binary data for parameter (%d) for piece wise insert not allowed" },
00090 
00091     { IFR_ERR_INVALID_COLUMNINDEX_I,             -10310, "07009", "Invalid column index (%d)" },
00092     { IFR_ERR_NONULLDATAAPPEND_I,                -10312, "HY020", "Attempt to concatenate to a NULL or DEFAULT value for parameter (%d)" },
00093     { IFR_ERR_PARAMETER_ALREADY_PROCESSED_I,     -10313, "HY010", "Requested parameter (%d) was already processed" },
00094     { IFR_ERR_INVALID_PARAMETER_SEQUENCE_I,      -10314, "HY010", "Invalid parameter processing sequence, process"
00095       " non-LONG data before parameter (%d)" },
00096     { IFR_ERR_INVALID_STARTPOSITION_I,           -10315, ""     , "Invalid start position (%d)" },
00097     { IFR_ERR_DATA_AT_EXECUTE_NOT_ALLOWED_I,     -10316, "HY010", "DATA AT EXECUTE for parameter (%d) not allowed (conflicts "
00098       "with use of LOB parameter)" },
00099     { IFR_ERR_LOB_NOT_ALLOWED_I,                 -10317, "HY010", "LOB type for parameter (%d) not allowed (conflicts "
00100       "with use of DATA AT EXECUTE parameter)" },
00101     { IFR_ERR_INVALID_LOB,                       -10318, "HY010", "Invalid LOB object" },
00102     { IFR_ERR_LOB_READONLY_I,                    -10319, "HY010", "Could not read LOB for parameter/column (%d)" },
00103     { IFR_ERR_LOB_WRITEONLY_I,                   -10319, "HY010", "Could not write write LOB for parameter/column (%d)" },
00104     { IFR_ERR_LOB_CLOSED_I,                      -10320, "HY010", "LOB already closed LOB for parameter/column (%d)" },
00105     { IFR_ERR_LOB_INVALID_I,                     -10321, "HY010", "LOB invalidated by a previous error for "
00106       "parameter/column (%d)" },
00107     { IFR_ERR_LOB_NULLDEFAULT_I,                 -10322, "HY010", "Could not insert LOB."
00108       " Parameter/column (%d) has a NULL/DEFAULT value" },
00109     { IFR_ERR_NOPIECEWISE_DATA_READ_I,           -10323, "HY019", "Non-character and non-binary data for parameter/column (%d) was "
00110       "tried to read piecewise" },
00111     { IFR_ERR_NULL_STREAMHANDLE_I,               -10861, "HY010", "Invalid use of null pointer for stream handle in parameter (%d)" },
00112     { IFR_ERR_STREAMHANDLE_NOTFOUND_I,          -10324, "HY010", "Stream with id (%d) not found" },
00113     { IFR_ERR_STREAMHANDLE_NOTINPUT_I,          -10325, "HY010", "Stream parameter (%d) is not an input parameter" },
00114     { IFR_ERR_STREAMHANDLE_NOTOUTPUT_I,         -10325, "HY010", "Stream parameter (%d) is not an input parameter" },
00115     { IFR_ERR_STREAM_ERROR_INPUT_I,             -10862, "HY010", "Stream parameter (%d), error in read procedure" },
00116     { IFR_ERR_STREAM_ERROR_OUTPUT_I,            -10862, "HY010", "Stream parameter (%d), error in write procedure" },
00117     { IFR_ERR_STREAM_NO_DATA_I,                 -10326, "HY010", "No data found for stream (%d), but data was expected" },
00118     { IFR_ERR_NULL_STREAMPARAM_I,               -10327, "HY010", "Invalid use of null pointer in stream parameter field "
00119                                                                  "of stream descriptor for parameter/column (%d)" },
00120     { IFR_ERR_STREAM_MEMBERCOUNT_MISMATCH_III,  -10328, "HY010", "Mismatch of number of stream members for parameter (%d) "
00121                                                                   "(application %d, database %d)." },
00122     { IFR_ERR_INVALID_SERIAL_VALUE_TAG,         -10329, "HY010", "Invalid serial value requested, must be first or last value." },
00123     { IFR_ERR_STREAM_OUTPUT_SEQUENCE_ERROR_S,   -10330, "HY010", "Multiple stream output sequence error, unexpected '%s' part." },
00124     { IFR_ERR_STREAM_OVERFLOW_III,              -10331, "HY010", "Input stream callback buffer overflow for table id %d, "
00125       "allowed %d, written %d bytes." },
00126     { IFR_ERR_STREAM_NO_FUNCTION_I,             -10332, "HY010", "No callback function supplied for stream parameter %d." },
00127     { IFR_ERR_UNSUPPORTED_PARAMETERTYPE_I,      -10333, "",      "Unsupported database type in parameter/column (%d)." },
00128     { IFR_ERR_TOO_MANY_LONG_PARAMETERS_I,       -10334, "HY010", "No BLOB/CLOB for DATA AT EXECUTE currently supported as procedure parameter (%d)." },
00129     { IFR_ERR_INVALID_LONG_USE_II,              -10335, "HY010", "Cannot use BLOB/CLOB parameter %d before parameter %d is processed." },
00130     { IFR_ERR_LONG_PARAMETER_MIX_UNSUPPORTED,   -10336, "HY010", "Switch between different BLOB/CLOB parameters in procedure not supported."},
00131     { IFR_ERR_LOB_KEEPALIVE_NOTALLOWED_I,       -10337, "HY010", "Cannot set keep-alive mode for LOB parameter (%d)."},
00132     //***********************************************************
00133     //******** Data Conversion 10400 - 10499 *********
00134 
00135     { IFR_ERR_PARAM_CONVERSION_LOOSEDIGITS_I,    -10400, "",      "Conversion looses significant digits for parameter/column (%d)" },
00136     { IFR_ERR_PARAM_CONVERSION_TRUNCATEDATA_I,   -10401, "",      "Conversion of parameter/column (%d) would truncate data" },
00137     { IFR_ERR_NUMERIC_OVERFLOW_I,                -10811, "",      "Numeric overflow for parameter/column (%d)" },
00138     { IFR_ERR_INVALID_NUMERIC_VALUE_I,           -10802, "",      "Invalid numeric value for parameter/column (%d)" },
00139     { IFR_ERR_CONVERSION_NOT_SUPPORTED,          -10404, "",      "Conversion not supported" },
00140     { IFR_ERR_CONVERSION_NOT_SUPPORTED_I,        -10404, "",      "Conversion not supported for parameter/column (%d)" },
00141     { IFR_ERR_CORRUPTED_UCS2ASCIIDATA_I,         -10405, ""     , "Cannot convert UCS2 data to ASCII for parameter/column (%d)" },
00142     { IFR_ERR_ODD_DATALENGTH_I,                  -10406, "",      "Invalid data length for UCS2 data for parameter/column (%d)" },
00143     { IFR_ERR_CORRUPTED_UTF8DATA_I,              -10407, ""     , "Corrupted UTF8 data for parameter/column (%d)" },
00144     { IFR_ERR_STRING_CONVERSION,                 -10408, ""     , "Character conversion failed" },
00145     { IFR_ERR_DATETIMEFORMAT_UNSUPPORTED_I,      -10410, "22007", "Date/Time format is not supported for parameter (%d)" },
00146     { IFR_ERR_ILLEGAL_DATE_VALUE_I,              -10411, "",      "Illegal DATE value for parameter/column (%d)" },
00147     { IFR_ERR_ILLEGAL_TIME_VALUE_I,              -10412, "",      "Illegal TIME value for parameter/column (%d)" },
00148     { IFR_ERR_ILLEGAL_TIMESTAMP_VALUE_I,         -10413, "",      "Illegal TIMESTAMP value for parameter/column (%d)" },
00149     { IFR_ERR_BINARY_TO_ENCODED_UNSUPPORTED_I,   -10414, "",      "Conversion from binary value to string is not enabled for "
00150       "parameter/column (%d)" },
00151     { IFR_ERR_NULL_DECIMAL_INDICATOR_I,          -10415, "",      "Indicator must not be a null pointer for DECIMAL input value "
00152       " for parameter/column (%d)" },
00153     { IFR_ERR_DECIMAL_INDICATOR_CORRUPT_I,       -10416, "",      "Invalid indicator value for DECIMAL input value for "
00154       " paramter/column (%d)" },
00155     { IFR_ERR_INVALID_DECIMAL_SPECIFICATION_III, -10417, "",      "Invalid definition for DECIMAL input value for paramater/column "
00156       " (%d), specified a DECIMAL(%d, %d)" },
00157     { IFR_ERR_DECIMAL_BUFFER_TOO_SHORT_I,        -10418, "",      "Buffer for DECIMAL too short for parameter/column (%d)" },
00158     { IFR_ERR_NOT_ASCII_CHARACTERS_I,            -10419, "",      "Character value contains non-ASCII characters (%d)" },
00159     { IFR_ERR_BYTE_CONVERSION_FAILED_I,          -10420, "",      "Could not convert byte buffer to hexadecimal string for "
00160       "parameter/column (%d)" },
00161     { IFR_ERR_LONG_LONG_I,                       -10421, "",      "Could not convert too large LONG data for parameter/column (%d)" },
00162     { IFR_ERR_BINARY_TO_ENCODED_UNSUPPORTED_I,   -10422, "01004", "Appending data to binary output not supported for parameter/column (%d)" },
00163     { IFR_ERR_BINARY_APPEND_I        ,           -10423, "22003", "Appending data to binary output not supported for numeric parameter/column (%d)" },
00164     { IFR_ERR_BINARY_TRUNCATION_SI,              -10424, "22003", "Conversion from %s data to binary would truncate data for parameter/column (%d)" },
00165 
00166     //**********************************************************************
00167     //******** Retrieving results and array commands 10500 - 10599 *********
00168 
00169     { IFR_ERR_ROW_NOT_FOUND,                      100,   "02000", "Row not found" },
00170     { IFR_ERR_RESULTSET_IS_CLOSED,               -10500, "",      "Result set is closed" },
00171     { IFR_ERR_RESULTSET_BEFOREFIRST,             -10501, "S1109", "Invalid position in resultset: before first row" },
00172     { IFR_ERR_RESULTSET_AFTERLAST,               -10502, "S1109", "Invalid position in resultset: after last row" },
00173     { IFR_ERR_RESULTSET_IS_FORWARD_ONLY,         -10503, "",      "The operation is not allowed for result set type FORWARD_ONLY" },
00174     { IFR_ERR_INVALID_ROWSET_POS_I,              -10504, "",      "Invalid position (%d) for rowset" },
00175     { IFR_ERR_ROWSET_IS_READ_ONLY,               -10505, "",      "Result set type is UPDATABLE but row set type is READ_ONLY." },
00176     { IFR_ERR_ROWSET_IS_UPDATABLE,               -10506, "",      "Result set type is READ_ONLY but row set type is UPDATABLE" },
00177     { IFR_ERR_ROWSET_NO_METADATA,                -10507, "",      "Internal error: No metadata available for rowset operation" },
00178     { IFR_ERR_ROWSET_WRONG_COLUMN_ENCODING_I,    -10508, "",      "Invalid encoding of column name for column %d for rowset operation"},
00179     { IFR_ERR_NO_UPDATABLE_ROWSET,               -10509, "",      "The statement was not executed with updatable cursor concurrency" },
00180     { IFR_ERR_INVALID_ROWARRAYSIZE,              -10856, "",      "Invalid row array size 0" },
00181     { IFR_ERR_NO_DATA_FOR_UPDATE,                -10510, "21S02", "Degree of derived table does not match column list" },
00182 
00183 
00184     //**********************************************************************
00185     //******** Statement execution 10600 - 10699 *********
00186 
00187     { IFR_ERR_SESSION_NOT_CONNECTED,             -10821,  "",     "Session not connected" },
00188     { IFR_ERR_EMPTY_SQL_STATEMENT,               -10601,  "",     "SQL command is the empty string" },
00189     { IFR_ERR_SQLCMD_NOT_ASCII,                  -10602,  "",     "SQL command contains UNICODE character" },
00190     { IFR_ERR_SQLCMD_RESULTSET,                  -10603,  "",     "SQL command would generate a result set" },
00191     { IFR_ERR_SQLCMD_OUTPUTPARAM,                -10604,  "",     "SQL command contains output parameters" },
00192     { IFR_ERR_STATEMENT_TOOLONG,                 -10706,  "",     "Statement too long" },
00193     { IFR_ERR_SCHEMAMODIFIED,                    -10605,  "",     "Illegal schema modification, parameters/columns have changed type/number incompatibly" },
00194 
00195     //**********************************************************************
00196     //******** Mapped Error codes 10700 - 10899 *********
00197 
00198     // Do not use any new values here. Please check for existing values.
00199 
00200     //**********************************************************************
00201     //******** Fatal errors 10900 - 10999 *********
00202 
00203     { IFR_ERR_PACKET_EXHAUSTED,                  -10901,  "",      "No space left in request packet" },
00204     { IFR_ERR_INVALID_REQUESTPACKET,             -10902,  "",      "Invalid request packet structure" },
00205     { IFR_ERR_MISSINGLONGDATAPART,               -10903,  "",      "Internal Error: LONGDATA part expected" },
00206     { IFR_ERR_MISSINGRESULTCOUNT,                -10904,  "",      "Internal error: Expected result count" },
00207     { IFR_ERR_INVALID_REPLYPACKET,               -10905,  "",      "Invalid reply packet structure" },
00208     { IFR_ERR_INVALID_VALINDEX_I,                -10906,  "",      "Internal Error: Entry for valindex %d not found"},
00209     { IFR_ERR_ERROR_LONGDESCRIPTOR,              -10907,  "",      "Internal Error: Long descriptor has error flag set"},
00210     { IFR_ERR_GETVAL_REQUIRED,                   -10908,  "",      "Internal Error: GETVAL operation required before data could "
00211       "be read"},
00212     //                                           -10909
00213     { IFR_ERR_INVALID_OBJECT,                    SQLDBC_INVALID_OBJECT,  "",      "Invalid object reference" }
00214 #undef EERROR_START
00215 #undef EERROR
00216 };
00217 
00218 
00219 
00220 IFR_END_NAMESPACE