Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

View update confilct 1

Status
Not open for further replies.

parslej

Programmer
Nov 21, 2001
40
PL
Why when I add in my view
new record (APPEND BLANK .. IN)
and fill more 1 field (REPLACE... IN)
I have update confilct (apter tableupdate) ?
So, I must insert new row, close and re-open view, and from this time I can update how many fields I need...

It's possible to do it by other way (my tables have many records so view's restarting time is too long) ?
 
In views (in particular), it's best to use the "one-step" approach - the SQL - Insert statement, instead of your two step approach.
INSERT INTO myView (myfield) VALUES (newvalue)
This will allow any fields with default values to be inserted, and because you never have the BLANK fields in the PK, or other field or record rules that require non-blanks, you shouldn't get you conflict errors.

Rick


 
Yeah! Now it's working...

But I have other problem: when I insert datas into view, next execute: tableupdate(.t.) base tables doesn't update..
I check in view fields what should be update but nothing happended...

You know why ?
 
sorry - my foult (I don't check send SQL update)...

But the problem still is:

I can INSERT all field as I want to view, and it's update base tables ok...

but if I want update view's record (when I just insert in view) I can't - when I browse this view it don't have fill ID_MAIN field (from main table) but if I close view and reopen it is filled and I can update fields what I want.

My update command:

nRec=recno('main_query') && because id_main doesn't exist
UPDATE main_query SET start=datetime() ;
WHEN recno('main_query')=nRec

Is possible to resolve this ?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top