Composite key mapping.

I have the table that has a composite key as the primary key. (I'm creating entity of the editor. Base_de_donnees contains several tables, where the list tables are not displayed in the data model editor)

When creating entity I have traced the two field (which are primary keys of database) as fields Id (OrderNumber and number)

After the model on the deployment server and running code, I get no result.

Also, no error message appears on the console of the server of LCD screens.

Composite key can be used in data modeling. If so, what is a good way to set up the composite key.

I use screens LCD 3.1 and latest version of the plugin for Flash Builder 4

< entity name='LineItemBean' persistent='true'>

            < annotation name="VisualModeler" width="239" height="123" x="293" y="51"/>

<annotation ='ServerProperties' from the name of ServerType='LCD'/ >

            < annotation name="DMS" Table="ADVJPMT. Of the ELEMENTS' using transactions='false'/ >

<annotation name='ActionScriptGeneration' package='valueObjects' ImplicitServicePackage='services'/ >

            < id name="orderNumber" type="integer" generated="false">

                  < annotation name="DMS" ColumnName="ORDER_NUMBER"/>

            </ id >

            < id name="itemNumber" type="integer" generated="false">

<annotation ='DMS' from the name of ColumnName='ITEM_NUMBER'/ >

<annotation name='ActionScriptGeneration' DisableAutoReCalc='true'/ >

            </ id >

            < property name="quantity" type="integer">

                  < annotation name="DMS" ColumnName="QUANTITY"/>

<annotation name='ActionScriptGeneration' DisableAutoReCalc='true'/ >

            </ property >

      </ entity >

Hi Amit,

This use case must certainly work, and I don't see anything bad in your model as it is. Can you give some more information about what exactly are you trying to run? You run LineItemBeanService.getAll ()? It is the simplest filling/filter, you can try to see if the template has been correctly configured.

To see what can go wrong, you can try a few things:

1. enable debug logging. Open services - config.xml in the directory WEB-INF/flex to your LCDS webapp. At the bottom of the file, find the logging-> target and replace the level attribute 'Debug '.

2. try to get the data from the table of the ELEMENTS with a direct SQL query ("" Select * elements "") in the viewer request RDS (point of view of data model, RDS Dataview)

See if you directly to the database running the query gives the expected result and if so, check the server logs to see what happens when the server receives the request count with all.

_______________

That said, the LineItemBean entity in your model that makes me think you may also have an OrderBean and an ItemBean entity in your model. I'm guessing an order consists of a few command elements, each with a certain amount, and a given element can appear on many orders. If this is the case, you should consider these data modeling with the associations between the entity of LineItemBean and the OrderBean and ItemBean entities. This would mean that the ORDER_NUMBER and ITEM_NUMBER columns in your table will be the primary keys and foreign keys, and your model will look like this:

Give it a try, if that seems reasonable (I just guess on your case of use here)

Thank you

Svetlin

Tags: Adobe LiveCycle

Similar Questions

  • Integrate Hibernate L2 cache with consistency in the composite key of reference

    Hi all:
    I have a problem when I activate the Hibernate l2 cache integrated with consistency. When the entity class using this string or unique integer primary key, the L2 cache has worked well. But when I use the entity with composite key class, I had the problem.
    I wrote a script to test junit to test the session.get method, when I run the test cases for the first time, the miss of the entity to load the object from the cache, Hibernate will trigger a DB query so it box as an object, then put it in the cache. But when I run the test case, again, I found the Hibernate trigger a query once again, which was strange... (it should not have happened, I should got the object from the cache), then, I used the console cache coherence to list the data in the cache and finding himself under the information:
    ###########################################
    (Hi) map: list
    model. SiteUserInfo #model. SiteUserID@323819 = Item {version = null, freshTimestamp = 1333943690484
    model. SiteUserInfo #model. SiteUserID@323819 = Item {version = null, freshTimestamp = 1333943600419
    ###########################################
    There are two keys with the same value cached... (I put already implemented method hashcode and equals to SiteUserID object). someone there has the same problem? Or L2 Hibernate with composite key can integrate with consistency?

    Rip off code SiteUserID
    #####################################
    @Override
    public boolean equals (Object obj) {}
    If (obj == this) {}
    Returns true;
    }
    If (!) () obj instanceof SiteUserID)) {}
    Returns false;
    }
    SiteUserID id = (SiteUserID) obj;
    return new EqualsBuilder () .append (sid, id.getSid ()) .append (name, id.getName ()) .isEquals ();
    }

    @Override
    public int hashCode() {}
    return new HashCodeBuilder () .append (sid) .append (name) .toHashCode ();
    }
    ###################################

    Hi John,.

    I think there may be another problem.

    Please reference:
    http://blackbeanbag.NET/WP/2010/06/06/coherence-key-HOWTO/
    For entry cache, partitioned cache is placed in backup card in binary form.
    The main objects of the same data must always be serialized in binary form even.

    Unfortunately, use Hibernate CacheKey is as key cache L2.
    And CacheKey is somewhat complex, some related attributes use TreeMap as their type.
    "Java gives no guarantee on the order in a hash table and serialization is dependent on the command."
    (reference http://stackoverflow.com/questions/9337126/how-can-oracle-coherence-get-fail-with-retrieved-key-object)

    So... you may need to modify the source code of some Hibernate, ex: replace the FastHashMap in TreeMap...
    I tried, it looks like work. I'll send you have modified source codes.

    Best regards
    Leon

  • WebLogic 12 c | Reports | key mapping issues. cgicmd.dat

    Hi guys

    I managed to configure Weblogic 12 forms and States on Windows 10 & having a minor problem with the key mapping for the (current) report server

    I added a key to the file cgicmd.dat as follows

    Userlogin: userid=APPS/APPS@sct % * (who has worked with 10.3.6 weblogic 11 g) and call reports Forms as follows:

    Web.Show_Document ('/ reports/rwservlet? userlogin & desformat = PDF & destype = cache & report ='|: CTRL.) REPORT_NAME | ("& paramform = Yes, '_new');

    This call blocks the report server, while a call as follows

    Web.Show_Document ('/ reports/rwservlet? userid=APPS/APPS@sct & desformat = PDF & destype = cache & report ='|: CTRL.) REPORT_NAME | ("& paramform = Yes, '_new');

    works perfectly. I have checked and confirmed that the map file is loaded correctly.

    Please suggest me what could be the problem.

    Thank you and best regards,

    Hello Irfan

    I don't know if the solution that I found is really worth sharing, yet:

    I disabled IPV6 completely from my Windows 10 box

    Deleted the folder tmp for the WLS_REPORTS

    Restart the servers & and the mapping of the keys works fine now.

    Kind regards

  • How to update a record, if it is a composite key (primary key is based on two columns) in the OPS? page?

    Hello

    Actually I got to know this update of a record must be made when the primary key is based on two columns.

    Previously, I used SPEL for a column. It was working fine.

    But I came to know that regardless of the folder I try to update, it was the update page is coming up with the first combination of the record.

    As if RC 131

    RC 124

    RC 125 are the records.

    If I click on update of RC 124 also, the update page is coming up with RC 131 values as it is the first.

    So I understand that the SPEL should be based on two parameters, because it is a composite key.

    How to do?

    Please let me know if you don't understand the problem.

    Thank you.

    Wow!

    I got it.

    Thank you brothers, always a hope that you could help me

  • Index on the Composite key to solve enq: TM - contention

    Version: Oracle 10g

    Hello

    I had enq: TM - restraints in my database, and I want to apply the index on the foreign key of one of the table column.

    But I see there are composite foreign keys and foreign keys unique in the table.

    Only foreign key I can easily create the index, but my doubt is that, for a composite foreign key,.

    Do I need to create the composite indexes on each column of the composite key or composite foreign key columns, I have to apply clue to solve the enq: TM - restraints question.

    For example: I have a foreign key below

    "FK_RECONDATA_DRIVER" CONSTRAINT FOREIGN KEY ('NRT', 'DADDRESSTYPE', 'DADDRESSNR')
    REFERENCES 'COL '. "" TURN ON THE FAZGFUEHRER ' ('NRT', 'ANSCHTYP', 'ANSCHNR'),
    "FK_RECONDATA_PRODUCT' FOREIGN KEY ('NRT',"PRODUCTNR") CONSTRAINT
    REFERENCES 'COL '. "" ENABLE SORT "("FNR","SORTENNR")

    Here the column FNR is common in both the foreign key.

    Please help me find how to create indexes on these columns.

    An index defined as ind_fk (a, b, c, e, f) will cover (1) (a) FK and FK (a, b, c).

    It however will not cover FK(a,e,f) because it does not start by all the columns of the FK.

    You must create an additional index that begin with (a, e, f).

    Best regards

    Mohamed Houri

  • is it better to use the rowid function or a composite key

    I have a clue about 2 fields so that I can make my form based on these 2 fields
    But now since I spend my app in 4.2 that I intend to do everything depended of rowid function

    Is this the right approach
    I currently facing problems as 1422 extract extract several lines even if the primary key is defined as key composite column 2

    Your primary key must never rest on 'natural touches', that is to say the actual data in your table. The fact that you are talking about a composite key means that you think that do. You can create an index that is UNIQUE on these types of fields to maintain the integrity of the data, but they do not have the pharmacokinetics of the table.

    My primary keys are always a NUMERIC field, populated by a combination of sequence/relaxation. Because the data in the ID field have no connection with the data in the table - there is never any need/reason to change. As has been mentioned above, ROWID changes rarely, but it is possible for them. I use ROWID in the Apex and when I have forms to keep tiny (maybe 5-10 lines) lookup tables that are used to populate LOVs create a primary key is excessive.

  • CQL Join on the coherence of Cache with Composite key

    I have a coherence of Cache with a composite key, and I want to join a channel for the records that cache with a CQL processor. When I deploy the package that contains the processor, I get the following error:

    + italics14:32:35, 938. modify the beginning of query SimpleQuery | [ACTIVE] ExecuteThread: '7' for the queue: "weblogic.kernel.Default (self-adjusting) | CQLServer | FATAL +.
    + 14:32:35, 938. change query > > SimpleQuery < < start +.
    + specified predicate requires a comprehensive analysis of the external source that is not supported. Please change the join predicate. [ACTIVE] ExecuteThread: '7' for the queue: "weblogic.kernel.Default (self-adjusting) | CQLServer | FATAL +.

    I think I use the key. If I change the key to a single field, it is OK. I found a similar problem when I defined a Java class to represent the composite key. It is possible to join this way on a composite key cache?

    I could define another area that is the concatenation of fields in the composite key, but it's a little messy.

    My config is as below:

    < wlevs: caching system id = "MyCache" provider = 'coherence' / >

    < wlevs:event - type-repository >
    < wlevs:event - type the type name = "SimpleEvent" >
    < wlevs:properties >
    < name wlevs:property = 'field1' type = "char" / >
    < name wlevs:property = 'Field2' type = "char" / >
    < / wlevs:properties >
    < / wlevs:event - type >
    < / wlevs:event - type-repository >

    < wlevs: channel id = "InChannel" - type of event = "SimpleEvent" >
    < wlevs:listener ref = "SimpleProcessor" / >
    < / wlevs: channel >

    < wlevs:processor id = "SimpleProcessor" >
    < wlevs:listener ref = "OutChannel" / >
    < wlevs:cache - Ref source = "SimpleCache" / >
    < / wlevs:processor >

    < wlevs: channel id = "OutChannel" - type of event = "SimpleEvent" >
    < / wlevs: channel >

    < wlevs:cache id = value 'SimpleCache"type ="SimpleEvent.
    Properties-key = "Field1, Field2.
    system caching = "MyCache" >
    < / wlevs:cache >

    and the processor CQL is as follows:

    < processor >
    < name > SimpleProcessor < / name >
    < rules >
    < request id = "SimpleQuery" >
    <! [CDATA]
    Select I.field1, I.field2 from InChannel [now] as I,
    SimpleCache as S where
    I.Field1 = S.field1 and
    I.Field2 = S.field2
    []] > < / query >
    < / rules >
    < / processor >

    Thank you
    Mike

    Unfortunately, join him on composite keys in coherence is not supported in the released versions. He will be supported in release 12g.

    As you mention, setting another field as the key, which is the concatenation of the original keys is the workaround.

  • Searching on KeyField composite key

    I have a composite key with several KeyFields. I'm not allowed to create SecondaryKey on any KeyField (or better said, I've not found a way to do this). How would a search using the first KeyField? Are there examples? Thank you. Peter

    Hi Peter,.

    This thread answered your question? :

    Re: Help definition index

    No, there is no example of this.

    -mark

  • How to assign the WASD keys for arrows (the key mapping)?

    To increase the rate to make source code, it is useful to use WASD rather arrow keys. It is useful for users of right.

    Hello Jiri,

    I recommend you to use external applications for the mapping of the keys.

    An example: http://www.howtogeek.com/howto/windows-vista/map-any-key-to-any-key-on-windows-xp-vista/

    I'm sure you can find many web-based applications that meet your needs,

    Mircea

  • How can I disable these very annoying keys mapped to the F keys. I want normal F keys!

    I play a little my surprise (for me) 4 Gig HP Pvillion g6 powerful i3 laptop (W7 64-bit, integrated :() graphics I am more than happy with it.) HOWEVER! There is one thing that finally pushed now a few minutes ago, and it's shortcut keys of STUPID pre mapped keys f. WHY have buttons F have F BUTTONS DON'T WORK? It is causing me a lot of stress in the world of the imaginary game that I often live and we cannot have just that. Rant on (not a real favorite hangover that I promise you! Just a little Catharsis) Please help oh ye enlightened internet folk!

    EDIT: I should have clarified that I mean keys F # but I have faith in your intelligence to help a friend. Overcome my simple ignorance, and bring me the knowledge of the ancients! Can do you so soon? I wan't to play Far Cry 3 without a hitch

    Seems that HP has made these keys just active in them pressed (nowhere did he clear how long this interval is).
    BUT (and now comes the good news), they can be disabled in the BIOS so that they operate strictly as keys 'F' (page 38):
    "An action key performs an assigned function. The icon on each of the f1 through f4 and f6 keys
    by f12 keys shows the function assigned to this key.
    To use a function key to action, press in and hold the key.
    The main feature of the action is enabled in the factory. You can disable this feature in the configuration utility (BIOS).
    See Using Configuration Utility (BIOS) and the system on page 68 Diagnostics for instructions on opening
    Setup Utility (BIOS) and then follow the instructions at the bottom of the screen. »

    Then, after it is disabled in the BIOS, they only work as 'special' according to Mr. Clement keys, pressing the Fn key in combination with her:
    "To enable the function assigned after deactivation of the key feature of the action, you must press the fn key in.
    combination with the appropriate action button. »

    Here is a link to the manual for more information:
    http://h10032.www1.HP.com/CTG/manual/c03271200.PDF>

    If you still have a problem with her due to the proximity of the Fn key, then I believe that you can turn it off completely by stopping HP Quick Launch in the Task Manager. Test it offline before game to ensure that the judgment it does not affect other functions of the keyboard that you need.
    Game on, my friend!

    SC Tom

  • composite key

    Hello

    can I understand a foreign key column to define a composite primary key?
    for example, Department number is a foreign key in the employee table, then I set number of Department and employee as the primary key of the employee table number?

    concerning

    I guess that's still just a sample of what is stored.
    What is the column 'NO '?

    Because a value 'NO' can refer to several 'Boreholenumbers' and a Boreholenumber can refer to several 'NO', you have a number to-several. This should be divided into a 1 to many, and many-to-1 relationship.

    Suppose that 'NO' refers to a boring project number (' excuse the pun) because you have not detailed there.

    I would expect tables like that...

    Table: Boring_Project (BP_NO number, project name varchar2 (30)...)
    Data for example:

    BP_NO Project_Name       ... etc.
    ----- ------------------
    1     Drill for Oil
    2     Dig for Coal
    3     Clangers Moon Dust
    

    Table: Drilling (BH_NO varchar2 (10), Borehole_Name varchar2 (30)...)
    Data for example:

    BH_NO Borehole_Name      ... etc.
    ----- ------------------
    BH1   Borehole 1
    BH2   Borehole 2
    

    Table: Project_Borehole (PBH_NO number, BP_NO number, BH_NO varchar2 (10), varchar2 (10) Field1, Field2 varchar2 (10))
    Data for example:

    PBH_NO BP_NO BH_NO field1 field2
    ------ ----- ----- ------ ------
    1      1     BH1   xyz    pqr
    2      2     BH1   abc    mno
    3      3     BH1   prq    jjq
    4      1     BH2   aqr    xms
    5      2     BH2   xms    nds
    

    So now we have a relationship 1:M between the Boring_Project and Project_Borehole tables.
    We also have a relationship 1:M between drilling and Project_Borehole tables.

    Boring_Project ----- 1:M ----- Project_Borehole ----- M:1 ----- Boreholes
    

    Essentially, this gives you your number to-several between the tables Boring_Project and drilling.
    The Project_Boreholes has its own unique primary key and the BP_NO ('NO' in your case) and BH_NO ('Boreholenumbers' in your case) are two foreign keys.
    Data from the field is linked to a specific combination of 'NO' and 'Boreholenumber' is then that join at the table, but none of these numbers should be the primary key, they should be related to their tables foreign keys "parent". The junction table has its own unique key for every relationship that develops between parents.

    Does that make more sense?

  • the movement of the cursor and other keys mapped to the guest operating system

    Host operating system is fedora 10.  Guest operating system is Windows XP Pro.  The arrow of special keys, group of 4 and at home, delete, insert, etc., group of 6 on a typical keyboard on the host computer are not mapped to the guest OS.  Anyone know how this can be corrected?

    Thank you

    Jeepers

    Same problem for me, but I found the solution via google a few weeks ago and I think there's a post on this forum about this as well. But here's my version...

    in your user directory, it must be a directory .vmware.

    Inside this directory must be a file named config, otherwise create it

    in the config file should be a line like this:

    xkeymap.nokeycodeMap = true

    If this isn't there, add it.

    Remotely close sessions and reconnect. Problem solved!

    Other messages on the Internet are talking about doing this on the host machine when running VMware workstation, but it works well enough for the VMware remote console.

    Sure just what do you on the computer that is running the Remote Console and not the host machine, run the virtual machine.

  • Problem of composite key chain BigDecimal, pair

    JDeveloper 12.1.3

    I have OS based on a table that has the following PK

    Task_Id NUMBER

    Id_ressource Varchar2 (6)

    Using the EO above, I have a VO to view data in the user interface. I get the problem in the bean to support (test code below)

                DCBindingContainer dcbindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
                DCIteratorBinding iterator = dcbindings.findIteratorBinding("TaskCalendarIterator");
                System.out.println(activity.getProvider().getId());
                //Key key = new Key(new Object[] { activity.getId(),activity.getProvider().getId() });
                java.math.BigDecimal key1= new BigDecimal(140080);
                String key2="ds1";
                Key key = new Key(new Object[] { key1,key2 });
                System.out.println(activity.getId());
                System.out.println(key);
                RowSetIterator rsi = iterator.getRowSetIterator();
                Row row = rsi.findByKey(key, 1)[0]; //!!!!!!!!!!!!!!!!!!!!!!!!!!!! Here is where exception is thrown
                rsi.setCurrentRow(row);
    

    Caused by: oracle.jbo.domain.DataCreationException: Houston-25009: failed to create an object of type: java.math.BigDecimal type: java.lang.String with value: ds1

    Recording with the key 140080, ds1 exists in the iterator.

    I thought that the key can be anything, including channels?

    OK, I got the problem solved. The order of the key attributes must be identical to the order of these attributes in the original Version, NOT in OT

    The order was therefore, in my case in OT, TaskId, ResourceId

    Vo to ResourceId, TaskId

    That's why in the bean to support code, it must be:

    java.math.BigDecimal key1= new BigDecimal(140080);  //This is TaskId
    String key2="ds1";  //This is ResourceId
    Key key = new Key(new Object[] { key2,key1 });
    
  • Creating aliens/Composite keys (referenced)

    Hello. I have tried to figure this out for a few hours now and thought I'd try posting on a forum before going to bed I now want to rip my hair as I just can't understand it!

    Although it will take the masses of space Im going to provide my DB SET here, so that nothing is left out...

    Here it is:


    CREATE TABLE 'COURSES '.
    (NUMBER OF 'COURSE_NO',
    "COURSE_NAME' VARCHAR (30),
    DATE OF THE "COURSE_START_DATE."
    DATE OF THE "COURSE_END_DATE."
    'TOTAL_UNITS' SMALLINT,
    'COURSE_COORDINATOR_STAFF_NO' SMALLINT,
    'TOTAL_COURSE_COST' SMALLINT,
    'THIRD_PARTY_SUPPLIER_NO' SMALLINT,
    PRIMARY KEY ('COURSE_NO') 'COURSE_PK' ENABLE CONSTRAINT);

    CREATE TABLE 'ASSESMENT_TYPE '.
    (VARCHAR (15) 'ASSESMENT_TYPE',)
    VARCHAR (70) "ASSESMENT_DESCRIPTION."
    PRIMARY KEY ('ASSESMENT_TYPE') 'ASSESMENT_TYPE_PK' ENABLE CONSTRAINT);

    CREATE TABLE 'COURSE_OUTCOME '.
    ('COURSE_OUTCOME' VARCHAR (5),)
    VARCHAR (25) "COURSE_OUTCOME_DESCRIPTION."
    PRIMARY KEY ('COURSE_OUTCOME') 'COURSE_OUTCOME_PK' ENABLE CONSTRAINT);

    CREATE TABLE 'DEPARTMENT '.
    ("DEPARTMENT_NO' SMALLINT,
    'DEPARTMENT_NAME' VARCHAR (50),
    VARCHAR (150) "DEPARTMENT_LOCATION."
    ACTIVATE THE 'DEPT_MANAGER_NO' SMALLINT NOT NULL,
    CONSTRAINT PRIMARY KEY ('DEPARTMENT_NO") ENABLE 'DEPARTMENT_PK');

    CREATE TABLE 'EDUCATIONAL_INSTITUTION '.
    (VARCHAR (100) 'SCHOOL_UNIVERSITY_NAME',)
    VARCHAR (200) "SCHOOL_UNIVERSITY_ADDRESS."
    PRIMARY KEY ('SCHOOL_UNIVERSITY_NAME') 'EDUCATIONAL_INSTITUTION_PK' ENABLE CONSTRAINT);

    CREATE TABLE 'EMPLOYEE '.
    ("EMPLOYEE_NO' SMALLINT,
    "EMPLOYEE_NAME' VARCHAR (50),
    VARCHAR (150) "EMPLOYEE_ADDRESS."
    'JOB_DESCRIPTION' VARCHAR (50),
    'STATUS' VARCHAR (15).
    'START_DATE' DATE,
    'SALARY_CODE' SMALLINT,
    'SUPERVISOR_EMPLOYEE_NO' SMALLINT,
    "DEPARTMENT_NO' SMALLINT,
    PRIMARY KEY ('EMPLOYEE_NO') 'EMPLOYEE_PK' ENABLE CONSTRAINT);

    CREATE TABLE 'EMPLOYEE_COURSE_OUTCOME '.
    ("EMPLOYEE_NO' SMALLINT,
    'COURSE_NO' SMALLINT,
    'COURSE_OUTCOME_CODE' VARCHAR (5),
    'COURSE_EMPLOYEE_MARK' SMALLINT,
    CONSTRAINT PRIMARY KEY ('EMPLOYEE_NO', 'COURSE_NO') ENABLE 'EMPLOYEE_COURSE_OUTCOME_PK');

    CREATE TABLE 'EMPLOYEE_COURSE_UNIT_OUTCOME '.
    ("EMPLOYEE_NO' SMALLINT,
    'COURSE_NO' SMALLINT,
    'UNIT_NO' SMALLINT,
    'UNIT_OUTCOME_CODE' VARCHAR (5),
    'EMPLOYEE_UNIT_MARK' SMALLINT,
    CONSTRAINT PRIMARY KEY ('EMPLOYEE_NO', 'COURSE_NO') ENABLE 'EMPLOYEE_UNITOUTCOME_PK');

    CREATE TABLE 'EMPLOYEE_CRS_UNIT_ASSESMENT '.
    ("EMPLOYEE_NO' SMALLINT,
    'COURSE_NO' SMALLINT,
    'UNIT_NO' SMALLINT,
    VARCHAR (15) "ASSESMENT_TYPE."
    'EMPLOYEE_ASSESMENT_MARK' SMALLINT,
    CONSTRAINT PRIMARY KEY ('EMPLOYEE_NO', 'COURSE_NO') ENABLE 'EMPLOYEE_CRS_UNIT_ASSESMENT_PK');

    CREATE TABLE 'EMPLOYEE_QUALIFICATION '.
    ("EMPLOYEE_NO' SMALLINT,
    'QUALIFICATION_TYPE' VARCHAR (5),
    'SUBJECT' VARCHAR (20),
    "GRADE" SMALLINT,
    VARCHAR (100) "SCHOOL_UNIVERSITY_NAME."
    'AWARDING_BODY' VARCHAR (50),
    'DATE_QUALIFICATION_OBTAINED' SMALLINT,
    CONSTRAINT PRIMARY KEY ('EMPLOYEE_NO', 'QUALIFICATION_TYPE') ENABLE 'EMPLOYEE_QUALIFICATION_PK');

    CREATE TABLE 'QUALIFICATION_TYPE '.
    ('QUALIFICATION_TYPE' VARCHAR (5),)
    VARCHAR (25) "QUALIFICATION_DESCRIPTION."
    PRIMARY KEY ('QUALIFICATION_TYPE') 'QUALIFICATION_TYPE_PK' ENABLE CONSTRAINT);

    CREATE TABLE 'WAGES. "
    ("SALARY_CODE' SMALLINT,
    'SALARY_AMOUNT' SMALLINT,
    PRIMARY KEY ('SALARY_CODE') 'SALARY_PK' ENABLE CONSTRAINT);

    CREATE TABLE 'THIRD_PARTY_SUPPLIER '.
    ("THIRD_PARTY_SUPPLIER_NO' SMALLINT,
    VARCHAR (100) "THIRD_PARTY_NAME."
    VARCHAR (100) "THIRD_PARTY_CONTACT_NAME."
    PRIMARY KEY ('THIRD_PARTY_SUPPLIER_NO') 'THIRD_PARTY_SUPPLIER_PK' ENABLE CONSTRAINT);

    CREATE TABLE "UNIT".
    ("UNIT_NO' SMALLINT,
    "UNIT_NAME" VARCHAR (30),
    DECIMAL (7.2) "UNIT_COST"
    PRIMARY KEY ('UNIT_NO') 'UNIT_PK' ENABLE CONSTRAINT);

    CREATE TABLE 'UNIT_OUTCOME '.
    ('UNIT_OUTCOME_CODE' VARCHAR (5),)
    VARCHAR (25) "UNIT_OUTCOME_DESCRIPTION."
    PRIMARY KEY ('UNIT_OUTCOME_CODE') 'UNIT_OUTCOME_PK' ENABLE CONSTRAINT);


    While everything worked fine after that I stuck that in SQL * Plus Command line...

    Published by: Ollie_Marriott on April 12, 2011 07:32

    Ollie_Marriott wrote:
    So ive either an hour past and written some absolute crap, or Ive got it right... (In which case ill out spray glue and begin to glue the hair to my head!)


    DOES STILL MAKE SENSE?

    Without knowing exactly what you are trying to reach and without uttering an ERD to your drawing, it is difficult to say with certainty, but nothing obviously looks weird. I don't know why you are doing this:

    CREATE TABLE "EMPLOYEE_COURSE_UNIT_OUTCOME" (
       "EMPLOYEE_NO" SMALLINT,
       "COURSE_NO" SMALLINT,
       "UNIT_NO" SMALLINT,
       "UNIT_OUTCOME_CODE" VARCHAR(5),
       "EMPLOYEE_UNIT_MARK" SMALLINT,
       CONSTRAINT "EMPLOYEE_UNITOUTCOME_PK"
          PRIMARY KEY ("EMPLOYEE_NO", "COURSE_NO") ENABLE);
    

    Then later proceed as follows:

    ALTER TABLE EMPLOYEE_COURSE_UNIT_OUTCOME DROP PRIMARY KEY;
    
    ALTER TABLE EMPLOYEE_COURSE_UNIT_OUTCOME
       ADD CONSTRAINT EMCrsOut_PK
       PRIMARY KEY (Employee_No, Course_No, Unit_No);
    

    If you want the three columns of the pharmacokinetics, then put the three columns in the create table statement.

    Assuming that your work is actually done on an Oracle database, and then a few other comments. In general, it is not a good idea in Oracle to use (double) city of identifiers. When you create an object by using quoted identifiers, it becomes potentially sensitive case. By default, Oracle stores the object in uppercase letters names in the data dictionary and transform an identifier without quotes uppercase before looking in the data dictionary. Although all identifiers in double quotes appear to be capital letters, a slight typo in your creation scripts could cuase hours of frustration in the future. Take into account:

    SQL> CREATE TABLE "MY_tEST_TAB" (
      2     "ID" NUMBER,
      3     "DESCr" VARCHAR2(10));
    
    Table created.
    
    SQL> desc my_test_tab
    ERROR:
    ORA-04043: object my_test_tab does not exist
    
    SQL> desc "MY_tEST_TAB"
     Name                                      Null?    Type
     ----------------------------------------- -------- ----------------------------
     ID                                                 NUMBER
     DESCr                                              VARCHAR2(10)
    

    compared to

    SQL> drop TABLE "MY_tEST_TAB" purge;
    
    Table dropped.
    
    SQL> CREATE TABLE my_test_tab (
      2     id NUMBER,
      3     descr VARCHAR2(10));
    
    Table created.
    
    SQL> desc my_test_tab
     Name                                      Null?    Type
     ----------------------------------------- -------- ----------------------------
     ID                                                 NUMBER
     DESCR                                              VARCHAR2(10)
    
    SQL> desc MY_tEST_TAB
     Name                                      Null?    Type
     ----------------------------------------- -------- ----------------------------
     ID                                                 NUMBER
     DESCR                                              VARCHAR2(10)
    

    Your data types seem to be that the base SQL Server, that's why I said assuming that Oracle above. In Oracle, the correct data type for a variable-length string is a VARCHAR2, not a varchar. Currently, these are the same, but Oracle has always said that the semantics of varchar may change.

    Smallint is a type of data accepted in Oracle, but it translates into Number (38) in Oracle. Similarly, your definition of decimal (7, 2) is translated to a NUMBER (7.2) in Oracle.

    Of course, if your work is actually in SQL server, then ignore the last half of this and find the SQL Server on MSDN forums :-) Oracle and SQL Server behave very differently, and what works well in Oracle may not in SQL server (and vice versa), so all of the advice you get here for a SQL Server problem may or may not be valid.

    John

  • foreign key mapped to a unique constraint

    OK, here's the question

    create a parent of the table (col1, col2 char char);
    alter table add constraint pk_parent key (col1) parent primary;
    alter table add constraint uk_parent unique(col1,col2) parent;

    Insert into parent values ('A', '7');

    * 1 row created.*

    create the child table (col1, col2 char char);
    ALTER table child add constraint fk_child_parent foreign key(col1,col2) references parent(col1,col2);

    insert into values('B','4') of the child;

    insert into the child values('B','4')
    ***
    ERROR on line 1:
    ORA-02291: integrity constraint (WILDGOD. FK_CHILD_PARENT) violated - parent key
    not found

    That's what I expect... but

    insert into values('B',) of the child;

    * 1 row created.*


    why he let me do, I realize its because col2 is NULL, but it should not yet check for col1 in the parent?

    Please clarify, thanks in advance.

    Documented behavior.

    See here:
    http://download.Oracle.com/docs/CD/E11882_01/AppDev.112/e10471/adfns_constraints.htm#ADFNS273

    -Mark

Maybe you are looking for

  • Satellite A350-12j - recovery the recovery DVDs?

    Hey! Recently, I bought a Toshiba A350 disc. I format the two discs and with a clean sweap of windows vista installation. Now, a few months later, I want to use Toshiba recovery disks that I made the first time, to recover my Toshiba laptop and set i

  • EqualLogic - how to level a new table before you add to the Group

    I have a new table which is v7 and I try to add a group of v8.  It won't join the group due to version incompatibility.  How to pass it to v8 so I can join the Group?  Thank you.

  • Need Activation Code

    I bought a Dell Inspiron N7010 about 4 years ago. I have the Service number and Dell express service code and receipt of Staples.  Dell has information about my purchase in their system. What I don't have is the activation code for the label under th

  • Cannot install mercurial 3.2.3

    Hello I installed the prerequisite python 2.7 I disabled DEP on windows server 2008 I run the installer in compatibility mode. In the application log, I see the message given Log name: ApplicationSource: Application errorDate: 20/02/2015 03:03:38Even

  • Can't seem to get the center of work or even installed solutions.

    I recently bought and installed a printer Phot0smart 5520. Everything has been successfully installed and printer is operational. However, the Solution Center recently stopped working and says a file had yet to be installed. I am sure that the Soluti