I am trying to update/insert records in a DB, using SQL statements. All numeric formats seem to work fine except for the Scientific (exponential) notations. In an UPDATE statement it raises "type mismatch" error (Example1). I managed to go arround it by using casting (Example2).
When using INSER statement however nothing worked. The scientific notation results in "type mismatch" (Example3). The attempt to cast the values was also not successfull (Example4).
Does anyone know how can I overcome the problem. I need to use scientific notation because of precision issues. There seems to be an inconsistency in the way various formats and castings are handled.
By the way I am using a local Paradox DB (Local SQL) and I do not wish to control the tables directly, but through SQL for later portability.
Thanks
Example1:
---------
UPDATE 'tblWireMaterialList'
SET MaterialSortOrder = 1,
MaterialRes = 1.345E-8 <--- "type mismatch" error
Example2:
---------
UPDATE 'tblWireMaterialList'
SET MaterialSortOrder = CAST ('1') AS INTEGER,
MaterialRes = CAST ('1.345E-8') AS NUMERIC <--- casting works in UPDATE
Example3:
---------
INSERT INTO 'tblMaterials'
(MaterialSortOrder, MaterialCode, MaterialRes)
VALUES (1, 'Fe', 1.345E-8) <--- the last value causes "tupe mismatch error
Example4:
---------
INSERT INTO 'tblMaterials'
(MaterialSortOrder, MaterialCode, MaterialRes)
VALUES (1, 'fe', CAST ('1.345E-8') AS NUMERIC) <--- does not work "illegal use of keyword"
When using INSER statement however nothing worked. The scientific notation results in "type mismatch" (Example3). The attempt to cast the values was also not successfull (Example4).
Does anyone know how can I overcome the problem. I need to use scientific notation because of precision issues. There seems to be an inconsistency in the way various formats and castings are handled.
By the way I am using a local Paradox DB (Local SQL) and I do not wish to control the tables directly, but through SQL for later portability.
Thanks
Example1:
---------
UPDATE 'tblWireMaterialList'
SET MaterialSortOrder = 1,
MaterialRes = 1.345E-8 <--- "type mismatch" error
Example2:
---------
UPDATE 'tblWireMaterialList'
SET MaterialSortOrder = CAST ('1') AS INTEGER,
MaterialRes = CAST ('1.345E-8') AS NUMERIC <--- casting works in UPDATE
Example3:
---------
INSERT INTO 'tblMaterials'
(MaterialSortOrder, MaterialCode, MaterialRes)
VALUES (1, 'Fe', 1.345E-8) <--- the last value causes "tupe mismatch error
Example4:
---------
INSERT INTO 'tblMaterials'
(MaterialSortOrder, MaterialCode, MaterialRes)
VALUES (1, 'fe', CAST ('1.345E-8') AS NUMERIC) <--- does not work "illegal use of keyword"