Page 1 of 1

Problem when using calculated fields (in SQL script)

Posted: Fri 09 Dec 2005 11:27
by swierzbicki
Hi,

I have a problem when using Calculated fields inside a SQL Statement :

Select
Sum1,
Sum2,
(Sum1 + Sum2) As TotalSums
From
Table

Fields Sum1 and Sum2 exists.
Field TotalSums is a calculated field.

Link the corresponding myquery to a dataset.
Link the dataset to a grid....

1) open the dataset
2) edit the dataset
3) Change value from SUM1 field
4) Post the changes.

This will raise an exception, telling me that field TotalSums doesn't exists.

When opening (in design time) the MyQurey Editor, and looking at the SQL Generator, TotalSums field is present into the key and updatable fields (that shouldn't).

Is there a way to fix this without generating Insert / Update / Delete statements ?

Thank you

Posted: Fri 09 Dec 2005 13:01
by Ikar
Just add unique (autoincrement) field to select clause.

Posted: Fri 09 Dec 2005 16:00
by swierzbicki
Hello Ikar,

It was an exemple that I gave you. have an ssue with a table having an AutoInc fields....

This doesn't helps !
I

Posted: Fri 09 Dec 2005 16:06
by swierzbicki
Hello Ikar,

It was an exemple that I gave you. have an ssue with a table having an AutoInc fields....

This doesn't helps !
I

Posted: Sat 10 Dec 2005 12:13
by GEswin
Add the AutoInc field in the select statement.