Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Type mismatch for field "xxxx", expecting: Integer actual: Float

Type mismatch for field "xxxx", expecting: Integer actual: Float

Type mismatch for field "xxxx", expecting: Integer actual: Float


I am trying to find the source of this error:
'Type mismatch for field "xxxx", expecting: Integer actual: Float'

I have an application that queries an Oracle 8i database from Delphi CS 5 with sp1 running under Windows NT Workstation 4 Sp6a

In the BDE Administrator, the native Oracle driver is configured as
The enable integers entry is true
The Dll32 entry is SQLORA8.DLL
The Vendor Init entry is OCI.dll

This error occurs intermittently.

Anyone who has heard of this error or has any information, please respond.


RE: Type mismatch for field "xxxx", expecting: Integer actual: Float


Have you formally instantiated any field objects in the data set objects bound to your Oracle tables?  If so, have any of the data types changed since then?  If so, you may need to delete your previously declared tDield objects and reinstance them.

You may be able to change the type of the tField in question without deleting it first.  It takes a little bit of work, but can be done...expecially if you're using Delphi 5's capability to save forms as text files.

(If you're not using Delphi 5, take a look at the convert utility in the BIN\ folder; it will translate DFM's to text files and back.)

I say this because I've only seen this when:

-- I've restructured a table and forgotten to update my field objects.

-- Neglected to use the proper AsDatatype properties when assigning to or reading values from those field objects.

As an example of the latter, I nearly always use something along these lines:

   TField1.asInteger := someIntValue;
   tField2.asFloat := someFloatValue;
   tField1.asInteger := trunc( someInvValue );

Bottom line, something is expecting an integer value but is getting a floating point one instead.  Try to determine which object is failing and that should lead you to the real problem in pretty short order.

Hope this helps...

-- Lance

RE: Type mismatch for field "xxxx", expecting: Integer actual: Float


Thanks for your suggestions.  

I should have mentioned that no changes have been made to the previously working program code.

There is an TIntegerField which is receiving a field from a query.  The declaration of the field in the database is number (10, 0).  It is a known attribute of Oracle that all number fields are stored internally as floats.  The automatic conversion of these fields in BDE is governed by settings in the BDE Admin utility under the Configuration/Drivers/Native key.  For Oracle 8i to enable the return of integers you must change the entries for DLL32, Vendor Init and enable integers.  This much I think is true.

What I suspect, and was hoping another person might have found, is an as yet unknown (to me) setting for telling BDE to REALLY send my aliases that use native Oracle integers even when the underlying datatype is float.  Or that something in the Oracle Client Interface is being changed by the all powerful "preventor of information services", the Oracle DBA, who is beyond my reach.

At this point I am ready to code around this by trapping this sometime exception and truncating the returned value in a new assignment statement.  This is a last resort because the code I am changing belongs to another.

Thanks again for your reply.  I will post any solution I get here.


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close