I do not understand the error in my script?

I am completely new to SQL as I am a student. I have to write a script so that when it is run it creates a set of tables. I tried to run the script and it came with errors. Unlike java and vba, errors are not actually selected, it tells you what they are. This gives me to identify errors, so I can fix it. Can someone please look at my code and explain what the errors? Thanks in advance!


--------------------------------------------------------------------------------

CREATE TABLE HolidayDetails
(
HolCode char (2),
CountryVis varchar2 (20).
HolDuration number (2.0).
DiffRating char (1),
HolDescrip varchar2 (20).
HolCost number (4.2).
CONSTRAINT Hol_pk
PRIMARY KEY (HolCode),
CONSTRAINT Hol_fk
FOREIGN KEY (HolCode)
REFERENCES SiteHoliday (HolCode),
CONSTRAINT Hol_fk1
FOREIGN KEY (HolCode)
REFERENCES DateHoliday (HolCode),
CONSTRAINT Diff_fk
FOREIGN KEY (DiffRating)
REFERENCES DiffDetails (DiffCode),
)

ORA-00904: invalid identifier
--------------------------------------------------------------------------------

CREATE TABLE DiffDetails
(
DiffCode char (1),
DiffDescrip varchar2 (30),
CONSTRAINT Diff_pk
PRIMARY KEY (DiffCode, DiffDescrip).
)

ORA-00904: invalid identifier
--------------------------------------------------------------------------------

CREATE TABLE SiteHoliday
(
HolCode char (2),
SiteCode number (3.0)
CONSTRAINT SiteHol_pk
PRIMARY KEY (HolCode, SiteCode).
CONSTRAINT SiteHol_fk
FOREIGN KEY (SiteCode)
REFERENCES SiteDetails (SiteCode),
)

ORA-00907: lack of right parenthesis
--------------------------------------------------------------------------------

CREATE TABLE SiteDetails
(
SiteCode number (3.0).
SiteName varchar2 (30),
CONSTRAINT SiteDetails_pk
PRIMARY KEY (DiffCode, DiffDescrip).
)

ORA-00904: invalid identifier
--------------------------------------------------------------------------------

CREATE TABLE DateHoliday
(
HolCode char (2),
DeparDate DATE, 'TO_DATE(DeparDate,DD-MMM-YYYY)'
CONSTRAINT DateHoliday_pk
PRIMARY KEY (HolCode, DeparDate).
)

ORA-00904: invalid identifier
--------------------------------------------------------------------------------

Hi and welcome to the forum.

Thanks for saying that you are a student.

The problem is your comma after the last column, for example

REFERENCES DiffDetails (DiffCode),<--- remove="">
)

Don't know which tool you use, but I thing SQL * more you would have given a better idea of the problem.

Edit:
And by the way. Do not use the data type char, VARCHAR2, use instead

BTW: what are you trying to do here: "TO_DATE(DeparDate,DD-MMM-YYYY)".

Concerning
Peter

Published by: Peter on November 1st, 2010 05:47

Tags: Database

Similar Questions

  • Do not understand the error message.

    Update: I'm looking for ideas on this. I know it's hard without the complete script. I'm more than happy to send it to you, but it's more than 450 lines. All database functions work well, such as an earlier version of this script where there is only minimal changes to this version. I looked through the changes for several days.

    I get the following error message on a script that I briefly changed to one that has worked well. All manipulations of database work very well. There is only on my computer right now. The messages are:

    Warning: session_start() [Function.session - start]: Cannot send session cookie - headers already sent by (output started at C:\xampp\htdocs\lorianorg01\ssregister\ss07-finalregis.php:4) in C:\xampp\htdocs\lorianorg01\ssregister\ss07-finalregis.php on line 76

    Warning: session_start() [Function.session - start]: Cannot send session cache limiter - already sent headers (output started at C:\xampp\htdocs\lorianorg01\ssregister\ss07-finalregis.php:4) in C:\xampp\htdocs\lorianorg01\ssregister\ss07-finalregis.php on line 76

    Here's the code, starting at line 75:

    Create session variables

    session_start();

    $_SESSION ["ss_id"] = $regis_ss_id;

    $_SESSION ["ss_name"] = $regis_ss_name;

    $_SESSION ["ss_nomonths"] = $regis_ss_nomonths;

    $_SESSION ["ss_cost"] = $regis_ss_cost;

    $_SESSION ["ss_homelink"] = $regis_ss_link;

    $_SESSION ['email_address'] = $regis_email_address;

    $_SESSION ["FirstName"] = $regis_first_name;

    $_SESSION ['name'] = $regis_last_name;

    MartyMatthews wrote:

    I get the following error message on a script that I briefly changed to one that has worked well. All manipulations of database work very well. There is only on my computer right now. The messages are:

    Warning: session_start() [Function.session - start]: Cannot send session cookie - headers already sent by (output started at C:\xampp\htdocs\lorianorg01\ssregister\ss07-finalregis.php:4) in C:\xampp\htdocs\lorianorg01\ssregister\ss07-finalregis.php on line 76

    Line 76 in the error message is a red herring. It tells you where the session cookie to be sent, not where the error is located. This information is in the first part of the error in parentheses.

    The release began on line 4 of ss07 - finalregis.php. This is where you need to look for the problem.

  • Could not understand the error in help kindly cursor me

    declare
    cursor c is select e.empno,e.ename,g.grade from emp e,salgrade g where e.sal between g.losal and g.hisal order by e.empno;
    v_empno emp.empno%type;
    v_ename emp.ename%type;
    v_grade salgrade.grade%type;
    begin
    open c;
    fetch c into v_empno,v_ename,v_grade;
    while c%rowcount<=5 
    loop
    dbms_output.put_line(c.empno||' '||c.ename||' '||c.grade);
    end loop;
    close c;
    end;
    Error on line 2
    ORA-06550: line 11, column 24:
    PLS-00225: subprogram or cursor reference 'C' is out of range
    ORA-06550: line 11, column 1:
    PL/SQL: Statement ignored

    Script done on line 2.

    the order of the statements in the loop had some prob, so you must use local variables.
    Try the following.

    declare
    cursor c is select e.empno,e.ename,g.grade from emp e,salgrade g where e.sal
    between g.losal and g.hisal order by e.empno;
    v_empno emp.empno%type;
    v_ename emp.ename%type;
    v_grade salgrade.grade%type;
    begin
    while c%rowcount <= 5
    loop
    open c;
    fetch c into v_empno,v_ename,v_grade;
    dbms_output.put_line (v_empno||' '||v_ename||' '||v_grade);
    end loop;
    close c;
    end;
    
  • Windows Vista Home Premium SP2 32-bit not updated, the error code 80070005.

    Windows Vista Home Premium SP2 32-bit not updated, the error code 80070005.  Have tried little about everything without success. AV is Microsoft Security Essentials, Norton has preloaded, ran Norton total clean. Don't know the last updated time to race day, I re-load of updates (right term?) who cleaned the logs.  Have the free version of Malwarebytes, run regularly, nothing comes.

    Fixed, had run as before, but didn't save Subinacl desktop instead of folder mentioned in fix

  • shutdown due to amd problems, can not reproduce the error I can find solution.

    My laptop closed suddengly and restarted. Everything that's happened in a Flash with no time to understand the error but I noticed that it was something to do with AMD... I also noticed that, since then, the processor seems to be slow when I go into Web sites

    Although difficult to guess without the error details. However, I suspect that the problem must be related to the graphics driver.

    If please download and install the latest version of the graphics driver from here and hope everything works out for you.

    http://ftp.HP.com/pub/SoftPaq/sp55001-55500/sp55160.exe

    Good luck!

  • Can not download the error code get adobe reader 150210

    Can not download the error code get adobe reader 150210

    Hi andrewb73777409,

    Restart your system and then try to download the player using this link Adobe - Adobe Acrobat Reader DC Distribution

    Kind regards

    Nicos

  • I printed just a pdf and he did not understand the polylines I had traced.  What has caused this?

    I printed just a pdf and he did not understand the polylines I had traced.  Why?

    Hi Gary,.

    Please try this: -.

    • Click the print or choose file > print to open the print dialog box.

    • In the print dialog box, select Document and annotations in the drop-down list of forms and comments.
      I would like to know if it works.
      Kind regards
      Nicos

  • OAException.ERROR is not throwing the error

    Hi friends,

    I am faced with a particular problem. I extended the oracle.apps.per.selfservice.specialinformation.webui.SitNavigationBarCO CO.

    When the user clicks the next button, I perform a function and the return value and based on the return value that I throw the error. I am unable to call the function, and then, the function also returns a correct value. However I do not see the error message be lifted. I assume using OAException.ERROR the error pops up in the upper part and the user will not be able to navigate to the next page. Also, I enabled the logging and the function returns the value 'B '.

    Here's the code. Any ideas what I am doing wrong help. Apps version is 12.1.3

    Thank you

    ' Public Sub processFormRequest (OAPageContext oapagecontext, OAWebBean oawebbean)

    {

    super.processRequest (oapagecontext, oawebbean);

    If (oapagecontext. GetParameter ("HrNext")! = null) {}

    OAApplicationModule oaapplicationmodule = (oawebbean) oapagecontext.getApplicationModule;

    OADBTransaction oadbTrans = oaapplicationmodule.getTransaction ((OADBTransaction));

    String retValues = null;

    try {}

    userId int = oapagecontext.getUserId ();

    String idFlexNum = "50425;

    StringBuffer str = new StringBuffer();

    Str.Append ("BEGIN");

    Str.Append (": 1: = XX_CUSTOM_SIT.") VALIDATE_LOAN_REQUEST (»);

    Str.Append ("p_user_id = >: 2," "");

    Str.Append ("p_id_flex_num = >: 3" "");

    Str.Append (»); «) ;

    Str.Append ("END");

    OracleCallableStatement oraclecallablestatement = (OracleCallableStatement) oadbTrans.createCallableStatement (str.toString (), 1);

    oraclecallablestatement.setInt (2, userId);

    oraclecallablestatement.setInt (3, Integer.parseInt (idFlexNum));

    oraclecallablestatement.registerOutParameter (1, Types.VARCHAR);

    oraclecallablestatement. Execute();

    retValues = oraclecallablestatement.getString (1);

    oapagecontext.writeDiagnostics (this, "retValues:" + retValues, 2);

    } catch (Exception e) {}

    throw OAException.wrapperException (e);

    }

    If (retValues.equals ("A")) {}

    throw new OAException ("You are not eligible for loan based on your service", OAException.ERROR);

    }

    If (retValues.equals ('B')) {}

    throw new OAException ("You can't apply for loan more than 2 times", OAException.ERROR);

    }

    If (retValues.equals ("C")) {}

    throw new OAException ("Loan is false", OAException.ERROR);

    }

    }

    Dear all,

    This problem is solved after I put the following instructions.

    oapagecontext.putDialogMessage (new OAException (message, OAException.ERROR));

    oapagecontext.forwardImmediatelyToCurrentPage (null, true, null);

    I thank Rakesh for the solution. Is the thread that helped me

    https://forums.Oracle.com/message/3929589#392958

    Thank you

  • I received a phone call from someone who said they were the Windows technical support. I did not understand the person that he was a stranger

    The person calling said he could give me a technical support for problems that they had detected with my computer, but he seemed surprised when I said that I had problems with my computer.  I did not understand a lot of what he was saying because of his foreign accent.  Can someone tell me what it is?  I don't think that I may have a virus, but Windows actually call for help?

    You were lucky that you could not understand him and so do not buy what he was selling.  It was a scam.  Microsoft does not make unsolicited phone calls.

    Insofar as thought, you could have a virus...

    • What version of Windows (XP Home, XP Pro, Vista, etc) and Service Pack (none, 1, 2, 3) is installed? If you are unsure, do a click right my computer and select properties for information.
    • What is the name and version of your anti-virus program?  Is his current subscription and has it always been updated?
    • What other security software is installed (names and versions)?
    • What are the symptoms?  That's what are you see you do not, you should see or what is you don't see don't you think you should?  Please report the full text of the error message without paraphrase.
    • What happened to your computer shortly before the symptoms started?  Power outage (including pulling them out the plug or by pressing the off button); use of a registry cleaner, optimizer, tuner, etc. ; installation of an update (only one?). Another thing that you can identify.
  • Can not explain the error: untrapped exception articinterface...

    untrapped exception articinterface docpos error 3 in text is equal to 46

    A user of my application is receving this error message when it tries to run on its new 8330 with 4.3.0.0. In the 8330 running 4.3.0.128 Simulator, there is not this problem nor any other Simulator. I don't use that classes more vanilla in my programs and this error is a surprise ot me.

    This sounds like a defective phone?

    Kind regards

    Scott

    I found the solution to the problem.

    According to a person on the EDGE, there is a problem with the 4.5 OS and LabelField class. By using the BasicEditField class to show the text rather than LabelField, stopped except that occur.

    I do not understand why this error occurred with my program in particular. I did a lot of programs which implement LabelField, and which cause no error on devices running 4.5.

    Scott

    PS the precise error message was "Eception exception: ArticInterface:ocPosToCaret: error 3; formatting of the text = 46 "length

  • delete cert8. DB file has not prevented the error

    Out of the blue, I find that I can not access all Web sites except my Homepage(BBC News) on Firefox.
    Message reads "this connection is not approved.
    I can use the browsers Safari and Chrome times without problem.
    I followed the advice of Mozilla to remove cert8. DB folder - have retried several times without success.
    I use Firefox update 40.0.3. and this is the first time I have encountered this problem.

     All advice and -hopefully -a solution will be much appreciated.
    

    Them

    I'm sure that you've read about the verification of the system clock: verification of validity of the certificates are no error in the date, time or time zone, and sometimes allowing to use an Internet time source, computers can introduce errors.

    Assuming that's not the problem... Untrusted connection error page displays a code in parentheses (separated_by_underscore_characters)? Sometimes, you need to expand a section of the technical Details of the page to see the code.

    To provide a specific set of next steps, please let us know the error code (or codes) you get.

    For example, among users of Mac recently, a common code is sec_error_bad_signature and the most common reason for that seems to be the shield of Web of Avast. Web Shield intercepts your navigation and filter, but to filter sites secure, it has "fake" certificates for Firefox. Avast have set Firefox to rely on its false certificates, but which seems to fail on a regular basis.

    To test this theory, try disabling scanning of encrypted sites. I saw these steps in another post (if all goes well, they apply to Mac):

    1. Open the Avast dashboard on an affected system.
    2. Select settings in the left side menu.
    3. Adopt a Protection Active.
    4. Click on customize next to the Web Shield.
    5. Uncheck the option "Enable HTTPS analysis", and then click ok

    If that solves the problem, but you want to filter encrypted communication, you need to import the Avast! signature in Firefox Certificate Manager of certificates, References tab.

  • I uninstalled flash on my mac now youtube videos will not play. the error says safari does not recognize the video formats available.

    I uninstalled flash on my mac now youtube videos will not play.

    the error says safari does not recognize the video formats available.

    Reinstall the Flash Player... Why did you remove it?

    Barry

  • I have reset firefox and now everything is sitting on my desk. I want to again on my firefox profile, but I do not understand the directions on how to do it.

    Reset did not say I would lose everything--it seemed that most would still be preserved. I do not understand about the creation of the new profile, and copy everything on it. Is there an easier way to do this? I tried to restore my computer hoping that would bring back how it was, but that didn't work. I'm not an expert in computer so need baby steps on it. I have windows 7. Thank you.

    You are welcome

  • Do not understand the point of layout mode...

    I'm afraid it will make me look like an idiot, but... I just don't, so well, I'm missing something.

    Here's my situation: I have two USB MIDI devices connected to my computer, an edrum with 8 pads and a keyboard 25 keys, touch 16 and a bunch of buttons. Both devices allow me to completely configure the MIDI channel, note, the key pads, etc. and so on.

    So, ok, in my APPLICATION I plug just those, create a track for each instrument, I want to play, say each track to listen to a particular channel for a particular instrument, and I'm all set. The keys on the keyboard go to the channel where the synth plugin is listening, keyboard on another channel where a sampler is listening, and keys edrum go to a third channel where Superior Drummer is listening, etc. My edrums me has even let press a button to change between "kits", altering what channel/notes sends each pad, so I can load up, say, multiple instances of Superior Drummer and switch between them on the fly. Large.

    MainStage has much latency better than my DAW, so I'm trying to switch, but after searching around here, and by reading the manual (where the "Connecting MIDI instruments" section is literally just a diagram showing how to connect a MIDI cable and nothing else), I still feel stuck. It seems that I have to start by loading a concert (either drums or keyboards, but not two and no option for a clean slate), then shove a virtual representation of one of my instruments has not been included in the concert I have loaded and then link each individual pad notes not only a unit, not just a channel, but a specific (ditto the high/low notes on the keyboard).

    Why am associating notes with pictures of the pads when the whole point is that the notes are generated by the real thing?

    Why can't just say 'send some signals come from channel 1 device edrum to this plugin', and so on?

    Why am I spent the time to mount images of a keyboard and 24 portions on my screen (surprisingly difficult) when all I care gets ratings generated by a physical device to sounds generated by a plugin?

    Why this strange intermediaries?

    I know that mainstage is very well regarded by people who know more about this kind of things I do, so what I'm missing here? If I use the wrong tool for what I want to do, any suggestions for what I should try instead?

    Hello

    usernamenumber wrote:

    Why am associating notes with pictures of the pads when the whole point is that the notes are generated by the real thing?

    Why can't just say 'send some signals come from channel 1 device edrum to this plugin', and so on?

    Why am I spent the time to mount images of a keyboard and 24 portions on my screen (surprisingly difficult) when all I care gets ratings generated by a physical device to sounds generated by a plugin?

    If I understand the situation, all you really need to do is get rid of any control layout, you don't want, create the MIDI activity 2 monitors (1 for the keyboard, the other the drumpads), assign entries noon then label 2 devices for clarity.

    In edit mode, just do as you describe: assign one controls the activity of MIDI to a particular slice.

    TDC

  • my main wireless hp programe not working do not receive the error code 0 x 80070002

    my main wireless hp program does not keep receiving error code 0 x can 80070002 someone piz

    Your message is in the forum for people needing help with the anti-malware program from Microsoft Security Essentials (MSE).

    You ask for help in Forum Windows: http://answers.microsoft.com/en-us or contact HP Support at http://h10025.www1.hp.com/ewfrf/wc/siteHome?cc=us&lc=en

Maybe you are looking for

  • I forgot the password to disk PX1266E - 1 25

    I have a drive hard px1266e - 1 g 25. I forgot the password. How can I work around this to access the backup files?

  • Done Tecra A8 PTA83E support 5.1 system speakers & how to connect it

    I have Tecra A8 PTA83E lap top model. (Serial No.: X6100725H)When I check my audio system in the Control Panel, it is show the types of outputs for 5.1 suround sytem, even some more up to 7... I bought a 5.1 speaker system, now I want to connect with

  • running multiple instances of VBAI does not work

    Hello everyone, We are 4 common examples of VBAI at the same time. Recently, he had to copy it (because production is doubly). With our first system, we have no problems when you try to run multiple instances of VBAI. This time, however, it does not.

  • I can not burn the file on a dvd

    I want to save through recovery norton computer and put it on the record. Click on burn, but nothing happens

  • NeoReader

    The Z3 was a NeoReader in Android 5.0? as I can't find 1 just a Z with only.