[unixODBC-support] Updating values using parameters

Wang, Alan alan.wang at sap.com
Sat Oct 9 09:38:02 BST 2004


Try to change this line 

SQLBindParameter(stmtHandle, 1, SQL_PARAM_INPUT, SQL_C_CHAR,
SQL_LONGVARCHAR, length, 0, theValue, 0, NULL);

to :

long retSize = SQL_NTS;
SQLBindParameter(stmtHandle, 1, SQL_PARAM_INPUT, SQL_C_CHAR,
SQL_LONGVARCHAR, length, 0, theValue, 0, &retSize );


--
Alan

-----Original Message-----
From: unixodbc-support-bounces at mail.easysoft.com [mailto:unixodbc-support-bounces at mail.easysoft.com] On Behalf Of Ian Ashley
Sent: 2004年10月4日 21:51
To: unixodbc-support at mail.easysoft.com
Subject: [unixODBC-support] Updating values using parameters


I am having a problem trying to use a parameter to update column in a table.
Use the following code fragment

/* P_LONGTEXT is a TEXT column
 * although I cannot get it to work on an INTEGER column either
 */

SQLPrepare(stmtHandle, ³UPDATE P_SIMPLE SET P_LONGTEXT = ? WHERE P__URN =
1²);
SQLBindParameter(stmtHandle, 1, SQL_PARAM_INPUT, SQL_C_CHAR,
SQL_LONGVARCHAR, length, 0, theValue, 0, NULL);

SQLExecute(stmtHandle);

I am using FreeTDS to talk to a Sequel Server.

I have tried various other solutions including using WRITETEXT but cannot
get any one to work. When I use the commands

DECLARE @ptrval VARBINARY(16)
SELECT @ptrval = TEXTPTR(P_LONGTEXT) FROM P_SIMPLE WHERE P__URN = 1

I get an error that @ptrval isn't defined. I get this if I use iSQL as well
as from my code.

Any solution where the text doesn't have to be included directly in the SQL
will suffice.

Cheers,
Ian


_______________________________________________
unixODBC-support mailing list
unixODBC-support at mail.easysoft.com
http://mail.easysoft.com/mailman/listinfo/unixodbc-support




More information about the unixODBC-support mailing list