Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB General » View Thread |
Messages 1 to 8 of 8 total |
Create a new table from old EDBTable with calc fields |
Wed, Jul 7 2010 5:25 AM | Permanent Link |
Mauro Botta | Hi
I have a EDBTable with any calc fields and any LookupFields. i need to generate a new table ( memory ... or real.. ) where the "calcfield " field are transformed in true data field. example : TRUE_DATA_FIELD_1 INTEGER MyCalcFieldForDescritionExtraTable STRING 30 ... to : TRUE_DATA_FIELD_1 INTEGER TRUE_DATA_FIELD_2 STRING 30 ... Any hint ? |
Wed, Jul 7 2010 5:46 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Mauro
What about CREATE TABLE AS ... WITH DATA Roy Lambert [Team Elevate] |
Wed, Jul 7 2010 6:06 AM | Permanent Link |
Mauro Botta | >>> What about CREATE TABLE AS ... WITH DATA
Hi Roy i don't understand. How i can use CREATE TABLE and get Field Structure from my EDBTable with CalcFields ? |
Wed, Jul 7 2010 6:36 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Mauro
Where are the calcfields defined - within ElevateDB or as part of a table in Delphi? Roy Lambert [Team Elevate] |
Wed, Jul 7 2010 6:57 AM | Permanent Link |
Mauro Botta | >Where are the calcfields defined - within ElevateDB or as part of a table in Delphi?
part of a table in Delphi |
Wed, Jul 7 2010 8:20 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Mauro
In that case, and hoping all the fields you need are defined in the Delphi table, check out my post in the extensions ng Post: 1460696B-1D30-4A8C-992B-407699554EC0@news.elevatesoft.com Subject: Generate in memory table from TEDBTable component on a form I use it to generate in-memory tables from the table field & index definitions, but it would be trivial to point at a disk instead. You'll need to change this: if WhichTable.FieldList[Cntr].FieldKind = fkData to allow calculated fields as well. That will get you the structure. Populating the table would then be a simple Delphi procedure - loop through the source and insert into the copy. Roy Lambert [Team Elevate] |
Wed, Jul 7 2010 9:26 AM | Permanent Link |
Mauro Botta | Good source
only question : ---- for Cntr := 0 to WhichTable.FieldList.Count - 1 do begin if WhichTable.FieldList[Cntr].FieldKind = fkData then Maker.SQL.Add('"' + WhichTable.FieldList[Cntr].FieldName + '" ' + GetFieldType(WhichTable.FieldList[Cntr]) ','); end; ---- -> if WhichTable.FieldList[Cntr].FieldKind = fkData then Can i remove this code for create TRUE FIELDS for "CalcField" fields ? |
Wed, Jul 7 2010 10:25 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Mauro
Best way to find out is to try it I think fkCalculated dields hold the necessary information. From the D2006 OLH TFieldKind = (fkData, fkCalculated, fkLookup, fkInternalCalc, fkAggregate); So I'd probably alter the test to if WhichTable.FieldList[Cntr].FieldKind in (fkData, fkCalculated) then ... rather than remove it. I have no idea what creates these two types fkInternalCalc, fkAggregate so I'd play safe. Roy Lambert [Team Elevate] |
This web page was last updated on Saturday, April 27, 2024 at 08:52 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |