scale of NUMERIC arguments to a stored procedure

scale of NUMERIC arguments to a stored procedure

Post by dyo.. » Fri, 18 Feb 2000 04:00:00



I'm using SQLPrepare/SQLExecute to invoke a stored procedure (against
SQLServer 7).  However, I have been unable to figure out how to set the
scale of my NUMERIC arguments.  In the database they are set at 18,6.
The scale always defaults to 0, truncating my numbers to whole numbers.

I've tried using

SQLSetDescField(desc, index, SQL_DESC_SCALE, (SQLPOINTER) 6, 0);

to set the scale.  I've this with desc set as both

SQLGetStmtAttr(stmt, SQL_ATTR_IMP_PARAM_DESC, &desc, 0, NULL);

SQLGetStmtAttr(stmt, SQL_ATTR_APP_PARAM_DESC, &desc, 0, NULL);

Neither seem to affect data.  When using SQL_ATTR_APP_PARAM_DESC I get
invalid string length errors.  I guess this argument is applied to all
arguments (my sproc has 40+ arguments of different types).

Has anyone been able to get this to work through ODBC?

-- derek

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

1. SQL Server 2000/SQLCommandBuilder Dropping Scale on Stored Procedure Update

I have a column in a table defined as

Price Decimal(18,5)

I am using the SqlCommandBuilder class in .Net to retrieve the parms
of a stored procedure. The problem is that when I retrieve the parm
list it always drops the scale. So when I try and pass a value of
1.1111 it end up as 1.0.

Is this a SQL Server problem or a SQLCommandBuilder problem does
anyone know?

2. Computing News & Review

3. Unexpected situation for Character argument in a stored procedure

4. Can't connect toSQL Server on another machine.

5. Passing argument from Active X to Lookup Query executing a stored procedure

6. Proceedings of VLDB---details wanted

7. Stored Procedure Arguments

8. Easy SQL Query question

9. Stored procedure with variable number of arguments

10. Variable number of arguments to a stored procedure

11. Optional Stored Procedure Arguments w/ SQLOLEDB

12. Passing array arguments into stored procedure

13. help with stored procedure and passing arguments to SELECT