oo40 - number type and ODynaset

From: ak <ak_at_workmail.com>
Date: Thu, 11 Dec 2003 19:28:46 +0800
Message-ID: <m7kgtvgtge164pjuao0s8ni1m1ble69imd_at_4ax.com>


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.


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.SetFieldValue( "SomeNumber", aValue );
dyn.SetFieldValue( "Someother", bValue );
dyn.Update() fails due to constraints on one of the Number columns. (annoying not know which until update) Received on Thu Dec 11 2003 - 12:28:46 CET

Original text of this message