Calling a stored procedure with [INOUT] parameters returned 22001 "String data, right truncation" (Reported, not reproduced)

Applies to: reported on Clarion 6.3 with the ODBC driver against SQL Server 2005. Not reproduced on any later version; whether current drivers behave the same is not known.

Problem as reported

NORESULTCALL dbo.proc(&Var1[INOUT], &Var2[INOUT]) with BOUND STRING(250) variables returned 22001 [Microsoft][ODBC SQL Server Driver] String data, right truncation. The same procedure ran from SQL Server Management Studio. With one parameter declared [IN] and the other [OUT] the call worked.

What the thread found

  • The poster's driver trace showed a STRING(250) sent as char(251) and a CSTRING(251) as varchar(250); the posters read the INOUT binding as tripping over that mismatch. A second developer saw the same result on his machine. The archive holds no reply from SoftVelocity, so this stays a report from two users, not a confirmed driver defect.
  • The shapes that worked for them: separate [IN] and [OUT] parameters, or building the call with literal values ('...(' & CLIP(Var1) & ',...') when the procedure can be changed.
  • The help carries a bound-parameter example (written for SQL Anywhere) that is the reference for the syntax.

Caveats

If you do not control the stored procedure (the original poster's case, a DB2 target in production), the INOUT shape could not be made to work in the thread.

Today (2026)

Not reproduced. This entry records a 2010 report; it does not state a defect of the driver. If the INOUT shape works for you on a current build, say so in the comments and the entry closes; if you see the error, post the driver trace and the entry gets re-tested.

Sources: Patrick D. (Jun 2010, the question and the trace), Sam, John D., Michael G. (Jun 2010) in softvelocity.clarion.databasedrivers.