Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help! View not updating table
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00367888
Message ID:
00368230
Views:
22
Thanks for answering Roi. I used eview and here is the code for view:***************** Begin View Definition LV_EMPLOYEE_U ***************

CREATE SQL VIEW "LV_EMPLOYEE_U" ;
AS SELECT Employee.e_id, Employee.e_cto FROM employee!employee

DBSetProp('LV_EMPLOYEE_U', 'View', 'UpdateType', 1)
DBSetProp('LV_EMPLOYEE_U', 'View', 'WhereType', 3)
DBSetProp('LV_EMPLOYEE_U', 'View', 'FetchMemo', .T.)
DBSetProp('LV_EMPLOYEE_U', 'View', 'SendUpdates', .T.)
DBSetProp('LV_EMPLOYEE_U', 'View', 'UseMemoSize', 255)
DBSetProp('LV_EMPLOYEE_U', 'View', 'FetchSize', 100)
DBSetProp('LV_EMPLOYEE_U', 'View', 'MaxRecords', -1)
DBSetProp('LV_EMPLOYEE_U', 'View', 'Tables', 'employee!employee')
DBSetProp('LV_EMPLOYEE_U', 'View', 'Prepared', .F.)
DBSetProp('LV_EMPLOYEE_U', 'View', 'CompareMemo', .T.)
DBSetProp('LV_EMPLOYEE_U', 'View', 'FetchAsNeeded', .T.)
DBSetProp('LV_EMPLOYEE_U', 'View', 'FetchSize', 100)
DBSetProp('LV_EMPLOYEE_U', 'View', 'Comment', "")
DBSetProp('LV_EMPLOYEE_U', 'View', 'BatchUpdateCount', 1)
DBSetProp('LV_EMPLOYEE_U', 'View', 'ShareConnection', .F.)

*!* Field Level Properties for LV_EMPLOYEE_U
* Props for the LV_EMPLOYEE_U.e_id field.
DBSetProp('LV_EMPLOYEE_U.e_id', 'Field', 'KeyField', .T.)
DBSetProp('LV_EMPLOYEE_U.e_id', 'Field', 'Updatable', .F.)
DBSetProp('LV_EMPLOYEE_U.e_id', 'Field', 'UpdateName', 'employee!employee.e_id')
DBSetProp('LV_EMPLOYEE_U.e_id', 'Field', 'DataType', "I")
* Props for the LV_EMPLOYEE_U.e_cto field.
DBSetProp('LV_EMPLOYEE_U.e_cto', 'Field', 'KeyField', .F.)
DBSetProp('LV_EMPLOYEE_U.e_cto', 'Field', 'Updatable', .T.)
DBSetProp('LV_EMPLOYEE_U.e_cto', 'Field', 'UpdateName', 'employee!employee.e_cto')
DBSetProp('LV_EMPLOYEE_U.e_cto', 'Field', 'DataType', "N(8,2)")


The only thing existing in my data environment is only one view called lv_employee_u. Here is the following code that I am trying perform. Notice, when I do update on lv_employee_u, that is where I am having the problem. I even do a tableupdate on core underlying table called employee:


for aa = 1 to l
h = .a__gen10[aa,1] &&old snapshot cto
i = .a__gen10[aa,2] &&old snapshot cto date
j = .a__gen10[aa,6] &&old snapshot id
p = a__gen20[aa,1] &&new snapshot cto
q = a__gen20[aa,2] &&mew snapshot cto date
r = a__gen20[aa,6] &&new snapshot id

if a__gen20[aa,1] <> .a__gen10[aa,1]
insert into cto (c_e_id, c_oldcto, c_newcto, c_date);
values (r,h,p,q)
update lv_employee_u set lv_employee_u.e_cto = p where lv_employee_u.e_id = r
xxx = tableupdate(.t.,.t.,'employee')
endif
endfor


Thanks
Nick Patel
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform