|
-
Primary Keys Issue on Remote Tables
have this query where i can check what are the primary keys on remote table.
select column_name from all_cons_columns where table_name='EMPLOYEES' and owner='BRENDAN';
COLUMNS_NAME
*************************
EMPLOYEE_ID
Now Question is
1. When we do copy tables does that also copy Primary keys because when i run the same query after copying tables it does not show any rows e,g,
select column_name from all_cons_columns where table_name='EMPLOYEES_COPY' and owner='TEST'
2. When we do copy does that also copy constraints?
Any help will be really appreciated.
-
It woulddepend how you "copy". Export/Import will be default, though it has options not to. So how did you do the copy?
-
By doing
Create Table as select * from
[where 1 = 2 -- optional]
Now need to copy constraints but i cannot edit remote tables or i cannot apply Triggers or views on those tables. So any other way around
-
You can create a table, but you can't create triggers or constraints on it, or create views?
-
Sorry look like u took me wrong...
I can only view the contents of that schema and can make copies of his schema structure thats all.
-
 Originally Posted by shsh_shah
Now Question is
1. When we do copy tables does that also copy Primary keys
2. When we do copy does that also copy constraints?
No, and no.
-
hmmm....William you just said no and no...But can you give me idea how to do it..Help from any bosy will be really appreciated
-
Try
DBMS_METADATA.GET_DDL@remotedb(objecttype, name);
e.g.
DBMS_METADATA.GET_DDL@remotedb('TABLE','EMPLOYEES');
This is a function that you can use in either a plain SQL query or in PL/SQL. It will return the SQL to create the table, including constraints.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|