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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remote View ORACLE primary key

Status
Not open for further replies.

dejanj

Programmer
Apr 22, 2002
25
0
0
AU
Hi All,

I would like to insert all the values at the time of saving in remote view but oracle or Foxpro doesn't save the value for primary key. Once i am on the record ( remote view ) which i am updating or adding only after REQUERY(), value in my primary Key field appears.
Expl.
TEST with 2 fields NAME C(20) and PK NUM (10)
PK field is set to be Primary key, not allowed NULL and value has to be unique.
There is trigger TEST_NUMBERING which inserts the value in PK field before insert.
..and SEQUENCE TEST_NUMBERING_SEQ for taking the next value from the row.

I have record buffering enabled and after inserting the values in the name i issue TABLEUPDATE(.t.,.t.,'test')
I name my remote view TEST but value in PK field doesn't appear until i REQUERY() the view.

Is this normal behaviour of ORACLE8i and can i change it to be like in SQL Server for expl. ?

Thanks for any insights.

Dejan

 
Dejan,

Check the Update Criteria page in the view designer, and make sure there is a tick against the primary key field in the column under the pencil icon.

By default, VFP does not put a tick against the PK, because you normally don't update the key field. But you do need it when inserting a new record.

If you want to toggle the setting programmatically, you can do so with CURSORSETPROP().

Mike


Mike Lewis
Edinburgh, Scotland
 
Mike,

Thanks for jumping in to help. I did check. It didn't make any difference with ticked pencil icon for PK or not.
When i run TABLEUPDATE(.T.) it still dosn't show in the view. Only when i issue requery(). There must be something else...

I understand when i use surogate PK i don't display to the user but can i effectivly and reliably count on that TABLEUPDATE() function stores the values in ORACLE table or should i rely on REQUERY().

Dejan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top