Updating primary key

Rated 4.18/5 based on 770 customer reviews

EDIT 2: The information that you need is found in sys.foreign_keys.You can select from that table to get all the information you need.E., DO -2 TO EXISTING START DATE) AND SELECTED ALL THE ELIGIBLE RECORDS INTO THIS AND TABLE AND CREATED UNIQUE INDEX ON IT. Count of Tables : TEMP_WED_TO_MONDAY is 46,921,912 and total table count is 48052365 DECLARE CURSOR UPDATE_TEMP_DATE IS SELECT A, B, C, D, E, F, G, E - 2 NEW_E FROM TEMP_WED_TO_MOONDAY; TYPE UPDATE_TEMP_DATE_REC IS RECORD ( A VARCHAR2 (50 CHAR), B VARCHAR2 (50 CHAR), C VARCHAR2 (50 CHAR), D VARCHAR2 (18 CHAR), E DATE, F NUMBER, G VARCHAR2 (50 CHAR), NEW_E DATE ); TYPE UPDATE_TEMP_DATE_TBL_TYPE IS TABLE OF UPDATE_TEMP_DATE_REC; UPDATE_TEMP_DATE_TBL UPDATE_TEMP_DATE_TBL_TYPE; BEGIN OPEN UPDATE_TEMP_DATE; LOOP FETCH UPDATE_TEMP_DATE BULK COLLECT INTO UPDATE_TEMP_DATE_TBL LIMIT 1000000; EXIT WHEN UPDATE_TEMP_DATE_TBL. G; COMMIT; END LOOP; CLOSE UPDATE_TEMP_DATE; END; But from last 6 hours it updated only 20,00,000(Twenty lakh) records only.Because primary key constraints guarantee unique data, they are frequently defined on an identity column.When you specify a primary key constraint for a table, the Database Engine enforces data uniqueness by automatically creating a unique index for the primary key columns.I have a table with two columns, both of which make up the primary key.

If a primary key constraint is defined on more than one column, values may be duplicated within one column, but each combination of values from all the columns in the primary key constraint definition must be unique.The Sales Person ID column in the Sales Order Header table matches the primary key column of the Sales Person table.The Sales Person ID column in the Sales Order Header table is the foreign key to the Sales Person table.As shown in the following illustration, the Product ID and Vendor ID columns in the Purchasing.Product Vendor table form a composite primary key constraint for this table.

Leave a Reply