Page 1 of 1

A problem with StoredProc->Params.. AsString

Posted: Wed 17 Jan 2007 09:51
by Lutz
Hi,

C++-Builder 6.0
ODAC 5.80 Built 38
Oracle 10g2

I have a Oracle-Procedur with a NUMBER Input-Parameter
as following (inside a package):

Code: Select all

    PROCEDURE addNumber(
        val  IN NUMBER)
    IS
    BEGIN

        DBMS_OUTPUT.put_line('=====> addNumber: insert Value as Number') ;
        DBMS_OUTPUT.put_line(' Value: '||val);

        INSERT INTO testtab (val)
        VALUES (addNumber.val);

    END addNumber;
where testtab is a table with ONLY a NUMBER-Field

When I use the Construct
OraStoredProc->Params->ParamByName(name)->AsString = val;
OR
OraStoredProc->Params->Items[0]->AsString = val;
AND val has more then 8 Digits

ODAC cuts val to 8 Digits,
that means at Oracle Procedure receives only the first 8 digits
(e.g. "1234567890" -> "12345678")

The use of
OraStoredProc1->Params->ParamValues[name] = val;
works, but there is a problem when val IS NULL, because I like to use the AsString - Property

Same problem in ODAC 5.70 Build 39.
With ODAC 5.70 Build 33 it works fine.

Posted: Thu 18 Jan 2007 07:59
by Challenger
We couldn't reproduce this situation. Please try to put OraSQLMonitor on your form, and use Core Lab DBMonitor or SQL Monitor to detect type and value of the parameter. Please send to ODAC support address complete sample that demonstrates this problem and including script to create server objects.