Long data: Use of SQL_LEN_DATA_AT_EXEC(0) and SQL_DATA_AT_EXEC


  • Hello,

    What is the use of SQL_LEN_DATA_AT_EXEC(0) and what does it mean ?

    I know that when StrLen_or_IndPtr buffer pointer of SQLBindParameter is set to SQL_LEN_DATA_AT_EXEC  or SQL_DATA_AT_EXEC it means that the data for the parameter will be sent with SQLPutData.  Also SQL_LEN_DATA_AT_EXEC(length) is used when sending long data to a data source that needs to know how many bytes of long data will be sent so that it can preallocate space

    But what should be the expected  behavior when we set StrLen_or_IndPtr buffer to:

         1)  SQL_LEN_DATA_AT_EXEC(0)

    or  2)  SQL_DATA_AT_EXEC



    Thursday, August 14, 2014 10:12 AM

All replies

  • Hi Mukesh,

    As we know, when the statement is executed, the driver sends data for the parameter to the data source; the *ParameterValuePtr buffer must contain a valid input value, or the *StrLen_or_IndPtr buffer must contain SQL_NULL_DATA, SQL_DATA_AT_EXEC, or the result of the SQL_LEN_DATA_AT_EXEC macro

    if the data source does not return a value for an input/output parameter, the driver sets the *StrLen_or_IndPtr buffer to SQL_NULL_DATA, that means we will insert Null data into a database.

    For more information, please see:
    SQLBindParameter Function:
    How To Insert NULL Data with ODBC API Functions:

    If you have any feedback on our support, please click here.

    Elvis Long
    TechNet Community Support

    Monday, August 18, 2014 8:17 AM
  • Hi Elvis,

    Thanks for reply!

    But my question is what should be the expected  behavior when we set StrLen_or_IndPtr buffer to:

         1)  SQL_LEN_DATA_AT_EXEC(0)

    or  2)  SQL_DATA_AT_EXEC

    I think it should insert all data using SQLPutaData limited by the length of columns size.

    MSDN is silent in the case of SQL_LEN_DATA_AT_EXEC(0) ?



    Wednesday, August 20, 2014 10:38 AM