oo40 - number type and ODynaset

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ak

    #1

    oo40 - number type and ODynaset

    Hi!

    I have a dynaset from a select string and want
    to insert a bunch of values into the columns/fields.

    Some of the columns are of type number afaik e.g.
    number(3) meaning only 3 digits are allowed.

    I am not quite sure how to do the approp conversion
    having the types integer, short etc in my program to
    the type 'number' column. It seems I get an error by the
    dynaset update everytime a number is larger than the
    allowed size.

    Is the size independent of the actual argument datatype
    to the SetFieldValue or is the size only in regard to number
    of digits?

    Is there some way to make sure that the value
    fits into the field when doing the SetFieldValue so
    that the update always succeeds? I would like to keep
    the constraints as that seems to be the only check
    on that correct values are written in the table.

    tia
    /ak

    PS. Is there any gottcha when it comes to using
    the field index instead of the actual name (SetFieldValue( 3,
    or SetFieldValue( "SOMECOL", ?When I do the former one
    I get no error when I do Update but on the other hand nothing
    is written. ;p

    env: vc6, oracle8, oo40, running in seperate thread


    int aValue = 12;
    long bValue = 121242;

    dyn.Open( db, "select * from sometable" );
    dyn.SetFieldVal ue( "SomeNumber ", aValue );
    dyn.SetFieldVal ue( "Someother" , bValue );
    ....
    dyn.Update() fails due to constraints on one of the
    Number columns. (annoying not know which until
    update)
Working...