Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Updating a view created with CREATE SQL VIEW
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Updating a view created with CREATE SQL VIEW
Miscellaneous
Thread ID:
00096867
Message ID:
00096867
Views:
55
I'm trying to update a view created via code. Here is the code I am using to create this view:

create view vSysRelations as ;
select ;
RELATIONS.REL_ID, ;
TABLES.TBL_NAME as TABLE1, ;
FIELDS.FLD_NAME as FIELD1, ;
TABLES_A.TBL_NAME as TABLE2, ;
FIELDS_A.FLD_NAME as FIELD2, ;
RELATIONS.REL_PROCESSING, ;
RELATIONS.REL_NOTE ;
from 'DATA MAPPING!RELATIONS' ;
inner join 'DATA MAPPING!SYSTEM' on RELATIONS.REL_SYSTEM1ID = SYSTEM.SYS_ID ;
inner join 'DATA MAPPING!TABLES' on RELATIONS.REL_TABLE1ID = TABLES.TBL_ID ;
inner join 'DATA MAPPING!FIELDS' on RELATIONS.REL_FIELD1ID = FIELDS.FLD_ID ;
inner join 'DATA MAPPING!SYSTEM' SYSTEM_A on RELATIONS.REL_SYSTEM2ID = SYSTEM_A.SYS_ID ;
inner join 'DATA MAPPING!TABLES' TABLES_A on RELATIONS.REL_TABLE2ID = TABLES_A.TBL_ID ;
inner join 'DATA MAPPING!FIELDS' FIELDS_A on RELATIONS.REL_FIELD2ID = FIELDS_A.FLD_ID ;
where RELATIONS.REL_SYSTEM1ID = ?nSystem1ID ;
and RELATIONS.REL_SYSTEM2ID = ?nSystem2ID ;
order by RELATIONS.REL_ID

=dbsetprop('vSysRelations', 'View', 'Tables', 'DATA MAPPING!RELATIONS')
=dbsetprop('vSysRelations', 'View', 'SendUpdates', .t.)
=dbsetprop('vSysRelations.REL_NOTE', 'Field', 'Updatable', .t.)
=dbsetprop('vSysRelations.REL_PROCESSING', 'Field', 'Updatable', .t.)


I run this code and then open the view. I get a cursor with about 20 entries which is correct. Everything works fine until I change the value of either of the two updatable fields; REL_NOTE (a memo) or REL_PROCESSING (a logical). As soon as I change a value and try to move to the next record I get the following error:

"No update tables are specified. Use the Tables property of the cursor."

When I DISPLAY DATABASE, the Tables value for this view is "DATA MAPPING!RELATIONS", which is the only table I want updated.

Any help would be greatly appreciated.
Next
Reply
Map
View

Click here to load this message in the networking platform