--- psqlodbc-08.00.0101/convert.c	2005-01-17 04:12:52.000000000 -0600
+++ psqlodbc-08.00.0101.patch/convert.c	2005-03-07 12:14:18.653080285 -0600
@@ -2989,6 +2989,11 @@
 			if (param_sqltype == SQL_BIT)
 				CVT_APPEND_CHAR(qb, '\'');		/* Open Quote */
 
+			if (param_sqltype == SQL_SMALLINT)
+			{
+				CVT_APPEND_STR(qb, "(");
+			}
+
 			if (buf)
 			{
 				switch (used)
@@ -3008,7 +3013,7 @@
 			if (param_sqltype == SQL_SMALLINT)
 			{
 				/* needs cast because there is no automatic downcast from int4 constants */
-				CVT_APPEND_STR(qb, "::int2");
+				CVT_APPEND_STR(qb, ")::int2");
 			}
 
 			if (param_sqltype == SQL_BIT)
