🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.multi-tier
Article #339

Can't create FLOAT field... wants to be SMALLINT

#339
From: nhamawi none
Date: Tue, 05 Mar 2002 00:11
24 lines
2095 bytes
Product: C++ Builder 5.0 Update Pack 1
ODBC Driver: Informix 3.34 32-bit
OS: Windows 2000 SP2
 
When I create an Informix 9.3 table (using TTable::CreateTable) containing an ftFloat field, a "SMALLINT" field is created instead.  This can be confirmed with the ODBC tracing utility where you will find that C++ Builder (I assume via the BDE) is using the SQLExecDirect ODBC command to pass the parameter "result SMALLINT" instead of "result FLOAT".  I have no problems with any other datatypes.
 
I am using the following code to create the table:
 
    TTable *CurTable = new TTable(TestDataModule);
    TFieldDef *F;
    F = CurTable->FieldDefs->AddFieldDef();
    F->Name = "result"; 
    F->DataType = ftFloat; 
    CurTable->CreateTable(); // create the table

You can see the sample ODBC SQL call below:
 
TestCenter      3a8-3b0 EXIT  SQLExecDirect  with return code 0 (SQL_SUCCESS)
  HSTMT               02E024C8
  UCHAR *             0x01608C2C [      -3] " CREATE TABLE data1510 ( result SMALLINT ) \ 0"
  SDWORD                    -3

Any help on this matter would be greatly appreciated as this is slowing our production test software development.
Technical Details
Message-ID: <3c840d43$1_2@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!supernews.com!telocity-west!TELOCITY!hub1.meganetnews.com!newsfeed.sjc.globix.net!cyclone-sf.pbi.net!64.245.249.51!sfo2-feed1.news.digex.net!intermedia!news-hog.berkeley.edu!ucberkeley!enews.sgi.com!news.xtra.co.nz!newsfeeds.ihug.co.nz!ihug.co.nz!dnews

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fcd2b,46515b54b483f323,start
X-Google-Attributes: gidfcd2b,public
X-Google-ArrivalTime: 2002-03-04 16:13:49 PST
From: "nhamawi" none
Sender: "nhamawi" none
Reply-To: "nhamawi" none
Subject: Can't create FLOAT field... wants to be SMALLINT
Newsgroups: borland.public.cppbuilder.database.multi-tier
X-User-Info: 209.187.125.82 209.187.125.82    
NNTP-Posting-Host: 207.105.83.65
Message-ID: <3c840d43$1_2@dnews>
Date: 4 Mar 2002 16:11:47 -0800
X-Trace: dnews 1015287107 207.105.83.65 (4 Mar 2002 16:11:47 -0800)
Lines: 25
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!supernews.com!telocity-west!TELOCITY!hub1.meganetnews.com!newsfeed.sjc.globix.net!cyclone-sf.pbi.net!64.245.249.51!sfo2-feed1.news.digex.net!intermedia!news-hog.berkeley.edu!ucberkeley!enews.sgi.com!news.xtra.co.nz!newsfeeds.ihug.co.nz!ihug.co.nz!dnews