Re: How do you set a string parameter to NULL?
- From: "Arnie" <none>
- Date: Fri, 24 Jun 2005 11:13:41 -0400
Thanks Scot. I just gave it a column size of one and it appears
happy. Perhaps you can help with my DateTime post too?
- Arnie
"Scot T Brennecke" <ScotBspamhater@xxxxxxxx> wrote in message
news:MPG.1d254dc324a71686989c3a@xxxxxxxxxxxxxxxxxxxxxxx
> You are specifying 0 as your ColumnSize. Try using the actual
> size of
> the column, even though the value will be NULL.
>
> In article <eICd6lAeFHA.412@xxxxxxxxxxxxxxxxxxxx>, "Arnie"
> <none>
> says...
>> I have a routine, shown below, that sets a char parameter to
>> NULL. It works properly for Oracle and DB2 but the SQL Server
>> ODBC driver doesn't seem to like it. Using XP Pro SP 2. The
>> m_
>> variables are class members. Any ideas?
>>
>> void VParameter::NullString( void )
>>
>> {
>>
>> SQLRETURN rc;
>>
>> m_LenInd = SQL_NULL_DATA;
>>
>> rc = SQLBindParameter( m_hStmt, m_paramNumber,
>> SQL_PARAM_INPUT,
>>
>> SQL_C_CHAR, SQL_CHAR, 0, 0,
>>
>> 0, 0, (SQLLEN *) &m_LenInd );
>>
>> CHECK_STMT( m_hStmt, rc );
>>
>> }
>>
>> The error is:
>> (HY104) [Microsoft][ODBC SQL Server Driver]Invalid precision
>> value
.
- References:
- How do you set a string parameter to NULL?
- From: Arnie
- Re: How do you set a string parameter to NULL?
- From: Scot T Brennecke
- How do you set a string parameter to NULL?
- Prev by Date: how to read the log file created by odbc trace
- Next by Date: Binding to an SQL Server DATETIME parameter
- Previous by thread: Re: How do you set a string parameter to NULL?
- Next by thread: Changing ODBC Connect settings in MS ACCESS linked table property
- Index(es):
Loading