What is the problem with my sql says invalid identifier

CREATE THE TABLE PROJECT

(proj # NUMBER (6) NOT NULL,)

p_name VARCHAR2 (15) NOT NULL,

p_desc VARCHAR2 (150) NOT NULL,

p_budget NUMBER (8).

CONSTRAINT project_proj PRIMARY KEY #pname_pk (proj #, p_name));

CREATE TABLE WORK ORDERS

(wo # NUMBER (6))

proj # NUMBER (6).

wo_desc VARCHAR2 (150).

wo_assigned VARCHAR2 (30),

wo_hours NUMBER (5),

wo_start DATE,

wo_due DATE,

wo_complete char (1),

CONSTRAINT workorders_wo #_pk KEY(wo#) primary SCHOOL.

CONSTRAINT workorders_wo #_fk FOREIGN KEY (proj #)

REFERENCES PROJECT (proj #).

Workorders_wodesc_uk of CONSTRAINT UNIQUE (wo_desc).

CONSTRAINT workorders_hours_ck CHECK (wo_hours > = 0).

CONSTRAINT workorders_wocomplete_ck CHECK (wo_complete in ('Y', 'n')));

Whenever you have an error message the best thing to do is post a copy of your session with your statement sqlplus output. Like this.

I have no problem with your first statement regarding the syntax and semantics

SQL> create table project
  2  (
  3  proj# number(6) not null,
  4  p_name varchar2(15)not null,
  5  p_desc varchar2(150)not null,
  6  p_budget number(8),
  7  constraint project_proj#pname_pk primary key (proj#, p_name)
  8  );

Table created.

Second table a problem that his tent to make reference to project.proj #. But the problem is that it doesn't have a primary or unique key defined in this topic.

SQL> create table workorders
  2  (
  3  wo# number(6),
  4  proj# number(6),
  5  wo_desc varchar2(150),
  6  wo_assigned varchar2(30),
  7  wo_hours number(5),
  8  wo_start date,
  9  wo_due date,
 10  wo_complete char(1),
 11  constraint workorders_wo#_pk primary key(wo#),
 12  constraint workorders_wo#_fk foreign key (proj#)
 13  references project (proj#),
 14  constraint workorders_wodesc_uk unique (wo_desc),
 15  constraint workorders_hours_ck check (wo_hours >=0),
 16  constraint workorders_wocomplete_ck check (wo_complete in ('y' ,'n'))
 17  );
references project (proj#),
                    *
ERROR at line 13:
ORA-02270: no matching unique or primary key for this column-list

I defined a

SQL> alter table project add constraint project_proj#_uk unique (proj#);

Table altered.

Now, the second table is also created correctly

SQL> create table workorders
  2  (
  3  wo# number(6),
  4  proj# number(6),
  5  wo_desc varchar2(150),
  6  wo_assigned varchar2(30),
  7  wo_hours number(5),
  8  wo_start date,
  9  wo_due date,
 10  wo_complete char(1),
 11  constraint workorders_wo#_pk primary key(wo#),
 12  constraint workorders_wo#_fk foreign key (proj#)
 13  references project (proj#),
 14  constraint workorders_wodesc_uk unique (wo_desc),
 15  constraint workorders_hours_ck check (wo_hours >=0),
 16  constraint workorders_wocomplete_ck check (wo_complete in ('y' ,'n'))
 17  );

Table created.

SQL>

My Version of DB's

SQL> select * from v$version where rownum = 1;

BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi

SQL>

Tags: Database

Similar Questions

  • OK, what's the problem with this SQL?

    I just can't understand it:

    SQL > /.

    SELECT

    "CREATE or REPLACE trigger abc_ ' | seq___1.nextval | "_aiud" | CHR (10) |

    ' AFTER Insert or Update or delete on ' |  TABLE_NAME | CHR (10) |

    "New reference as new and old old ' | CHR (10) |

    "For each line. CHR (10) |

    'declare ' | CHR (10) |

    ' v_opr varchar2 (1); ' || CHR (10) |

    "start" | CHR (10) |

    "IF THE INSERTION CAN" | CHR (10) |

    "v_opr: ="I"; ' |" CHR (10) |

    "Update then ELSIF | CHR (10) |

    "v_opr: ="U"; ' |" CHR (10) |

    "ELSE" | CHR (10) |

    "v_opr: ="D"; ' |" CHR (10) |

    ' END IF; ' || CHR (10) |

    ' log_to_table ("ROWID", ' |) '''' || TABLE_NAME | '''' || V_OPR); ' || CHR (10) |

    ' end; ' || CHR (10) |

    '/ ' || CHR (10) |

    ' ' || «"CHR (10)»»

    From user_tables where rownum < 3

    ORDER BY table_name

    ORA-02287: sequence number not allowed here

    Hello

    remove the order clause contained in the query, it should work.

    Thank you

  • What is the problem with this pl/sql code?

    What is the problem with this statement of the cursor? I am getting PLS-00341 error for her:
    CURSOR cur_rsource(p_sql_stmt IN VARCHAR2) IS
            SELECT plan_table_output FROM v$sql s, table(dbms_xplan.display_CURSOR(s.sql_id, s.child_number)) t WHERE sql_text LIKE '''%'||p_sql_stmt||'%''';
    How to solve this problem?

    Thank you

    Published by: PhoenixBai on December 14, 2009 14:05

    I don't have time right now to study exhaustively, but for me his vomit ORA-00942 table or view does not exist on this line:

        SELECT sql_id, child_number into tmp_sql_id, tmp_child_number
             from v$sql where sql_text like sql_statement||'%' and sql_text not like '%v$sql%';
    

    I am able to select from v$ sql in normal SQL as user I am compiling as, so don't know why it's complaing.

    Anyone know if there are certain restrictions on access to the views v$ through PL/SQL?

    EDIT: http://www.dbasupport.com/forums/showthread.php?t=22299

    Access to the views of $ v seems to be through a role - try giving explicit access to it.

    As SYS, you must grant select permissions on V_$ SQL (V$ SQL is synonymous with V_$ SQL) to your owner of the procedure. Just tested on my system and it allows him to compile.

    Published by: Cyn on December 14, 2009 10:30

  • What is the problem with my Oracle reports parameter?

    Hello

    We use a PL SQL package that allows the user to select the report you want Oracle and associated parameters.   While the control is passed to Oracle 11 g reports.

    The requirement of one of the reports is to enable more detailed codes be selected by the user and then shown.  The detailed code is an alphanumeric field that can hold between 4 and 6 characters.

    If my data model looks like this

    SELECT student_id

        FROM my_view

       WHERE detail_code IN :p_detail_code;

    and the parameter that I'm passing to Oracle reports looks like this (when I view the source HTML code)

    & p_detail_code =('1001','1002')

    so no record is selected.

    However, if my data model looks like this, I get the records you want:

    SELECT student_id

      FROM my_view

    WHERE detail_code IN ('1001', '1002');

    We have Oracle Database 11 g Enterprise Edition Release 11.2.0.4.0 - 64 bit Production.

    Please tell me what is the problem with my setting.  Thanks a lot for your help.

    This isn't how you can use in. See this example on how to solve it with the digital settings. If your setting is a character, you need to change this.

    In fact, when you simply enter 1,2,3 as an input parameter, you actually create this query:

    Select *.

    from my_table

    where num_column in ("1,2,3")

    Use rather a lexical parameter:

    Select *.

    from my_table

    & p_where

    In the parameter after relaxation shape, build the lexical like this:

    :p_where := 'where num_column in ('||:p_param||')';
    
  • What is the problem with this URL

    Can someone tell me what is the problem with this url
    owa_util.redirect_url(apex_util.prepare_url('f?p='||:APP_ID||':25:'||:APP_SESSION||'::'||:DEBUG||':25,28'||':P25_JOBID,P25_PG:&P3_JOBID.,3, null,||:APP_SESSION'));
    It gives me a value for P25_PG, that is to say 3 but always sets P25_JOBID to 0

    Gus

    Hello Gus,

    It looks like point P3_JOBID has no value for the rendering of the page.
    If the value is set subsequently, you can try the following change

    owa_util.redirect_url(apex_util.prepare_url('f?p='||:APP_ID||':25:'||:APP_SESSION||'::'||:DEBUG||':25,28'||':P25_JOBID,P25_PG:'||:P3_JOBID||',3, null,||:APP_SESSION'));
    

    But the part at the end

    ||',3, null,||:APP_SESSION'
    

    Wil do nothing because you give only 2 items in the list separated by commas of the page elements you want to submit. Everything after the second comma in the comma separated value list is of no use for the url of the apex.

    As additional info, the URL of the Apex is built like this:
    >
    1 - application ID or alias
    2 - page ID or Alias
    3 - session & SESSION. : APP_SESSION
    4. application (for example, PRINT_REPORT = REPORT_1) & ASK. : REQUEST
    5 - debug (YES or NO) & DEBUG. : DEBUG
    6 - cache framework

    APP - clear the cache for the entire application
    SESSION - clear the current user session cache
    PR - Reset pagination
    x - clear the page cache x
    -empty the cache for the element y

    7 - separated by a comma list of items on the page
    8 - the list of values separated by commas
    9 - mode printer friendly (YES or blank)

    f? p = & APP_ID.: 1010: & APP_SESSION. : & DEBUG. : RP, 1010:P1010_ITEM1, P1010_ITEM2, P1010_ITEM3:A, B, C
    >

    Kind regards
    Kees Vlek
    -----
    Company: http://www.orcado.nl
    Blog: http://www.orcado.nl/blog/blogger/listings/69-kvlek
    Twitter: http://www.twitter.com/skier66
    If the answer to question please change replied and mark the appropriate post as correct / helpful.

  • Can someone explain to me what is the problem with Illustrator CS5?

    I can't, for the life of me, understand why this happens. If you look carefully at the images below, you will notice that the 'path' or a schema does not coincide with what is represented as a fill.

    I can work on my forms on CS4 and everything works fine.

    That seems to happen when I use pathfinder operations, or resize a set of shapes.

    What is the problem with my Illustrator?

    Please help me.

    Picture 27.pngPicture 28.png

    Hi Enrique.

    It seems to me that the points can be aligned to the pixel grid when you develop. Hard to say without knowing the extent of your examples. I don't have it, but I think snap to grid of pixels has been added in CS5. Worth the drive. Or off uncheck.

    Peace,

    Lee

  • What is the problem with my trigger :(

    Hi friends

    What is the problem with this trigger please
    SQL> select object_type from user_objects where object_name='CE_STMT_INT_TMP';
    
    OBJECT_TYPE
    -------------------
    TABLE
    
    SQL> create or replace trigger ce_stmt_int_tmp_trg1
      2  after insert on ce_stmt_int_tmp
      3  for each row
      4  begin
      5      :new.column7 := 'checkno_test';
      6  end;
      7  /
    create or replace trigger ce_stmt_int_tmp_trg1
                              *
    ERROR at line 1:
    ORA-04084: cannot change NEW values for this trigger type
    Thank you very much

    I guess you mean that SQL * Loader is insertion of the value of the column, not not to date. You can override the value SQL * Loader is the insertion in a level line BEFORE INSERT trigger.

    Justin

  • What is the problem with my iMac mid-2011

    Hello

    Need help find out what is the problem with my iMac to mid-2011.

    Yesterday during a reboot it just never came to life.

    On turning the power on, I get the RINGTONE to start and that's it. The screen is totally black. Nothing behind tried with a torch.

    VRAM rearmament so far I tried repeatedly, unplug and plug, all kinds of combinations of keys in the carillon and nothing.

    Connected to an external monitor and shows nothing of too - no signal.

    Any way that I can know what is wrong with it before sending it to the service tech? I suspect bad graphics card but how do you ensure?

    From what you describe, it looks like a hardware issue that Apple will only be able to resolve, but not to despair immediately.

    Read it please get help with graphics issues on external displays connected to your Mac - Apple Support.

    I know that the title and subject are not suitable to your concern, but buried in this document is the following passage that contains three links describing the steps to follow.

    If you can not change the resolution of your screen because you see no image, restart your Mac in safe mode to reset the default display resolution.

    If booting safe mode doesn't resolve the problem, reset your Mac NVRAM and SMC to reset the video ports on your Mac to their default values.

    That first, then write again for additional suggestions if you are still having problems.

  • Qosmio X 70-A-13th-what is the problem with cooling fan?

    System: Toshiba x 70-13th with Evo 850 256 GB Samsung SSd
    Windows 8.1
    Intel Extremutilitiy - Voltage of the CPU Dynamik Offset 84,96 mV
    3D Mark 06 Score: 24096

    Thermal paste CPU/GPU: GCelid Solution GC Extreme
    temperature: MAx CPU: 85 ° C low game of normal of 45-49 ° C 41-45 ° C: 75-80 ° C

    Fan Max Speed: 60 % (bad hard)

    What is the problem with the fan?

    What is the problem with the fan?

    Why do you think that there is something wrong?

    I found your other thread on the review of the thermal grease...
    https://Forum.Toshiba.EU/showthread.php?82764

    Looks like you have replaced the thermal paste... right?

  • What is the problem with kernel_task?

    Hello everyone,

    What is the problem with kernel_task?

    I explan: Macbook Pro early 2011 LION OS up to date.

    I bought 8 GB on China supplier, CRUCIAL...

    Well, I got a lot of kernel Panic. Usually, he is involved material, taken on my RAM, back is the original, so still have in the kernel_task to 300% CPU monitoring followed up to 500%...

    Well, I went back to a clean install, a manufacturing one, with nothing.

    Wish I 'd' diagnosis of the equipment, never went on, test it on safe mode, disable all extensions, then nothing:

    Sometimes the kernel_task crazy sometimes not...

    Good read a lot on the internet but nothing has worked... I went to the Apple store in DIJON, they do not have diag any hardware problem, and all my App are approved Apple.

    Used to play the eve online thought, therefore, the graphic chipset pourrait was damaged, so when it's too 'hot' the mac gets crazy... but I expected crazy restarts and that sort of thing.

    I bought a manual, there is no french support to the opening of Apple, but found nothing about my question.

    So what?

    I bought something conivient on Support and friability so today he's dead?

    What should do?

    If you still get the panic of the core, thanks to post separate 2 or 3 of the most recent as answers on this.

    Reports of kernel panic: "/ Library/Logs/DiagnosticReports".

    http://support.Apple.com/kb/ht2546>

    http://support.Apple.com/en-us/HT200553>

    The panic report should have "panic" in the name of the file.

    Kernel panics tend to come from 2 sources

    • Material:
      • 3rd party RAM is the most common.  Replace or return the original is usually the solution.  Crucial and MacSales.com were 2 of the most reliable sellers for the initial quality and guest without question of replacement.
      • Broken USB cables or USB devices have turned up as the 2nd most likely material number.  Usually remove all USB devices, or replace the keyboard and USB mouse to see if it's one of those existing.
      • There are a few Macs with graphics chips that have failed.  I don't know that they exist, but do not know what model Mac had these chips.
    • Software
      • antivirus protection.  It is the number 1 most panicked related software cause.  More OS X does not need antivirus, because it has its own built-in protections http://www.thesafemac.com/mmg-builtin/>.
      • Other core 3rd party extensions are a distant 2nd.
      • NOTE: not all 3rd party kernel extensions are causing problems, but when there is a kernel panic, it's the first thing to look at.

    If run kernel_task is often caused by core 3rd party extensions.  It can be caused by an application program, but then the Applications-> Utilities-> Activity Monitor show "As" an application that consumes a lot of CPU, disk IO and network IO in collaboration with the kernel_task using lots of CPU.  If there is no application burns the CPU at the same time, so it is almost always a 3rd special part of the kernel that was originally the use excessive CPU kernel_task.

    Start in safe mode is usually a test to see if 3rd party extensions are part of the case.  But in safe mode is not how you run your system, because it also loads less advanced graphics drivers and other components.  Safe mode is very conservative, but it's a great way to see if the 3rd party software is at fault and have started when 3rd party software panic the system at boot.

    The contributors to the forum long strongly warn against getting 3rd party anti-virus, cleaners Mac and additions increasing.  This class of 3rd party additions have shown time and time again to really harm performance, remove things they shouldn't and cause a kernel panic.  Especially right after an OS X update to a new version.

  • How I download 80070103 windows update is update safe what is the problem with this update

    Just got the update installation today to download update 80070103 time ever I go to download the update fail what is the problem with this update & how do I get updated.

    Hello

    Thanks for posting in the Microsoft Community.

    If I understand correctly that you have problems with Windows Update.

    Please answer these questions:

    1. What is the update's KB number?

    2 have you made any changes to the computer before the show?

    Let us try the following methods:

     

    Method 1: Run the following fix - it:

     

    The problem with Microsoft Windows Update is not working:

    http://support.Microsoft.com/mats/windows_update/

    Method 2: See the following article:

    Windows Update 80070103 error code:

    http://Windows.Microsoft.com/en-us/Windows-Vista/Windows-Update-error-80070103

    Hope the helps of information. We know if you need help. We will be happy to help you.

  • I installed the download tool usb/dvd windows 7, but after you have selected the iso file when I insert the USB stick and refrecing, it does show that "no usb drive compatible' what is the problem with my USB

    I installed the download tool usb/dvd windows 7, but after you have selected the iso file when I insert the USB stick and refrecing, it does show that "no usb drive compatible' what is the problem with my USB

    I have sandisk cruzer blade USB key

    Hi Rohit,

    Thanks for posting your query in Microsoft Community Forum. I understand that your USB drive is having problems of compatibility with your computer, but I would like to learn more about the issue in order to provide you with better assistance.

    1. You did it any significant hardware or change software on the computer before this problem?
    2. When do you get exactly the error message?
    3. Have you tried to connect to any other computer on this flash drives?
    4. Your USB key works on other computers or have you tried to connect to different USB ports on this computer?
    5. Is the pen drive getting detected in the case or you are able to access the drive folder in the window of the computer ?

    The question may arise if the currently loaded USB driver has become unstable or damaged, or if your PC requires an update for problems that could conflict with a device USB and Windows. This can also occur if your USB controllers may have become unstable or corrupt. So, I would suggest trying the following steps and check if the problem persists.

    Method 1:

    Please try the fixit (s) provided below which will help you solve common problems associated with devices and USB ports.

    If method 1 does not work, try Method 2.

    Method 2:

    Remove and reinstall all USB controllers.

    1. Open Manager devices by clicking the Start button, click Control Panel, click system and security, and then, under System, clicking Device Manager. If you are prompted for an administrator password or a confirmation, type the password or provide confirmation.
    2. In the list of the categories of equipment, locate and expand Bus USB controllers.
    3. Right-click every device under the Bus USB controllers node and then click Uninstall to remove them one at a time.
    4. Restart the computer and let the USB controllers get reinstalled.

    Plug in the removable USB device and test to make sure that the problem is solved.

    If the problem persists, go to method 3.

    Method 3:

    This method will install the latest drivers from device to your USB device.

    1. Click the Start button, type Windows Update in the search box, and then click Windows Update in the results pane.
    2. Click find updates. When the scan finished, click optional review updates.
    3. Click the check box next to the update, and then click install updates.
    4. If you are prompted, read the license agreement, then click I agree.
    5. Follow the instructions on the screen to download and install updates.
    6. If you are prompted, restart your computer.

    More information: Update a hardware driver that is not working properly

    Hope this information is useful. If the problem still persists, please post back for further assistance, we will be happy to help you.

  • What is the problem with Windows 7 Live Mail?

    What is the problem with Windows 7 using Windows Live Mail?

    When I type my emails using special characters, for example "$- + = % sometimes even Live Mail change my characters to a reverse with a top character."  And it it changes between the time wherever I sends it and receives the other person, so I never really know if they receive a message scrambled or not.  I never had this problem with Outlook Express.  What can we do about it.  I use this for business and it is absolutely unacceptible.

    Hello

    This forum deals with aspects of electronic mail on your computer network.

    If the problem related to the Live mail Server, or configure the features of the software, you'll do better by logging and displaying the question on Live Mail support forum.

    My moderator tools cannot transfer messages on the forums of Windows,

    Please re - ask your question on the Forum Windows Live,

    Windows Live Mail Forum
     
    http://windowslivehelp.com/forums.aspx?ProductID=15

  • I agree with the CC. But I also have APS CS6. I get the message that the updates are available. But whenever I try to 'install', I get the message that it failed and the error code is U44M1P7. What is the problem with obtaining this update?

    Whenever I try to install I get message that he had failed. The error code is U44M1P7. What is the problem with this update?

    U44... Update error http://forums.adobe.com/thread/1289956 can help

    At some point in the past (I don't know the exact date) Adobe "merged" the original update manager in cloud Update Manager, which means that you no longer use your original update manager

    I read a lot of posts that the updater latetest (cloud) sometimes does not work with old programs... Try to install your updates manually

    Beginning of the updates here and product selection, read to see if you need to install updates in the order of the numbers, or if updates are cumulative for the product http://www.adobe.com/downloads/updates/

  • What is the problem with the conversion of objects with gradients to the gradient mesh?

    What is the problem with the conversion of objects with gradients to the gradient mesh?

    Radial gradients are special, and it could become difficult edit the gradient mesh resulting.

    Take the layer apnel and inspect your objects. You will find a clipping mask the cracks inside.

Maybe you are looking for