Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Remote Views and Oracle problems (VARCHAR2)
Message
 
 
To
21/12/1999 14:02:55
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00306725
Message ID:
00306856
Views:
31
>>Then you have zeroed out all your options. I suggest adding another column to the Oracle table[s] and use integers as your surrogate PK. Otherwise you have to change to data type of the key field to CHARacter. PK data types of varchar2 are generally a bad idea.
>
>I agree 100% that varchar as a PK is a bad idea. Currently I am working on a support application to another app that controls the Oracle database. I am going to try to add my own key fields and see if it has any effects on the original app. Is there a way to use a sequence as a default field value in Oracle? If not, then I'm not sure how I can insert values into the new surrogate key fields since I'm not in control of inserting the records. Thanks for the help..
>
>-David-

Currently, Oracle does not support functions as default field values. I do use the Oracle sequence feature to generate my PKs. But I have to use an after insert trigger to populate the PK field with the sequence NEXTVAL. For a table with high volume inserts, I have to use a remote view of the sequence NEXTVAL to pre-populate the PK field value before inserting the rows.

This remote view is created by:

create sql view v_sequence_mytable remote connect myconnect share as select sequence_name.nextval as "nextval" from dual

Then when I need the nextval, I issue a REQUERY() on the view.
Mark McCasland
Midlothian, TX USA
Previous
Reply
Map
View

Click here to load this message in the networking platform