Announcement

Collapse
No announcement yet.

SQLBindParameter - Invalid Conversion

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • SQLBindParameter - Invalid Conversion

    Hallo,

    habe wieder mal ein mehr oder weniger lustiges Problem:

    Rahmenbedingungen:

    Programmiersprache: C++ (Visual C++ 6 SP6)
    Zugriff auf die Datenbank: via ODBC
    Betriebssystem: WinXp SP2
    Datenbank: IBM DB2 9.5 Workstation Server

    Code:
    char var;
    SQLINTEGER cb;
    
    cb=1;
    SQLBindParameter(hStmt,1,SQL_PARAM_INPUT,SQL_C_BIT,SQL_BIT,1,0,&var,1,&cb);
    Fehlermeldung:
    SQLStatus = 07006 -> SQL-Message: = [IBM][CLI Driver] CLI0102E Invalid conversion. SQLSTATE=07006

    Auszug IBM Dokumentation:
    07006 Conversion not valid The conversion from the data value identified by the ValueType argument to the data type identified by the ParameterType argument is not a meaningful conversion. (For example, conversion from SQL_C_DATE to SQL_DOUBLE.)

    Da ich von SQL_C_BIT in SQL_BIT umwandle, gehe ich davon aus das die Datentypen zusammenpassen...

    Tipp: Unter MsJet, SQLServer und Oracle bekomme ich keinen Fehler!

    Vielleicht hat ja jemand eine Idee?

    mfg Wolfgang

  • #2
    bitte Frage vergessen

    wieder mal hat mir die Db2 einen Streich gespielt:

    C data type of the parameter. The following types are supported:
    * SQL_BIGINT
    * SQL_BINARY
    * SQL_BLOB
    * SQL_BLOB_LOCATOR
    * SQL_CHAR
    * SQL_CLOB
    * SQL_CLOB_LOCATOR
    * SQL_DATETIME
    * SQL_DBCLOB
    * SQL_DBCLOB_LOCATOR
    * SQL_DECIMAL
    * SQL_DOUBLE
    * SQL_FLOAT
    * SQL_GRAPHIC
    * SQL_INTEGER
    * SQL_NUMERIC
    * SQL_REAL
    * SQL_SMALLINT
    * SQL_TYPE_DATE
    * SQL_TYPE_TIME
    * SQL_TYPE_TIMESTAMP
    * SQL_VARBINARY
    * SQL_VARCHAR
    * SQL_VARGRAPHIC
    * SQL_WCHAR
    * SQL_WVARCHAR

    Specifying SQL_C_DEFAULT causes data to be transferred from its default C data type to the type indicated in ParameterType.

    Somit ist SQL_C_BIT nicht erlaubt -> kann nicht funktionieren.

    Danke für die Hilfe

    Comment

    Working...
    X