I’m still having trouble getting basic functionality with DA and ElevateDB.
I have created a (more or less) identical project/database with MySQL and that seems to work as expected.
What I have done:
- Created a simple database in ElevateDB and MySQL
- Created a minimal DA server and DA client
- Created basically identical schema(s) for each database
The trouble revolves around indexing, I think. I can’t seem to add or edit any records to the ElevateDB without getting errors. Deleting existing records seems to work fine.
The error I get when trying to add a new record is:
A problem occurred while inserting a record in table ‘mytable’, record ‘mytable:-1’.
ElevateDB Error #700 An error was found in the statement at line 1 and column 8 (ElevateDB Error #401 The function GetAutoIncValue does not exist in the schema Default)
I have tried changing the field type in the schema to Integer (from AutoInc). I have tried every possible combination of the check-boxes in the schema modeler that I could think of. I have also tried changing the field type in the ElevateDB. I can’t find a combination that works while having an index on the c_id field.
I do get different errors, but always some sort of error.
Here are the database definitions:
ElevateDB:
CREATE TABLE "mytable" (
"c_id" INTEGER GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1) NOT NULL,
"c_name" VARCHAR(100) COLLATE "UNI");
CREATE INDEX "PRIMARY" ON "mytable" ("c_id");
MySQL:
CREATE TABLE IF NOT EXISTS `mydb`.`mytable` (
`c_id` INT(11) NOT NULL AUTO_INCREMENT,
`c_name` VARCHAR(100) NULL DEFAULT NULL,
PRIMARY KEY (`c_id`))
Here is the schema: the only difference between the two is the
<ConnectionType>MySql</ConnectionType>
and
<ConnectionType>ElevateDB</ConnectionType>
line
<TDASchema>
<UnionDataTables IsObject="true" Count="0" IsCollection="true" Type="TDAUnionDataTableCollection" ItemClass="TDAUnionDataTable" />
<JoinDataTables IsObject="true" Count="0" IsCollection="true" Type="TDAJoinDataTableCollection" ItemClass="TDAJoinDataTable" />
<Datasets IsObject="true" Count="1" IsCollection="true" Type="TDADatasetCollection" ItemClass="TDADataset">
<Item0>
<ReadOnly>False</ReadOnly>
<Fields IsObject="true" Count="2" IsCollection="true" ItemClass="TDAField" Type="TDASchemaFieldCollection">
<Item0>
<Name>c_id</Name>
<Alignment>taLeftJustify</Alignment>
<Calculated>False</Calculated>
<ServerCalculated>False</ServerCalculated>
<DataType>datAutoInc</DataType>
<DefaultValue />
<CustomAttributes />
<DictionaryEntry />
<DisplayFormat />
<DisplayLabel>c_id</DisplayLabel>
<DisplayWidth>0</DisplayWidth>
<EditFormat />
<EditMask />
<InPrimaryKey>True</InPrimaryKey>
<LogChanges>True</LogChanges>
<ReadOnly>False</ReadOnly>
<RegExpression />
<Required>True</Required>
<ServerAutoRefresh>False</ServerAutoRefresh>
<Visible>True</Visible>
<Expression />
<Size>0</Size>
<DecimalScale>0</DecimalScale>
<DecimalPrecision>0</DecimalPrecision>
<BlobType>dabtUnknown</BlobType>
<GeneratorName />
<BusinessClassID />
<Description />
</Item0>
<Item1>
<Name>c_name</Name>
<Alignment>taLeftJustify</Alignment>
<Calculated>False</Calculated>
<ServerCalculated>False</ServerCalculated>
<DataType>datWideString</DataType>
<DefaultValue />
<CustomAttributes />
<DictionaryEntry />
<DisplayFormat />
<DisplayLabel>c_name</DisplayLabel>
<DisplayWidth>0</DisplayWidth>
<EditFormat />
<EditMask />
<InPrimaryKey>False</InPrimaryKey>
<LogChanges>True</LogChanges>
<ReadOnly>False</ReadOnly>
<RegExpression />
<Required>False</Required>
<ServerAutoRefresh>False</ServerAutoRefresh>
<Visible>True</Visible>
<Expression />
<Size>100</Size>
<DecimalScale>0</DecimalScale>
<DecimalPrecision>0</DecimalPrecision>
<BlobType>dabtUnknown</BlobType>
<GeneratorName />
<BusinessClassID />
<Description />
</Item1>
</Fields>
<BusinessRulesClient IsObject="true" Type="TDAClientBusinessRuleScript">
<CompileOnServer>False</CompileOnServer>
<RunOnClientAndServer>False</RunOnClientAndServer>
<Script />
<ScriptLanguageStr />
<Description />
<Name />
</BusinessRulesClient>
<BusinessRulesServer Type="TDABusinessRuleScript" IsObject="true">
<Script />
<ScriptLanguageStr />
<Description />
<Name />
</BusinessRulesServer>
<UpdateCommandName />
<DeleteCommandName />
<InsertCommandName />
<Statements IsCollection="true" IsObject="true" Count="1" ItemClass="TDAStatement" Type="TDAStatementCollection">
<Item0>
<Connection />
<SQL />
<TargetTable>mytable</TargetTable>
<ConnectionType>ElevateDB</ConnectionType>
<Default>False</Default>
<StatementName />
<StatementType>stAutoSQL</StatementType>
<GeneratorName />
<ColumnMappings IsObject="true" Count="2" IsCollection="true" Type="TDAColumnMappingCollection" ItemClass="TDAColumnMapping">
<Item0>
<DatasetField>c_id</DatasetField>
<SQLOrigin>c_id</SQLOrigin>
<TableField>c_id</TableField>
</Item0>
<Item1>
<DatasetField>c_name</DatasetField>
<SQLOrigin>c_name</SQLOrigin>
<TableField>c_name</TableField>
</Item1>
</ColumnMappings>
<Description />
</Item0>
</Statements>
<Params IsObject="true" Count="0" IsCollection="true" Type="TDAParamCollection" ItemClass="TDAParam" />
<CustomAttributes />
<IsPublic>True</IsPublic>
<DynamicWhereXML />
<BusinessClassID />
<Description />
<Name>mytable</Name>
</Item0>
</Datasets>
<Commands IsObject="true" Count="0" IsCollection="true" ItemClass="TDASQLCommand" Type="TDASQLCommandCollection" />
<RelationShips IsObject="true" Count="0" IsCollection="true" Type="TDADatasetRelationshipCollection" ItemClass="TDADatasetRelationship" />
<UpdateRules IsObject="true" Count="0" IsCollection="true" Type="TDAUpdateRuleCollection" ItemClass="TDAUpdateRule" />
<CustomAttributes />
<Version>0</Version>
<BusinessRulesServer Type="TDABusinessRuleScript" IsObject="true">
<Script />
<ScriptLanguageStr />
<Description />
<Name />
</BusinessRulesServer>
</TDASchema>
I’ve attached the server and client projects. In the server project there is a folder for the ElevateDB and MySQL schemas and connections. I have been copying them into the parent folder to switch between them.
app.zip (71.6 KB)
appServer.zip (857.0 KB)