ORA-00904 invalid column name

After rename the fieldname, the DataSet can not be updated, a new record can not be inserted. The error message is "ORA-00904 invalid column name". Here is SQL of the Oracle DataSet:
'SELECT C.rowid,'+
' C.CustomerName Customer_Name, C.CustomerNo Customer_No, C.contractno Contract_No,' +
' C.CustomerContact CUSTOMER_CONTACT' +
' FROM customerContracts C ';

Anybody knows how to deal with it? Thank you!
 
For an updateable dataset, the column names must not be renamed in the field list. There are 3 things you can do about this:

1. Change the TField.DisplayName instead.
2. Use a view to change the column names.
3. Rename the columns of the table if you don't like them.

------------------
Marco Kalter
Allround Automations
 
I am having the same problem. Here is my query:

SELECT c.rowid, c.*, l.PrimaryContact
FROM I_SiteContact c, I_SiteContactSiteLink l
WHERE l.SiteID = :SiteID AND
c.SiteContactID = l.SiteContactID
ORDER BY c.LastName

Is this dataset not updateable because it has a column from a second table?
 
AFAIK you'll never get a *joined* dataset to update unless you specifically do it in two separate stages - ie: update each table by setting the values pre post to a separate dataset on that table (and that one table alone) - which kind of defeats the purpose of putting it into a dataset ;=)
 
Only the fields od one table of a join can be updated. In your example this is I_SiteContact. The l.PrimaryContact field cannot be updated.

------------------
Marco Kalter
Allround Automations
 
Back
Top