Deleted primary key seems to work!

Hello

I dropped the primary key on a table T1 using...
ALTER TABLE DROP CONSTRAINT PK_T1; 
And, when I try to insert a new row with the same value in the column, Oracle said...
Unique key violated. T1.PK_T! 
Can someone tell me why this phenomenon occurs?

Thank you.

Can you please delete the primary key by using

Select constraint_name, table_name from User_Constraints where constraint_nanme = 'PK_T1 ';

Also check if there is any index build on the column primary key from USER_IND_COLUNMS.

Concerning

Tags: Database

Similar Questions

  • MySQL Insert with autoincremented primary key

    I did not before MySQL.  I try and hit a roadblock soon enough.

    I would like to insert new records and have the auto-generated primary key / auto-increment.

    So, I have attached a few screenshots.  The first is a screenshot of the MySQL settings for the table that I'm writing.  The second is the Labview code that I threw as well as I am trying to run.

    The complete of the error I get is:

    > Database Connection.viADO error: 0x80004005
    Exception occurred in the Microsoft OLE DB provider for ODBC drivers: [MySQL] [ODBC 3.51 Driver] [mysqld - 5.7.11 - log] field 'techniciansID' didn't is not a default value to create a NI_Database_API.lvlib:Rec - Command.vi-> NI_Database_API.lvlib:Cmd Execute.vi-> NI_Database_API.lvlibData.vi B tools insert-> Connection.vi in the database

    I know that this error indicates that the techniciansID has no default value and he won't write because of it... but since it is an AutoIncrement field, it seems like it should work.

    Any help would be appreciated.  Thank you

    Thad

    Setting to 0 did not work, but I understand it.  For some reason any when I was refreshing my tables in MySQL server and using the "Forward Engineer" feature, the changes were not multiplication.  I had to drop the schema of the database (attached image) and then do an "engineer forward."  I made the changes, but the tables and the columns still had the attributes of origin... guess they cannot be updated by the script during execution.

    After doing this and the original settings I had (autoincremented primary key), the insert works in MySQL and Labview.

    Thanks for all the answers.  They made me think and check some things I didn't have before.

    -Thad

  • Field of amount but the MAX primary key

    Hello

    Is it possible to summarize a table and display the maximum value of the primary key?  The works of sum(), but I still would like to show one of the primary keys.  The maximum primary key would be great show records that were actually summed.

    CREATE TABLE TBL_EMP

    (

    NUMBER OF PK_EMP

    SITE_ID NUMBER,

    NUMBER OF FUNDS

    )

    -5 RECORDS

    INSERT INTO TBL_EMP VALUES (1, 500,10);

    INSERT INTO TBL_EMP VALUES (2, 550,20);

    INSERT INTO TBL_EMP VALUES (3, 600,30);

    INSERT INTO TBL_EMP VALUES (4, 650,40);

    INSERT INTO TBL_EMP VALUES (5, 650,50);

    SELECT PK_EMP,
    SITE_ID,
    FUND
    OF TBL_EMP

    ORDER BY SITE_ID

    -Results

    PK_EMPSITE_IDFUND
    150010
    255020
    360030
    465040
    5650

    50

    SELECT - PK_EMP,.
    SITE_ID,
    SUM (FUND) AS FUND
    OF TBL_EMP
    SITE_ID GROUP

    ORDER BY SITE_ID

    -Results

    SITE_IDFUND
    50010
    55020
    60030
    650

    90

    -If possible show the Max primary key

    PK_EMPSITE_IDFUND
    150010
    255020
    360030
    565090

    Hello

    Nikki wrote:

    Hello

    Is it possible to summarize a table and display the maximum value of the primary key?  The works of sum(), but I still would like to show one of the primary keys.  The maximum primary key would be great show records that were actually summed.

    CREATE TABLE TBL_EMP

    (

    NUMBER OF PK_EMP

    SITE_ID NUMBER,

    NUMBER OF FUNDS

    )

    -5 RECORDS

    INSERT INTO TBL_EMP VALUES (1, 500,10);

    INSERT INTO TBL_EMP VALUES (2, 550,20);

    INSERT INTO TBL_EMP VALUES (3, 600,30);

    INSERT INTO TBL_EMP VALUES (4, 650,40);

    INSERT INTO TBL_EMP VALUES (5, 650,50);

    SELECT PK_EMP,
          SITE_ID,
          FUND
    OF TBL_EMP

    ORDER BY SITE_ID

    -Results

    PK_EMP SITE_ID FUND
    1 500 10
    2 550 20
    3 600 30
    4 650 40
    5 650

    50

    SELECT - PK_EMP,.
          SITE_ID,
          SUM (FUND) AS FUND
    OF TBL_EMP
    SITE_ID GROUP

    ORDER BY SITE_ID

    -Results

    SITE_ID FUND
    500 10
    550 20
    600 30
    650

    90

    -If possible show the Max primary key

    PK_EMP SITE_ID FUND
    1 500 10
    2 550 20
    3 600 30
    5 650 90

    Use the aggregate function MAX, in the same way that you already use the SUM aggregate function:

    SELECT MAX (PK_EMP) AS max_pk_emp,

    SITE_ID,

    SUM (FUND) AS total_fund

    OF TBL_EMP

    SITE_ID GROUP

    ORDER BY SITE_ID

    ;

  • Primary key cause problem in the meantime Partition Exchange

    DB: 11.2.0.2
    OPERATING SYSTEM: AIX 6.1

    I get the problem when exchanging data with range partitioned table. I have a partitioned table of interval and a regular intermediate table with data to be uploaded.
    Here are the steps that I did.
    SQL> CREATE TABLE DEMO_INTERVAL_DATA_LOAD (
                    ROLL_NUM        NUMBER(10),
                    CLASS_ID        NUMBER(2),
                    ADMISSION_DATE  DATE,
                    TOTAL_FEE       NUMBER(4),
                    COURSE_ID       NUMBER(4))
                    PARTITION BY RANGE (ADMISSION_DATE)
                    INTERVAL (NUMTOYMINTERVAL(3,'MONTH'))
                    ( PARTITION QUAT_1_2012 VALUES LESS THAN (TO_DATE('01-APR-2012','DD-MON-YYYY')),
                     PARTITION QUAT_2_2012 VALUES LESS THAN (TO_DATE('01-JUL-2012','DD-MON-YYYY')),
                     PARTITION QUAT_3_2012 VALUES LESS THAN (TO_DATE('01-OCT-2012','DD-MON-YYYY')),
                     PARTITION QUAT_4_2012 VALUES LESS THAN (TO_DATE('01-JAN-2013','DD-MON-YYYY')));
    
    Table created.
    
    SQL> ALTER TABLE DEMO_INTERVAL_DATA_LOAD ADD CONSTRAINT IDX_DEMO_ROLL PRIMARY KEY (ROLL_NUM);
    
    Table altered.
    
    SQL> SELECT TABLE_OWNER,
               TABLE_NAME,
               COMPOSITE,
               PARTITION_NAME,
           PARTITION_POSITION,
              TABLESPACE_NAME,
           LAST_ANALYZED
    FROM DBA_TAB_PARTITIONS
        WHERE TABLE_OWNER='SCOTT'
       AND TABLE_NAME='DEMO_INTERVAL_DATA_LOAD'
       ORDER BY PARTITION_POSITION;
    
    TABLE_OWNER                    TABLE_NAME                     COM PARTITION_NAME                 PARTITION_POSITION TABLESPACE_NAME                LAST_ANAL
    ------------------------------ ------------------------------ --- ------------------------------ ------------------ ------------------------------ ---------
    SCOTT                          DEMO_INTERVAL_DATA_LOAD        NO  QUAT_1_2012                                     1 USERS
    SCOTT                          DEMO_INTERVAL_DATA_LOAD        NO  QUAT_2_2012                                     2 USERS
    SCOTT                          DEMO_INTERVAL_DATA_LOAD        NO  QUAT_3_2012                                     3 USERS
    SCOTT                          DEMO_INTERVAL_DATA_LOAD        NO  QUAT_4_2012                                     4 USERS
    
    SQL> INSERT INTO DEMO_INTERVAL_DATA_LOAD VALUES (10,1,'12-MAR-2012',1000,90);
    
    1 row created.
    
    SQL> INSERT INTO DEMO_INTERVAL_DATA_LOAD VALUES (11,5,'01-JUN-2012',5000,80);
    
    1 row created.
    
    SQL> INSERT INTO DEMO_INTERVAL_DATA_LOAD VALUES (12,9,'12-SEP-2012',4000,20);
    
    1 row created.
    
    SQL> INSERT INTO DEMO_INTERVAL_DATA_LOAD VALUES (13,7,'29-DEC-2012',7000,10);
    
    1 row created.
    
    SQL> INSERT INTO DEMO_INTERVAL_DATA_LOAD VALUES (14,8,'21-JAN-2013',2000,50); ---- This row will create a new interval partition in table.
    
    1 row created.
    
    SQL> commit;
    
    SQL> SELECT TABLE_OWNER,
            TABLE_NAME,
            COMPOSITE,
            PARTITION_NAME,
            PARTITION_POSITION,
            TABLESPACE_NAME,
            LAST_ANALYZED
      FROM DBA_TAB_PARTITIONS
         WHERE TABLE_OWNER='SCOTT'
       AND TABLE_NAME='DEMO_INTERVAL_DATA_LOAD'
       ORDER BY PARTITION_POSITION;
    
    TABLE_OWNER                    TABLE_NAME                     COM PARTITION_NAME                 PARTITION_POSITION TABLESPACE_NAME                LAST_ANAL
    ------------------------------ ------------------------------ --- ------------------------------ ------------------ ------------------------------ ---------
    SCOTT                          DEMO_INTERVAL_DATA_LOAD        NO  QUAT_1_2012                                     1 USERS
    SCOTT                          DEMO_INTERVAL_DATA_LOAD        NO  QUAT_2_2012                                     2 USERS
    SCOTT                          DEMO_INTERVAL_DATA_LOAD        NO  QUAT_3_2012                                     3 USERS
    SCOTT                          DEMO_INTERVAL_DATA_LOAD        NO  QUAT_4_2012                                     4 USERS
    SCOTT                          DEMO_INTERVAL_DATA_LOAD        NO  SYS_P98                                         5 USERS   
    
    SYS_P98 partition is added to table automatically.
    
    SQL> CREATE TABLE DEMO_INTERVAL_DATA_LOAD_Y (
                    ROLL_NUM        NUMBER(10),
                    CLASS_ID        NUMBER(2),
                    ADMISSION_DATE  DATE,
                    TOTAL_FEE       NUMBER(4),
                    COURSE_ID       NUMBER(4)); 
    
    Table created.
    
    SQL> INSERT INTO DEMO_INTERVAL_DATA_LOAD_Y VALUES (30,3,'21-MAY-2013',2000,12);
    
    1 row created.
    
    SQL> commit;
    
    Commit complete.
    
    
    Since, i need a partition in DEMO_INTERVAL_DATA_LOAD table, which can be used in partition exchange, so i create a new partition as below:
    
    
    SQL> LOCK TABLE DEMO_INTERVAL_DATA_LOAD PARTITION FOR (TO_DATE('01-APR-2013','DD-MON-YYYY')) IN SHARE MODE;
    
    Table(s) Locked.
    
    SQL> SELECT TABLE_OWNER,
               TABLE_NAME,
               COMPOSITE,
               PARTITION_NAME,
               PARTITION_POSITION,
               TABLESPACE_NAME,
               LAST_ANALYZED
    FROM DBA_TAB_PARTITIONS
        WHERE TABLE_OWNER='SCOTT'
       AND TABLE_NAME='DEMO_INTERVAL_DATA_LOAD'
       ORDER BY PARTITION_POSITION;
    
    TABLE_OWNER                    TABLE_NAME                     COM PARTITION_NAME                 PARTITION_POSITION TABLESPACE_NAME                LAST_ANAL
    ------------------------------ ------------------------------ --- ------------------------------ ------------------ ------------------------------ ---------
    SCOTT                          DEMO_INTERVAL_DATA_LOAD        NO  QUAT_1_2012                                     1 USERS
    SCOTT                          DEMO_INTERVAL_DATA_LOAD        NO  QUAT_2_2012                                     2 USERS
    SCOTT                          DEMO_INTERVAL_DATA_LOAD        NO  QUAT_3_2012                                     3 USERS
    SCOTT                          DEMO_INTERVAL_DATA_LOAD        NO  QUAT_4_2012                                     4 USERS
    SCOTT                          DEMO_INTERVAL_DATA_LOAD        NO  SYS_P98                                         5 USERS
    SCOTT                          DEMO_INTERVAL_DATA_LOAD        NO  SYS_P102                                        6 USERS
    
    SQL> ALTER TABLE DEMO_INTERVAL_DATA_LOAD
    EXCHANGE PARTITION SYS_P102
    WITH TABLE DEMO_INTERVAL_DATA_LOAD_Y
    INCLUDING INDEXES
    WITH VALIDATION;
    ALTER TABLE DEMO_INTERVAL_DATA_LOAD
    *
    ERROR at line 1:
    ORA-14097: column type or size mismatch in ALTER TABLE EXCHANGE PARTITION
    Now, if I turn off and drop the primary key constraint, it works without any problem.
    SQL> alter table DEMO_INTERVAL_DATA_LOAD disable constraint IDX_DEMO_ROLL;
    
    Table altered.
    
    SQL> alter table DEMO_INTERVAL_DATA_LOAD drop constraint IDX_DEMO_ROLL;
    
    Table altered.
    
    SQL> ALTER TABLE DEMO_INTERVAL_DATA_LOAD
    EXCHANGE PARTITION SYS_P102
    WITH TABLE DEMO_INTERVAL_DATA_LOAD_Y
    INCLUDING INDEXES
    WITH VALIDATION; 
    
    Table altered.
    
    SQL> select * from DEMO_INTERVAL_DATA_LOAD partition (SYS_P102);
    
      ROLL_NUM   CLASS_ID ADMISSION  TOTAL_FEE  COURSE_ID
    ---------- ---------- --------- ---------- ----------
            30          3 21-MAY-13       2000         12
    
    SQL> select * from DEMO_INTERVAL_DATA_LOAD_Y;
    
    no rows selected
    Please suggest.

    First of all, thanks for posting the code that allows us to reproduce your test. It is essential for such problems.

    Because the primary key is global you will not be able to use

    INCLUDING INDEXES
    WITH VALIDATION;
    

    And you need to add the primary key to the temporary table

     ALTER TABLE DEMO_INTERVAL_DATA_LOAD_Y ADD CONSTRAINT IDX_DEMO_ROLL_Y PRIMARY KEY (ROLL_NUM);
    

    The Exchange will work. You must rebuild the primary key after the Exchange.

  • cursor/keyboard keys do not work

    I have a new laptop of Dell M4400 with an installation of KUbuntu 8.10.  I know that there is no current support for this new facility, but everything seemed to work with the guest of RedHat EL3 OS that I just installed.  However, I can't use the slider or the Home/end keys /... keyboard in the VMWare environment.  The blue Fn key and 8, 4, 6, 2 associated keys seem to work the cursor but it's a bit annoying to use.

    Any help would be greatly appreciated.

    Many people have the same problem... it's amazing the way the VMware team does not take account of the Linux community.

    Read this:

    http://www.davidmarkley.com/VMware/Ubuntu-810-and-VMware-Workstation-65

    and this:

    http://www.VMware.com/support/reference/Linux/keyboard_linux.html

    Use and will be master!

  • request for deletion with a composite primary key

    I have the following problem, which seems very simple, but I'm a bit at a loss :)

    I have a table T1 with composite primary key F1 and F2.

    There is a second table I want to use to delete records of T1 T2. It contains als F1 and F2.

    I want to do something like this
    delete from T1
    where T1.F1, T1.F2 in (select T2.F1, T2.F2 from T2);
    Of course, this does not work.

    There are solutions, but I find them unsatisfactory:
    -A loop of PL/SQL and passes the key one
    -Concatenate F1 and F2: where T1. F1 | T1. F2 to (select T2. F1 | W2M T2 F2); - but it's very ugly.

    Surely it must be possible in a simple SQL statement...

    Thank you!

    Rob
    delete from T1
    where (F1,F2) in (select T2.F1, T2.F2 from T2);
    

    Max
    [My Italian blog Oracle | http://oracleitalia.wordpress.com/2010/01/17/supporto-di-xml-schema-in-oracle-xmldb/]

  • I use v20.0.2 and restart using the same windows and tabs does NOT work. I deleted the profile and restarted, etc, but nothing seems to work. What now?

    Don't know what else I can give you here. This particular software function doesn't seem to work.

    In case you use "clear history of Firefox closing:

    • do not erase browsing history

    Note that compensation "Preferences of Site" clears all exceptions for cookies, images, windows pop up, installation of software and passwords.

    You can check for problems with the sessionstore.js and sessionstore.bak files in the profile folder of Firefox that store session data.

    Delete the sessionstore.js file possible sessionstore-# .js files with a number and sessionstore.bak in the Firefox profile folder.

    Delete sessionstore.js will cause App Tabs and groups of tabs open and closed tabs (back) to get lost and you will have to re-create them (take note or bookmarks).

    If you use a software like CCleaner cleaning then check the settings in the Firefox application.

  • I'm used to be able to refresh a page by pressing the F5 key. Which doesn't seem to work. Y at - it a keyboard shortcut for editing, or I can create a?

    I'm used to be able to refresh a page by pressing the F5 key. With 4.0.1 which doesn't seem to work. Y at - it a different keyboard shortcut, or I can create a?

    Try CTRL + R

  • [ADF, JDev12.1.3] Mastering the form with detail tables: questions about Insertion/deletion, commit / rollback, primary key, handling,...

    Hallo,

    I have a panelTabbed with 4 tabs. In the 1st tab, there is a master form while each of the other tabs, there is a secondary table. Each tab "reads" vo.

    Please see here http://digilander.libero.it/flattit82/OTN_FILES/VoInTabs.png

    I created the graphichs/layout and now it's time to take care of the management of the transaction.

    In the master tab / form

    1)

    Here, I would put a button to remove the master record.

    When I delete a record in the primary table an automatism in the database (MS SQL Server) will automatically delete any registration which are linked to it in the detail tables.

    Could the automated system as this causes problems?

    In the Details tabs / tables

    2)

    I would put a button in each row to delete the line delivering. Can I just drag-and - drop, like button, af line: table the operation "Delete" of the VO istance detail used to create the af: table?

    3)

    If Yes, by clicking on the button performs the default delete operation. But if need to perform some actions before you run the deletion (or, in General, any other operation), how can I do?

    4)

    To create a folder that I use Create or CreateInsert? And what are the differences between them?

    5)

    When I create a new record I need set the value of a field of the VO on which is based the af: table. He filed, let's call it RowDetNumber, is not displayed in the af: table, because it doesn't have be filled in by the user. Mut value is calculated and set "secretly" before posting the new line to the database table. In particular, its value must be calculated as

    Select max (RowDetNumber) + 1

    of table_on_which_VO_is_based

    where some_conditions_on_fields_of_the_same_VO


    For example

    The VO selects all of the records that have FkId =: value. If value = 3, VO selection records:

    ID RowDetNumber OtherFields FkId

    1   3     1             ...

    2   3     2             ...

    3   3     3             ...

    4   3     4             ...

    The new record must be RowDetNumber = 5.

    I would like to know how permorm this.

    In general

    6)

    If the database tables have 1 or more triggers I have to take care of something?

    7)

    On the book "development of Web Applications with Oracle ADF Essentials - Sten E. Vesterli", I have read it could be problems when you use tables of database non-Oracle with auto-increment fields.

    The advice of author uncheck the 'Required' box in the model.

    All tables in my database have a primary keys that are auto-increment... so I uncheck the "mandatory"?

    8)

    In general how do I set these fields? I have to put in OT, VO or both?

    Thank you

    Federico

    Hello

    (1) you will need to re - question child iterators so that they do not look stale data

    (2) Yes. Ensure that the table is PPRed after deleting the line (should happen automatically if ChangeEventPolicy on iterator is set to ppr)

    (3) double click on the button and it creates a bean managed for you. It allows you to check a box to generate the code he would run to remove the line. Everything you put in front of the generated code is your code before

    (4) in the case of tables, use createInsert as it adds the new line to the rowset (transaction)

    (5) suggest to do this use a database trigger and the data attribute value DBSequence VO type

    (6) do not 'drop table' issue in SQL (sorry, couldn't resist ;-))

    (7) If you follow the advice of the author, Yes. What it does, I have it does not throw an exception if a value is missing in the validation of the line

    (8) usually you set whatever it is at the level of the OS and put only things on VO if you want to override the default value for a specific behavior


    Frank

  • How will I know that my Windows product key is if one on the sticker that is located on the computer does not seem to work?

    You want more details. For two hours I answered all the questions that ask you that. And still no support. You up to the date of this laptop, every day at 03:00, so don't tell me the product key, which is on the back of this box is incorrect. Or that it is not the country I say. Just send me what is on the back of this box, which I paid too much for in the first place.

    We are not Microsoft. We are volunteers who give of our spare time to help people. Complain about Microsoft is a waste of time. We are in the same boat as you when it comes to most of the problems and not more control or access that you have to do.

    A product key is not in the box where everyone can see.  It is a sequence of alphanumeric 25 digit of 5 sets of 5 digits separated by dashes for the operating system.  If this is the original installation, the key will be on a label on the underside of the laptop.  It has been upgraded or purchased as a product of the retail (suggested by saying you that you have a box), then the product key for the product to the retail sales would have been on a piece of paper inside the box.  The product key on the label of the laptop would have been crushed (which would have been in the computer would have been product key from the manufacturer that could not be used to enable or provide proof) by installing the retail or upgrade.  Microsoft has no idea what is your product key regardless of the case - even if you bought them (unless it was by a download and then you should have an email from their share with the product key to this topic).

    If this is not a problem of activation or re-installing and that you have installed and activated the product yourself, try of Belarc Advisor http://www.belarc.com/free_download.html and see if the product key, it reveals work best of all what you use now.

    For more information, if it does not help, post to http://answers.microsoft.com/en-us/windows/forum/windows_install?page=1&tab=all&tm=1300700638376.

    Good luck!

  • How to delete several lines in the details Table with PRIMARY KEY = ("VID", "LINEITEM")?

    Mr President

    My worm Jdev is 12.2.1.

    I have master tables / details.

    I have 2 lines for each PRIMARY KEY = ("VID", "LINEITEM") as below in the Details table.

    delete.png

    Please help how to get a button on a jsf page to remove these two lines at a time.

    Concerning

    So, in your app (data model) module, you have a master relationship / typical retail:

    And the relationship between them is based on some ViewLink

    Now go to the ViewLink, relationship, accessor.

    Take a look at the Destination accessor.

    Generate accessor object to check and give a name Acessor

    Then go to the master VO, Java and Include accessor, the class generate a display line:

    Go to the class view Java generated line, you'll find a method with the name of the accessor of the previous step, in the form of:

    public RowIterator getYourDetails...or_whaterever_IsAccessorName..() {
    }
    

    Now, in the same Java class, write the following Java method:

    public void removeDetails(){
      RowIterator details = getYourDetails...or_whaterever_IsAccessorName..(); // it is RowIterator over all details
      Row r = details.first();
      while (r != null) {
          r.remove();
          r = details.next();
      }
    }
    

    This method on the Cilent export line Interface:

    Finally, pass the data controls and drop this operation on the form as a button...

  • How to select multiple items in the Panel of DOM? I tried to use the SHIFT key, but it doesn't seem to work.

    I need help, select several items in my Panel of DOM, for some reason, using the SHIFT key does not work.

    I found the answer, apparently everything I had to do has been updated to the latest version of dreamweaver cc 2015.2. The Shift function is something new added in the update.

  • Trigger - use one to create primary key values

    I'm stuck on a simple use to do a TRIGGER that fires when you add new rows to a table and want to Developer SQL to add the primary key value.

    I seem to be able to relax, but it is not inserted the primary key but giving a SQL error: ORA-00947: not enough values.

    Here's what I have.

    CREATE TABLE HF_fishers

    (

    contact_id INT NOT NULL

    , name VARCHAR (25)

    , last_name VARCHAR (35)

    PRIMARY KEY (contact_id)

    );

    CREATE SEQUENCES HF_fishers_seq.

    Then I ran the following trigger:

    CREATE

    HF_fishers_seq_trigger RELAXATION

    BEFORE INSERTING

    ON HF_fishers

    FOR EACH LINE

    BEGIN

    IF (: new.contact_id IS NULL)

    THEN

    : NEW.contact_id: = NVL (: NEW.contact_id)

    HF_fishers_seq. NEXTVAL

    );

    END IF;

    END HF_fishers_seq_trigger;

    =============

    Then I executed the following SQL statement that gives the error.

    INSERT INTO HF_fishers VALUES('Jacob','Muller');

    But if I do everything is good except that it defeats the purpose of relaxation.

    INSERT INTO HF_fishers VALUES(1,'Jacob','Muller');

    MySQL has a nice 'AUTO_INCREMENT' command, but from what I understand in Oracle, I need to set up a trigger to automatically increment a column/cell, which in this case I use for the PRIMARY KEY.

    3003916 wrote:

    OK Jaramillo, I tried as you wrote, but what would be an INSERT statement correct?

    -After the code trigger of Jaramillo

    INSERT INTO HF_fishers (first_name, last_name) values ("Jesse", "Owens"); -I have the trigger but he made the mistake of duplicate key.

    INSERT INTO HF_fishers values (hf_fishers_seq.nextval, 'Jesse', "Owens");  -No trigger but get key duplicated,.

    INSERT INTO HF_fishers VALUES(:NEW_contact_id,'Jesse','Ownes'); -works without the trigger but the "get links" dialog box appears. So not much 'automatic' on this issue,.

    My mistake.  Here is the modified version of the trigger. I removed the CONDITIONAL clause and comes to be a part of the body of the trigger.

    So, I created the table, the sequence, the relaxation and ran the first two insert statements and it worked fine.  The third one you have invites SQL + or any tool you use to enter a value if she sees the ":" colon as a variable binding.  Colon only works in a trigger without asking for confirmation.

    Here is the code and my exit I ran home

    DROP TABLE hf_fishers CASCADE CONSTRAINTS PURGE;
    DROP SEQUENCE hf_fishers_seq;
    
    CREATE TABLE hf_fishers
    (
    contact_id   INTEGER NOT NULL
    ,first_name   VARCHAR(25)
    ,last_name    VARCHAR(35)
    ,PRIMARY KEY (contact_id)
    );
    
    CREATE SEQUENCE hf_fishers_seq;
    
    CREATE OR REPLACE TRIGGER hf_fishers_seq_trigger
       BEFORE INSERT
       ON hf_fishers
       FOR EACH ROW
    BEGIN
    
       IF(:NEW.contact_id IS NULL) THEN
          :NEW.contact_id := hf_fishers_seq.NEXTVAL;
       END IF;
    
    END hf_fishers_seq_trigger;
    
    INSERT INTO hf_fishers(first_name, last_name)
         VALUES ('Jesse', 'Owens');  -- Works with the trigger
    
    INSERT INTO hf_fishers
         VALUES (hf_fishers_seq.nextval, 'Jesse', 'Owens');  --Works without using the trigger body code.
    
    SELECT *
      FROM hf_fishers;
    
    COMMIT;
    

    The output

    Deleted table.

    Elapsed time: 00:00:00.05

    Sequence has fallen.

    Elapsed time: 00:00:00.02

    Table created.

    Elapsed time: 00:00:00.03

    Order of creation.

    Elapsed time: 00:00:00.02

    Trigger created.

    Elapsed time: 00:00:01.05

    1 line of creation.

    Elapsed time: 00:00:00.04

    1 line of creation.

    Elapsed time: 00:00:00.01

    CONTACT_ID FIRST NAME LAST NAME

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

    1 Jesse Owens

    2 Jesse Owens

    2 selected lines.

    Elapsed time: 00:00:00.04

    Validation complete.

    Elapsed time: 00:00:00.01

  • primary-key foreign force error

    Hello
    I have a form based on a table T1. When I save this form or update this form it will be insert/update record into T1. At the same time, when I update/create a folder, I need to insert a new record into a table T2. I created a package to do this, and it gets called after submit process
    IF: REQUEST ('SAVE', 'CREATE'), THEN
    Call my package.procedure (p1, p2, p3);
    END IF;
    I get an error and I don't know why. The record in the main table T1 is not created, but he's trying to create a record in the secondary table. Because of the primary-key foreign force I get the error message.
    How can I fix? Should I create my own record / update / delete button?

    Thank you

    Hello:

    APEX can certainly do. The automatic DML process wasn't because you got the P3_STATUS page-item defined with a Source Type of "Column of the database" and "wrkordr_id" provided as it corresponds to the database column.
    The update seems to work now.

    CITY

  • NB200-12N - FN keys do not work

    Hello
    I recently bought a Toshiba NB200-12N with windows 7 starter edition. Then, I upgraded the operating system to 7 Professional. Since then, flash cards have stopped working with the function key. I've done everything I can think et al. proposed that he used to always work.
    I found the settings and the value to use with the mouse - what works now, but the Fn key doesn't seem to work. It does however work with the num lock and scroll lock keys.
    I updated the BIOS, uninstalled and reinstalled flash card utility and value pack, downloaded the last of the toshiba site and still no joy.

    Can anyone help with this. Its very frustrating and help would be very appreciated.
    Thank you.
    W.

    Hello

    I doubt that reinstall Flash Cards Support Utility and value added package couldn t help you. I had the same problem and after reinstallation of these two tools, it started working again.

    First, you must remove value-added Package and Flash Cards Support utility. After that, restart your computer and clean Windows with CCleaner. It is a freeware tool that allows you to clean the registry and delete the key from there. After that do a reboot again and now install package of added value, then Flash Cards Support utility. A restart more and your FN keys should start working again. :)

    Check this box!

Maybe you are looking for