SQL SCRIPT ERROR PLEASE HELP!!!

DROP TABLE CUSTOMERUSER CASCADE CONSTRAINTS;
CREATE TABLE CUSTOMERUSER
( Username VARCHAR(10) NOT NULL,
UserID VARCHAR(15) NOT NULL,
Pword VARCHAR(30),
Street VARCHAR(15),
City VARCHAR(15),
Postalcode VARCHAR(15),
Phone VARCHAR(10),
Email VARCHAR(16),
PRIMARY KEY (Username,UserID));
DROP TABLE ADMINISTRATOR CASCADE CONSTRAINTS;
CREATE TABLE ADMINISTRATOR
( Username VARCHAR(10) NOT NULL,
EmployeeID VARCHAR(15) NOT NULL,
Pword VARCHAR(30),
AdminType VARCHAR(15),
PRIMARY KEY (Username,EmployeeID));
DROP TABLE FLIGHT CASCADE CONSTRAINTS;
CREATE TABLE FLIGHT
( FlightID VARCHAR(10) NOT NULL,
FlightNumber VARCHAR(15) NOT NULL,
Airline VARCHAR(30),
AvailableSeats INT,
PRIMARY KEY (FlightID));
DROP TABLE RESERVATION CASCADE CONSTRAINTS;
CREATE TABLE RESERVATION
( ReservationNumber VARCHAR(10) NOT NULL,
IsPaid VARCHAR(4) NOT NULL,
dayof VARCHAR(10),
FlightID VARCHAR(10) NOT NULL,
UserID VARCHAR(15) NOT NULL,
PRIMARY KEY (ReservationNumber,UserID),FOREIGN KEY (FlightID) REFERENCES FLIGHT(FlightID),FOREIGN KEY (UserID) REFERENCES customeruser(UserID));
DROP TABLE PAYMENT CASCADE CONSTRAINTS;
CREATE TABLE PAYMENT
( PaymentID VARCHAR(10) NOT NULL,
PaymentAmount VARCHAR(15) ,
PaymentDate VARCHAR(30),
ReservationNumber INT NOT NULL,
PRIMARY KEY (PaymentID),FOREIGN KEY (ReservationNumber) REFERENCES RESERVATION(ReservationNumber));
DROP TABLE FLIGHTSCHEDULE CASCADE CONSTRAINTS;
CREATE TABLE FLIGHTSCHEDULE
( FlightNumber VARCHAR (15) NOT NULL,
Fromw VARCHAR(25) ,
Wto VARCHAR(25),
DepatureDate VARCHAR(10) ,
ArrivalDate VARCHAR(10),
Class VARCHAR(10) ,
DepatureTime VARCHAR(8),
ArrivalTime VARCHAR (8) NOT NULL,
PRIMARY KEY (FlightNumber),FOREIGN KEY (FlightNumber) REFERENCES FLIGHT(FlightNumber));
When i execute the RESERVATION section. it gaving me a error called " *
ERROR at line 7:
ORA-02270: no matching unique or primary key for this column-list
How to fix that?

in TABLE RESERVATION the FOREIGN KEY (UserID) REFERENCES customeruser(UserID) expects the primary key of TABLE CUSTOMERUSER to be UserID (not PRIMARY KEY (Username,UserID) as in your case) or the TABLE CUSTOMERUSER having an unique index on UserID.
Regards
Etbin
Edited by: Etbin on 3.12.2011 22:22
You might be sorry defining DepartureDate as VARCHAR2(10) and DepartureTime as VARCHAR2(8) instead of Departure DATE (time component included)
the same for ArrivalDate in TABLE FLIGHTSCHEDULE
in TABLE RESERVATION there is dayof VARCHAR(10) too

Similar Messages

  • " loading failed please check your page for  java script errors" please Help

    recently my project starts crashing.... when it loads it gives a java scrip error .. saying " loading failed please check your page for  java script errors"

    Hey, If you have an error, you should see the error in Edge and you can correct it. In the window/code there will be a red dot too.

  • My fastdial is no longer appearing on a blank tab and every time I click on addons it freezes and has a script error - please help!

    When I click the fastdial button which has appeared on my navigation toolbar - it takes me to chrome://fastdial/content/fastdial.html so I figured that it is chrome that caused the problem.
    When I click on tools/addons I get a script error and a frozen firefox.
    Also can not use any toolbar links and have to type in the address into navigation to get anywhere.
    I don't know what else to try!

    Other users have reported that this is caused by one of their add-ons. I suggest going to the Add-ons page and disabling everything that is not essential, and then restarting Firefox. Hopefully it's not caused by something you really rely on.
    orange Firefox button ''or'' Tools menu > Add-ons
    On the left side, click Extensions
    Then disable as many as possible and restart Firefox.
    Any luck?

  • SQL Insert Error - Please help. RESOLVED

    I have a page with several VOs and search options. One of the search options is a list of Emp IDs which (when one is selected and user clicks 'search') results in an editable table of profiles for that Emp Id.
    I have in the Footer of the results table an input field and a button 'add' bound to a method that takes two params and inserts a 'new' profile for the searched Emp Id and the value entered in the input field.
    When I enter a value and click 'add' I get the following:
    JBO-29000: Unexpected exception caught: oracle.jbo.DMLConstraintException, msg=JBO-26048: Constraint "BADGE_ACCESS_EMP_FK" violated during post operation:"Insert" using SQL Statement "BEGIN INSERT INTO BADGE_ACCESS(EMPLOYEE_ID,BADGE,ROW_ID) VALUES (?,?,?) RETURNING ROW_ID INTO ?; END;".
    JBO-26048: Constraint "BADGE_ACCESS_EMP_FK" violated during post operation:"Insert" using SQL Statement "BEGIN INSERT INTO BADGE_ACCESS(EMPLOYEE_ID,BADGE,ROW_ID) VALUES (?,?,?) RETURNING ROW_ID INTO ?; END;".
    ORA-02291: integrity constraint (HR.BADGE_ACCESS_EMP_FK) violated - parent key not found ORA-06512: at line 1
    My Emp table is simple - just an ID, First and Last names with ID as PK. My profile table (called Badge_Access) has the EmpId as FK and it's own PK set by a DBSequence. The other column in Badge_Access is for the input value (number).
    I do not know how to debug in JDeveloper such that I can see the values that are being passed to the method. My 'add' button method is:
    public void createBadgeAccess(Number empId, Number badge) {
    BadgeAccessImpl ba = (BadgeAccessImpl)getDBTransaction().createEntityInstance(BadgeAccessImpl.getDefinitionObject(), null);
    ba.setEmployeeId(empId);
    ba.setBadge(badge);
    getDBTransaction().commit();
    I have the 'value' of the empId param = ${bindings.AccessByEmployeeEmployeeId.inputValue}
    This is the selectOneChoice field the user uses to search...
    and the 'value' of the badge param = ${bindings.Badge.inputValue}
    This is the input field the user fills in before clicking 'add'...
    The values I think I am passing are empId=106 and badge=102 - both are valid & the 'parent key' 106 is valid...
    any help will be greatly appreciated!!! Thanks
    Ginni
    Message was edited by:
    ginnim
    I found a Tip that described what was happening.

    Wrap some try/catch around the statements instead of trying to decipher the Java junk. Could be a problem in the PS, could be a number of things. At least figure where in the application the error takes place.

  • Dynamic sql giving error --please help

    Hi ,
    I have written the following code --
    CREATE OR REPLACE FUNCTION tabcount (
    tab IN VARCHAR2, field IN VARCHAR2 ,whr IN VARCHAR2)
    RETURN INTEGER
    IS
    retval INTEGER;
    BEGIN
    DBMS_OUTPUT.PUT_LINE ('whr' ||whr);
    DBMS_OUTPUT.PUT_LINE ('field1' ||field);
    EXECUTE IMMEDIATE
    ' SELECT COUNT(*) FROM ' || tab ||
    ' WHERE ' || field || 'like '/'%'||whr ||'%'/''
    INTO retval;
    DBMS_OUTPUT.PUT_LINE ('countis!' ||retVal);
    RETURN retval;
    END tabcount;
    It is giving the following error--
    ORA-00920: invalid relational operator
    ORA-06512: at "TABCOUNT", line 10
    ORA-06512: at line 2
    I am not sure how to enclose the like operator within the single quotes.Double quotes is not working for me.
    Thanx in advance,
    Ira

    Offhand, it looks like you may still have some syntax problems -- probably need a blank space before the WHERE --maybe some other stuff too.
    What you need to do to debug it is this (and this works just about anytime you are having trouble with dynamic SQL):
    1. store the sql statement in a variable.
    2. Use DBMS_OUTPUT to display your select statement BEFORE calling execute immediate.
    3. copy/paste that select into a separate window and run/debug it.
    4. Once you know what is wrong with that statement, go back and fix the code accordingly.
    Have fun,
    --scott                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Script Error Please help.

    I have made a small animation and wanted to test the use of
    buttons. On my button I have entered the following code using
    actionscript 3.0
    on (release) {
    gotoAndPlay ("moviestart");
    and it says 1087: Syntax error: extra characters found after
    end of program. the source is on (release) {. What is wrong?
    Also how can I make my program pause until the button is
    clicked? I have tried creating another layer and using the action
    pause on it then putting a rectangle at "moviestart" and when I
    test the movie it just shows the button then the rectangle and
    loops.
    By the way I am using CS3 Professional

    how do I get to "Programming ActionScript 3"?
    Also I have made a small movie in flash and was wondering how
    I get get an [IMG] code of the movie so I can put it on a from like
    www.nexopia.com. One more thing is how can I set the movie not to
    start until I click on the button. I have a play button at the
    start and would like to make the program freeze until the button is
    clicked or even just until someone clicks on the video.

  • Windows - No Disk Error - Please help!

    Windows - No Disk Error - Please help!
    Hi,
    I have the following set up:
    * Lenovo T-61p
    * Windows XP Pro, SP 3
    * HP Photosmart 8250 printer (with nothing plugged into the various card readers, and USB slot in the printer)
    I am getting the following error:
    Windows - No Disk
    Exception Processing Message 0xc0000013 Parameters 0x75CE023C
    0x84C40C84 0x75CE023C
    I have done a lof experimenting and thru process of  elimination, and believe I have determined that this only happens when the HP Photosmart 8250 printer is plugged in to the USB slot of the computer.
    I can stop it from happening by safely removing hardware, and removing the drive that the 8250 creates on your computer when you plug it in.  In my case, this is drive E.  I'm guessing if there was something in the the various card readers, and USB slot in the printer, that's what those would be, but I don't those use those functions of the printer.
    I understand there is more at work than simply the printer, because I did not used to get this error, so some software changed as well, that is scanning all ports, and finding a drive that has no disk, and producing the error.
    A simple google search finds a lot people all over the world having this problem, and are solving it in different ways, because the suspected source is different: Norton, HP, etc.
    I have tried everything I have read, and the only thing that works was my own idea, of manually safely removing the drive the printer creates each time I plug in the printer.
    Anyone every any better, more permanent solutions?  Or know what the real root of the problem is?  What is scanning all the drives and being showing an error message because it found an empty drive?
    Thanks and Happy Holidays/New Year!

    I've been getting the same error on my 4G nano for the past week. I've had my nano for about a month and the first few weeks were fine. Tried it on 2 different computers (Vista and XP) and same problem. Tried it on a 3rd (XP) and it started ok. Problem started coming back after a day.
    I was able to find a quick fix though. I noticed that sometimes the message says something like "iexplore.exe... no disk..." even if I don't even use IE. What I do is end iexplore.exe on task manager before running iTunes and syncing my nano. I don't get the error whenever I do this, but one drawback is that the contents of my nano suddenly pops up in a window - even when disk use is not enabled.
    I've reset/restored my nano dozens and dozens of times to make sure it's clean. Leads me to believe it's a driver issue. Either that or I have a friggin malware problem I can't seem to find.
    I'll be posting updates every now and then. I'm no expert so I'm hoping an Apple expert also steps in to give some input.

  • My ipod generation 5 will not come out of recovery mode. i was simply updating my software and this happened. it will not let me restore it comes up with and error. please help, thanks.

    my ipod generation 5 will not come out of recovery mode. i was simply updating my software and this happened. it will not let me restore it comes up with and error. please help, thanks.

    Hey erinoneill24,
    Thanks for using Apple Support Communities.
    Sounds like you can't update your device. You don't mention an error that it gives you. Take a look at both of these articles to troubleshoot.
    iPod displays "Use iTunes to restore" message
    http://support.apple.com/kb/ts1441?viewlocale=it_it
    If you can't update or restore your iOS device
    http://support.apple.com/kb/HT1808?viewlocale=de_DE_1
    If you started your device in recovery mode by mistake, restart it to exit recovery mode. Or you can just wait—after 15 minutes the device will exit recovery mode by itself.
    Have a nice day,
    Mario

  • I cannot use iCloud on Windows 7, as it won't recognize my apple ID when i try to sign in to icloud it i get error saying "you can't sign in because of a server error (please help some one)

    I cannot use iCloud on Windows 7, as it won't recognize my apple ID when i try to sign in to icloud it i get error saying "you can't sign in because of a server error (please help some one)

    Although your message isn't mentioned in the symptoms, let's try the following document with that one:
    Apple software on Windows: May see performance issues and blank iTunes Store

  • HT201442 I did this but still i am getting the same error , please help me .

    I did this but still i am getting the same error , please help me .
    <Email Edited by Host>

    Look at http://support.apple.com/kb/ts4451
     Cheers, Tom

  • I am not able to update my iphone 4 ,when ever i tried to update it its show 1309 error...and at times 9006 error ,please help me ..

    i am not able to update my iphone 4 ,when ever i tried to update it its show 1309 error...and at times 9006 error ,please help me ..

    Hey alkarim2008,
    If you are having an issue with being unable to update or restore your iPhone, I would suggest that you troubleshoot using the steps in this article - 
    Resolve iOS update and restore errors in iTunes - Apple Support
    Thanks for using Apple Support Communities.
    Happy computing,
    Brett L 

  • My iphone won't pass the connect to itunes. when i try to restore is says that there is an error. please help!

    hi my iphone is broken. it won't pass the connect to itunes. when i try to restore is says that there is an error. please help!
    thanks,
    jg2013
    <Subject Edited by Host>

    Hello, 02633. 
    Thank you for visiting Apple Support Communities. 
    If your iPhone is disabled, you will need to process the steps in the article below.
    iOS: Forgotten passcode or device disabled after entering wrong passcode
    http://support.apple.com/kb/ht1212
    Cheers,
    Jason H.

  • HT4623 I have updated my iphone with the current software but it is showing you need to connect to  of itunes to activate your phone, when i did that it is continuously showing an error.please help me to get through.

    I have updated my iphone with the current software but it is showing you need to connect to  of itunes to activate your phone, when i did that it is continuously showing an error.please help me to get through.
    Kindly Activate my phone.

    Rajan Gupta wrote:
    ...it is continuously showing an error.
    See here  >  http://support.apple.com/kb/TS3424
    Also see this discussion.
    https://discussions.apple.com/message/21189708

  • I need the drivers for earl 2011 macbook pro 13 inch i7 4 gigs for windows 7 64 bits i tried downloading with bootcamp butt it never completes allways ends up with an error please help

    i need the drivers for earl 2011 macbook pro 13 inch i7 4 gigs for windows 7 64 bits i tried downloading with bootcamp butt it never completes allways ends up with an error please help if any one has the drivers or knows were i can download them

    Doug...
    If you don't have it for reference, the manual might come in handy > US/Boot_Camp_Install-Setup.pdf
    After it loads, Command + F to find information regarding the drivers.

  • HT201210 hi i just bought my new iPhone 4s yesterday and when u opened it was not updated so when i tried SO MANY TIMES to update it on the devise and on my new mac it said that there was a unknown error please help me :)

    hi i just bought my new iPhone 4s yesterday and when u opened it was not updated so when i tried SO MANY TIMES to update it on the devise and on my new mac it said that there was a unknown error please help me

    Please tell us what kind of computer you have, what operating system and what version of iTunes. Not just "the latest version of iTunes", the exact version number.

Maybe you are looking for