Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help! View not updating table
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00367888
Message ID:
00368241
Vues:
25
Hi Nick,

The view code looks ok to me. The following line should be different (but I was correct earlier so I don't think that is it).
>xxx = tableupdate(.t.,.t.,'employee')
xxx = tableupdate(.t.,.t.,'LV_EMPLOYEE_U')

Can you just use the view from the command line, change a field, and tableupdate(.t.) and see if it works?


>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
Roi
'MCP' Visual FoxPro

In Rome, there was a poem.
About a dog, who found two bone.
He lick the one, he lick the other.
He went pyscho, he drop dead!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform