Re:Primary Key in the UDO Table
Hi All,
In the UDO table by default code is set as the primary key. How to set primary key for another field also?.
Thanks in Advance.
Regards,
Madhavi
Hi Madhavi,
If you're getting the 'Other users are currently connected to the database' and the aren't any user connected to the company one of the following is happening:
1. There's a Add-on that uses the DI API connected to the company;
2. You have the SQL Management Studio opened and connected to the company DB;
3. You any other application, like Crystal Reports, connected to the company DB.
Close all other applications that may be the cause of the problem, and create the Key again.
Regards,
Vítor Vieira
Similar Messages
-
What is the best way to drop and recreate a Primary Key in the Replication Table?
I have a requirement to drop and recreate a primary key in a table which is part of Transaction replication. What is the best way to fo it other than remove it from replication and add again?
Thanks
SwapnaHi Swapna,
Unfortunately you cannot drop columns used in a primary key from articles in transactional replication. This is covered in
Make Schema Changes on Publication Databases:
You cannot drop columns used in a primary key from articles in transactional publications, because they are used by replication.
You will need to drop the article from the publication, drop and recreate the primary key, and add the article back into the publication.
To avoid having to send a snapshot down to the subscriber(s), you could specify the option 'replication support only' for the subscription. This would require the primary key be modified at the subscriber as well prior to adding the article back in
and should be done during a maintenance window when no activity is occurring on the published tables.
I suggest testing this out in your test environment first, prior to deploying to production.
Brandon Williams (blog |
linkedin) -
How to find out the primary key of oracle apps tables
Hii,,
My Question is How to find the primary key in the apps table...Is there any Query or other way to find out???
for eg.
I want to find out the primary key of the AP_INVOICES_ALL table...just tell me how can i get the primary key of this table.
I am currently using toad for the query..
Please guide me...you can define the primary key when you create table
or add the primary key after the table creation by 'ALTER TABLE ... ADD constraint pk_nme primary key (col1, col2)';
you could use below sql to check the detail of primary key:
1) check out the table definition directly:
select dbms_metadata.get_ddl('TABLE','EMP') FROM DUAL;
2) check out the columns of primary key:
select * from user_constraints where constraint_type='P' AND table_NAME='EMP';
select * from user_cons_columns where CONSTRAINT_NAME='PK_EMP';And BTW, it is madam, not sir. :)
Edited by: PhoenixBai on Dec 17, 2010 1:07 PM -
DBMS_CDC find only the columns that are changed along with the primary key in the table
Hello,
We are having a requirement to find the change data in the production environment.
We are planning to use the DBMS_CDC utility.
But for example in the create change table 1 picked emp_id,ename, address, salary,dob.
I have a sample data of
empid
ename
address
salary
DOB
1
test1
24 test street
2000
20-Jan-98
2
test2
25 test street
2500
15-Aug-97
if ename for empid 1 is changed to test1_test3 from test1.
My CDC is capturing the values in the old and new values in the 5 columns.
But i need to get only the empid (primary key of the source table) and the ename column as only that's been updated not the rest of the 3 columns.
Can i accomplish this.
Please advice.Hello,
Thanks for the information.
but if i change the change table then i will miss the other columns right?
I want to get the columns( empid and ename) only if ename is changed. i.e when ever any column in emp table changes i need to get all the columns where the data is changed along with the primary key columns empid.
Is there any way i can tweak the parameters so that i can achieve this or is there any other way using the cdc i can get this data.
Thanks -
How to get the new Primary Key after the Automatic Row Processing (DML)
Hi,
I have a nice master detail form.
I want, immediately after submitting the page when creating a new record in the master table, that the user may input the associated table (the detail table). For that I have created a branch that goes back to the very same page after creating the record (ie submitting the page with the button Create). In the Action of the branch, i have put P30_FICHE_ID (the item containing the primary key of the master table) with its value : &P30_FICHE_ID.
Unfortunately I see that the item is not populated with the very new primary key. it seems normal becaus after submitting the page the tiem is not populated. This is my question : how to retrieve the newly created primary into the item P30_FICHE_ID in order to begin immediately to add rows to the detail table ?
Hope I'm clear. My english not perfect.
Thank you for your kind help !
Christian
Edited by: Christian from France on Oct 16, 2009 6:36 AMChristian,
After creating Master-detail form, goto your Detail page. In this page you can see one conditonal brach which will point to 'Master' page.
Edit this branch and here you can see this branch fires when request is in 'SAVE,DELETE,CREATE' (in Expression1). Now change the value in Expression1 to 'SAVE,DELETE'. This will do the needful :-)
Cheers
Hari
Edited by: Hari_639 on Oct 16, 2009 8:02 PM -
How can I use the SQL to create a primary key for a existing table?
create table a(bm number,mc varchar2(20));
when the table was created,i want to make the column bm as
the primary key and my SQL is "alter table a enable primary key bm",the system show
me error,how can I write the right one?create table a(bm number,mc varchar2(20));
when the table was created,i want to make the column bm as
the primary key and my SQL is "alter table a enable primary key bm",the system show
me error,how can I write the right one? You do not have any primary key defined on your table yet, so, it does not make sense to enable it (if at all possible) !
You need to add PRIMARY KEY using something like this:
SQL> alter table a add constraint pk_a_bm primary key (bm) ; -
REFRENCEING PRIMARY KEY IN THE TABLE
Hi,
I want to refer the composite primary key column into one table that is i have one primary key with three columns and i want to refer only one column as a forigen key in the other table.
how do i do that ?
regards
gaurav
nullForeign keys have to map to primary keys. If your master table requires three columns to uniquely identify a record then its children must have those three columns as well. This can lead to the apparently absurd situation where you have tables whose keys consist of more columns than the actual table data.
The alternative is to use an artificial ID column as the PK and make the other columns an unique key. The problem with synthetic primary keys is that it makes it difficult to identify children or grandchildren: you always have to join with the parent table or denormalise your data.
Example: ORDERS identified by Ord_No
ORDER_ITEMS identified by ord_itm_no
Natural key: ORDERS PK = order_no
ORDER_ITEMS PK = order_no
, ord_itm_no
Here it is easy enough to find which items belong to Order 1234 just by querying ORDER_ITEMS table.
Synthetic key: ORDERS PK = id
UK = order_no
ORDER_ITEMS PK = ORDERS.id, id
UK = order_no, ord_itm_no
Here to find which items belong to Order 1234 you have to query ORDERS to find the ID before querying ORDER_ITEMS table. You have to have triggers on the ORDER_ITEMS table to populate the denormalised columns order_no and ord_item_no.
Which approach you take ought to depend upon your database and what you do with it but it take on the flavour of a religious war. The orthodox view (the word of Codd) firmly supports using natural keys.
ciao, APC -
Problems deleting a primary key field in a table.
Hello Guys,
I deleted a primary key field in a custom table by clicking 'delete row' icon and then tried activating it through se14 - database utility. It is throwing an error saying 'Primary key change not permited for the value table zxxxx'. What is the problem???
How can I delete a primary key in a table??
Please help.
Thanks,
NarenI am pasting the detail explaination over that error.
Primary key change not permitted for value table ZTV_RANGE_NUMBER
Message no. AD 300
Diagnosis
This table is defined as a check table. For reasons of consistency, changes to the primary key of the table are not allowed.
Procedure
If it is essential that you change the primary key, you must delete the relevant foreign keys. Refer to the where-used list to find all tables containing a field that is checked against this table. Delete the foreign keys for these fields.
If necessary, maintain the deleted foreign keys again. -
Creating a primary key with the parallel option and the tablespace option
I know I can create a unique index with these options and then make the primary key with the "using index" clause. anyway to do this and skip the create unique index and just create the primary key ?
SQL> ALTER TABLE t
2 ADD CONSTRAINT pk_t
3 PRIMARY KEY (testcol)
4 USING INDEX
5 TABLESPACE example
6 PARALLEL (DEGREE 2);
PARALLEL (DEGREE 2)
ERROR at line 6:
ORA-03001: unimplemented featureYou can name the tablespace but you must do an alter index thereafter. -
I am trying to create a sequence to be use as primary key in a Oracle table
Hi guys
I have the ODI version 10.3.5 and I am trying to create a sequence that populates de row_id for a table. The schema is a database.
And I want that this item will be the primary key of the table that is loaded at execute the interface however I'm getting issues.
So please advise me.Hi ,
Can you please provide the following details :
1. What is the execution area of your sequence ? Is it source or staging or Target.
2. What IKM you are using ( I hope you are executing sequence in Staging or Target ) ?
My understanding is when you check Not Null , all your rows are going to Error table. So it is not giving any error.
When you uncheck the Not Null , it is giving error because Database is not allowing Null values in the Primary Key Column.
You can do the following to check if your sequence is working properly.
Try to write a Insert Select query in DB and execute it and see if it is working properly.
i.e.
insert into EMPL (
EMPNO,
ENAME,
JOB,
MGR,
HIREDATE,
SAL,
COMM,
DEPTNO
select S_EMPNO.NEXTVAL,
ENAME,
JOB,
MGR,
HIREDATE,
SAL,
COMM,
DEPTNO
from EMP
or if you can provide your query in this format , it will help in finding the issue quickly.Also provide the KM details. -
Updation of Primary Key field in HR Tables (PA2001 and PA2002) - Urgent
Can anyone please tell me how to update a primary key field in HR Tables (PA2001 and PA2002).
I need to update sprps field in both the tables. I used HR_Infotype_Operation function module, but still it is not updating the field.
Pls find the following code snippet for the table PA2001 and let me know if any discrepancies :
TABLES: pa2001.
DATA: it_pa2001 TYPE TABLE OF pa2001,
wa_pa2001 LIKE LINE OF it_pa2001,
DATA: date TYPE d.
date = sy-datum - 100.
SELECT pernr sprps begda endda FROM PA2001 INTO CORRESPONDING FIELDS OF TABLE it_pa2001
WHERE begda BETWEEN date and sy-datum.
WRITE:/.
WRITE:/ 'PA 2001 Records'.
if sy-subrc <> 0.
WRITE:/ 'No Data Exists'.
else.
LOOP AT it_pa2001 INTO wa_pa2001.
WRITE:/ wa_pa2001-pernr, wa_pa2001-sprps, wa_pa2001-begda, wa_pa2001-endda.
ENDLOOP.
endif.
LOOP AT it_pa2001 INTO wa_pa2001.
wa_pa2001-sprps = 'X'.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '2001'
number = wa_pa2001-pernr
SUBTYPE =
OBJECTID =
LOCKINDICATOR =
VALIDITYEND =
VALIDITYBEGIN =
RECORDNUMBER =
record = wa_pa2001
operation = 'MOD'
TCLAS = 'A'
DIALOG_MODE = '0'
NOCOMMIT =
VIEW_IDENTIFIER =
SECONDARY_RECORD =
IMPORTING
RETURN =
KEY =
ENDLOOP.
if sy-subrc = 0.
write:/ 'SY-subrc is zero'.
write:/ ' Rows modified = ', sy-dbcnt.
else.
write:/ 'No Record(s) updated'.
endif.
commit work.
WRITE: / 'Updated Records in the Internal Table IT_PA2001'.
SELECT pernr sprps begda endda FROM PA2001 INTO CORRESPONDING FIELDS OF TABLE it_pa2001
WHERE begda BETWEEN date AND sy-datum..
LOOP AT it_pa2001 INTO wa_pa2001.
WRITE:/ wa_pa2001-pernr, wa_pa2001-sprps, wa_pa2001-begda, wa_pa2001-endda.
ENDLOOP.Thanks Kiran.
But I need to change this field as we need to lock the records, as soon as the employee fills his/her time sheets which will be sent for HR Payroll, later on.
When I am updating directly the field the database table PA2001, its not updating but for table PA2002, only few records are being updated.
Is there any other alternative for this problem?
Pls reply.
Thanks,
Harish -
How do you change the value of the primary key in the CMP?
Hi,
The cmp that I built has the phone as the Prikey field.
The bean has the get/set methods. The servlet invokes the cmp
to change the phone number. How could I do that?
The setXXX for the priKey can not be called outside of the ejbCreate() so
how would I change the prikey value of a particular row of the table. Do I have
to remove the bean then create the new bean with the new priKey value?
Please help,
ThanksThanks Mona
Tom.
Mona Ramlawi <[email protected]> wrote:
Hi TOM,
The primary key is the unique identifier of an Entity Bean.
To change it, you have to remove the bean instance = database delete
then you have to create a new one with the new primary-key value =
database insert.
Hard luck tom, maybe you should consider changing your primary key. You
can easily change it to an AutoNum
Tom wrote:
Hi,
The cmp that I built has the phone as the Prikey field.
The bean has the get/set methods. The servlet invokes the cmp
to change the phone number. How could I do that?
The setXXX for the priKey can not be called outside of the ejbCreate()so
how would I change the prikey value of a particular row of the table.Do I have
to remove the bean then create the new bean with the new priKey value?
Please help,
Thanks -
Composite primary key on very large tables...
Hello
So I'm building a database where one of the tables will eventually have > 1 billion rows and was wondering about the primary key. The table will have 3 columns (sample_id, object_id, value) and so I was thinking instead of creating a surrogate key I would create a composite primary key on those 3 columns.... People will query either for sample_id = X or object_id = Y. I've created a composite index on object_id, sample_id and value and the query times have been fast < 2-3s per object_id. Although building that index takes some time (7-8 hrs) what would be the pros/cons to composite PK vs a unique index? I plan to do massive bulk uploads (50M records at a time) so I'll disable the constraints before loading.... These records will also be loaded in order so would a clustered table be appropriate?
thanks
steveHi,
As correctly said by steve,partition the table.
Create a unique index on single column and then even if ur query is not using that column which has index,use a HINT and make it to use the index.
If ur using joins on this table with other tables u can use use_hash hint which will improve performance.
Hope it helps.
Thanks -
Altering Primary Key constraint on a table i Oracle 10G
Hi All,
Can anyone tell me how to alter a primary key constraint on any table. My concern is that, suppose i have a table called 'Employee' where only 'EmployeeName' is added as a primary ket constaint. Now i want to alter this P.K. constarint to add 'EmployeeName' and 'DateOfBirth' as a primary key. Can anyone suggest me how can i achieve that? Any help will be highly appreciated.hi,
you need to drop the constraint and recreate it.
SQL> conn scott/tiger@alpspso
Connected.
SQL> create table test (id number constraint id_pk primary key,name varchar(30));
create table test (id number constraint id_pk primary key,name varchar(30))
ERROR at line 1:
ORA-00955: name is already used by an existing object
SQL> create table test_table (id number constraint id_pk primary key,name varchar(30))
Table created.
SQL> alter table test_table modify constraint id_pk primary key(id,name);
alter table test_table modify constraint id_pk primary key(id,name)
ERROR at line 1:
ORA-00933: SQL command not properly ended
SQL> alter table test_table modify constraint id_pk(id,name);
alter table test_table modify constraint id_pk(id,name)
ERROR at line 1:
ORA-00933: SQL command not properly ended
SQL> alter table test_table modify primary key(id,name);
alter table test_table modify primary key(id,name)
ERROR at line 1:
ORA-00933: SQL command not properly ended
SQL> alter table drop constraint id_pk;
alter table drop constraint id_pk
ERROR at line 1:
ORA-00903: invalid table name
SQL> alter table test_table drop constraint id_pk;
Table altered.
SQL> alter table test_table add constraint id_pk primary_key(id,name);
alter table test_table add constraint id_pk primary_key(id,name)
ERROR at line 1:
ORA-00902: invalid datatype
SQL> alter table test_table add constraint id_pk primary key(id,name);
Table altered.
Regards.
Navneet -
How can i set primary key after creating a table ?
hi friends
thank you for all the support you have given me . i have doubt ,can we set primary key for a column after creating the table
I have added a column named idno after creating the table . i want to set that column as primary key . i tried this
table name = address
column name = idno
ALTER TABLE ADDRESS MODIFY (idno PRIMARY KEY(idno))
,but not working
if anbody knows the solution pls reply
thanks and regards
nevhow does the other users know which is the primary key for this table?....the other user needs to execute this query...and modify the query accordingly
select aa.table_name,aa.column_name,aa.constraint_name,bb.constraint_type
from user_cons_columns aa,user_constraints bb
where aa.constraint_name = bb.constraint_name
and aa.table_name = 'TEST_EMP' and bb.constraint_type = 'P';
Maybe you are looking for
-
Error in Creating Sales Order Using BAPI_SALESORDER_CREATEFROMDAT2
Hi Everyone, We have a requirement to create sales order from flat file using BAPI. Everything was working well until we encounter a customer with credit control limit setup. Using the partners table for BAPi, the sold to customer is enter at header
-
Machines avail on Bonjour but not Local Network - when on same subnet?
I have a simple system running ARD 3.2 on a machine running OS X 10.5.2, controlling a small number of machines running 10.5.2 or 10.4.11, all on the same sub-net. Two of the computers - both 20" Intel iMacs (2.0GHz CoreDuo) with 10.5.2 installed hav
-
ADF components do not display Chinese simplified (showing English instead)
Dear All I am having a problem getting ADF components to display in Chinese simplified language. Buttons display in Chinese correctly however components such as: < af:table > (the previous and next values do not display in Chinese, again in English o
-
External Requirements from One R/3 client to Multiple EBP clients
Hi We have a scenario where in , the Purchase requisitions generated from R/3 has to be sent to two different EBP clients on the same server. But, we are able to send the PR to one EBP client only, but not the other. Is there any settings where we ne
-
Help with NWDI Software Component Installation on CRM 5.0?
Hello, We are currently running CRM 5.0 on Windows Server 2003 with MS-SQL Server. While installing CRM 5.0 we didn't select the DI (NetWeaver Development Infrastructure) software component as we didn't expect earlier to do any Java development. Now,