Hello,
Sorry I made a mistake with the example, it is
actually:
// ...
PVOID pvdata1;
pvdata1 = new float[1];
((double*)pvdata1)[0] = 12345.6789f;
wsprintf(colname, "Score");
srv_describe(srvproc
, 1 /* column #1 */
, colname /* column name */
, SRV_NULLTERM /* column name ending */
, SRVNUMERIC
, (DBINT)sizeof(DBNUMERIC)
, SRVNUMERIC
, (DBINT)sizeof(DBNUMERIC)
, pvdata1);
srv_setcoldata(srvproc, 1, pvdata1);
srv_setcollen (srvproc, 1, sizeof(float));
// ...
Thanks in advance,
Best Regards,
Giovanni
[quoted text, click to view] "Giovanni Azua" <bravegag@hotmail.com> wrote in message
news:2u9qr5F27hn83U1@uni-berlin.de...
> Hello all,
>
> I have spend quite some time now but don't manage to
> find out how to have the srv_describe function working
> properly for target NUMERIC(x,x) and NUMERIC types.
>
> Already tried several alternatives like e.g.
>
> // ...
> PVOID pvdata1;
> strcpy((char*)pvdata1, "12345.6789");
> wsprintf(colname, "Score");
> srv_describe(srvproc
> , 1 /* column #1 */
> , colname /* column name */
> , SRV_NULLTERM /* column name ending */
> , SRVNUMERIC
> , (DBINT)sizeof(DBNUMERIC)
> , SRVNUMERIC
> , (DBINT)sizeof(DBNUMERIC)
> , pvdata1);
> srv_setcoldata(srvproc, 1, pvdata1);
> srv_setcollen (srvproc, 1, strlen((char*)pvdata1));
> // ...
>
> but obviously does not work, I get an empty result
> set.
>
> I could only manage by converting the numeric value
> to string from C and then sending only strings but the
> SQL side expects actually a number(x,x) and is a customer
> , in which case, I would never propose to be casting the
> thing from TSQL.
>
> Any ideas how to do it? The documentation and examples is
> quite limited in this area.
>
> Thanks in advance,
> Best Regards,
> Giovanni
>
>