SQLPutData against MSSQL view



Hi,

I am trying to insert data into SQL Server view, which has "text" column
using MDAC driver (SQL Server driver).
When application calls SQLPutData, the following error returned:

DIAG [HY000] [Microsoft][ODBC SQL Server Driver]Warning: Partial
insert/update. The insert/update of a text or image column(s) did not
succeed. (0)

DIAG [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]The READTEXT,
WRITETEXT, and UPDATETEXT statements cannot be used with views or functions.
(285)

Since MDAC driver cannot recognize SQL_VARCHAR length=0(unlimited), I am
binding the parameter with SQL_LONGVARCHAR.
Prepared statement>> "INSERT INTO "J15USER1"."MSSQL_LOB_VIEW" ( "INT_COL1",
"CHAR_COL1", "VARCHAR_COL1", "CLOB_COL1") VALUES ( 2, 'bb', 'bbb',
)

If I use SQL Native Client, I am able to bind the parameter with SQL_VARCHAR
length=0 and the insert into view is successful.

I could not find any limitation about using SQLPutData against view column.
Does anyone know if this is an expected behavior or not?

Thank you for your help,
Kaoru



SQLPrepare with return code 0 (SQL_SUCCESS)
HSTMT 2A9E3C00
UCHAR * 0x2ABDFD00 [ -3] "INSERT INTO
"J15USER1"."MSSQL_LOB_VIEW" ( "INT_COL1", "CHAR_COL1", "VARCHAR_COL1",
"CLOB_COL1") VALUES ( 2, 'bb', 'bbb', ? )\ 0"
SDWORD -3

SQLBindParameter with return code 0 (SQL_SUCCESS)
HSTMT 2A9E3C00
UWORD 1
SWORD 1 <SQL_PARAM_INPUT>
SWORD 1 <SQL_C_CHAR>
SWORD -1 <SQL_LONGVARCHAR>
SQLULEN 2147483647
SWORD 0
PTR 0x00000000
SQLLEN 0
SQLLEN * 0x2ABEFFBC (-2)

SQLPutData with return code -1 (SQL_ERROR)
HSTMT 2A9E3C00
PTR 0x2ABDFC20
SQLLEN 21

DIAG [HY000] [Microsoft][ODBC SQL Server Driver]Warning: Partial
insert/update. The insert/update of a text or image column(s) did not
succeed. (0)

DIAG [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]The READTEXT,
WRITETEXT,
and UPDATETEXT statements cannot be used with views or functions. (285)




.