473,503 Members | 1,849 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to solve ORA-02291: integrity constraint error

5 New Member
CREATE TABLE ORDER_PHARMACY(
Ord_ID VARCHAR2(10)
CONSTRAINT ORDER_PHARMACY_Ord_ID_pk PRIMARY KEY
CONSTRAINT Ord_ID_nn NOT NULL,
Ord_Date DATE DEFAULT SYSDATE
CONSTRAINT ORDER_PHARMACY_Ord_Date_nn NOT NULL,
Ord_Price VARCHAR2(10),
Ord_Qty NUMBER(10),
Emp_ID VARCHAR2(10)
CONSTRAINT ORDER_PHARMACY__Emp_ID_fk
REFERENCES EMPLOYEE(Emp_ID));


INSERT INTO ORDER_PHARMACY(Ord_ID, Ord_Date, Ord_Price, Ord_Qty, Emp_ID)
VALUES ('O001', '1 JAN 2010', 'RM 9374.00', 6000, 'E001');
Sep 17 '10 #1
9 12697
OraMaster
135 New Member
Here you have to make sure whatever value for column ORDER_PHARMACY.Emp_ID you are inserting should exists in a table EMPLOYEE since you are referring to this tables Emp_ID. Hope this will help.
Sep 17 '10 #2
amitpatel66
2,367 Recognized Expert Top Contributor
Does the employee id E001 exist in the employee table? If not then you will get integrity constraint error
Sep 20 '10 #3
dila puteh
5 New Member
it means that i have to insert the value of employee's table first before insert the value of order right?ok.i can understand now.thank you so much to help to solve this problem.
Sep 21 '10 #4
amitpatel66
2,367 Recognized Expert Top Contributor
Yes thats right. Thats what Integrity Constraints make sure that for every child record, there is parent recrod available.

So in your case, EMPLOYEE Table is Parent Table with primary Key and ORDER_PHARMACY is Child table with foreign key.
Sep 21 '10 #5
dila puteh
5 New Member
Can i ask you about how to integrate between 4 database(oracle,sql server,mysql and progres sql)?and what is coding to make all those data to be connect?
Sep 21 '10 #6
debasisdas
8,127 Recognized Expert Expert
How much you are ready to pay for all the coding ?
Sep 22 '10 #7
amitpatel66
2,367 Recognized Expert Top Contributor
You can try using SQLDEVELOPER -> Migration option and check how it helps migrating data between different databases.

And, what you mean by integrating different databases? You mean transferring all the objects from different databases in to oracle or vice versa?
Sep 23 '10 #8
dila puteh
5 New Member
What i mean is table in my database that is oracle can retrieve the data of other database like table in sql,my sql and prosgres
Sep 24 '10 #9
amitpatel66
2,367 Recognized Expert Top Contributor
Yes. You can export the data from other databases in to a flat file and load the data from flat file in to oracle or any other database as required.
Sep 27 '10 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

4
3921
by: Jochen Daum | last post by:
Hi, I have to emulate a "file upload" to a Java Servlet which is done with the class URLConnection. The java source basically does URLConnection conn =...
1
4792
by: Allen | last post by:
I am trying to add an additional photo/hyperlink to the company web site (I didn't create it) without any luck. The mouseover feature 'highlights' pics by swapping them with another pic using this...
16
1617
by: ommadawn | last post by:
I was wondering if someone here can help me with a problem I'm having. I'm working my way through the 'Beginning JavaScript' (2'nd Edition) book by Wrox Press. As I get further into the book, it...
5
7023
by: trint | last post by:
I need to read ascii coming from my printer. It needs to be something like this: System.IntPtr lhPrinter=new System.IntPtr(); DOCINFO di = new DOCINFO(); int pcWritten=0; int pcRead=0;...
5
1628
by: Greg Vereschagin | last post by:
I'm trying to figure out a regular expression that will match the innermost tag and the contents in between. Specifically, the string that I am attempting to match looks as follows: ...
6
3533
by: Bill foust | last post by:
I'm running into a situation there I think an operator overload would solve the issue, but I'm unable to make it work for some reason. If anyone can help here I would appreciate it. I have a...
4
1349
by: jim lees | last post by:
Hi all Im hoping to find someone that knows how to sort out graphics problems on rebuilt PCs My problem is the fact that I tried to help a freind with their PC by installing a copy of XP...
1
1484
by: jiggaman828 | last post by:
Am I doing something wrong with setting my width? I thought I had it correct. Can any inform me on how to write 4 different while or do-while loops counting down to 0, it has to be lined up column...
2
4550
by: ianwr | last post by:
Hi, I wonder if anyone can shed any light on the following as i just can't explain it. A user is running an update on a 500m+ row table setting a column value, computing its value from...
5
1289
by: torres1 | last post by:
Hi, I am creating a windows application showing name date of birth and number of heartbeats from date of birth to a particular targetdate. My program is showing name and date of birth but i cannot...
0
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7287
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7006
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5592
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5021
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3166
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1519
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
397
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.