How can I insert two row to supplier table?

CREATE TABLE supplier (
    supplier_nr NUMBER(10),

    supplier_id VARCHAR2(20) NOT NULL,

    price   NUMBER(10) NOT NULL,

    CONSTRAINT supplier_supplier_nr_pk PRIMARY KEY(supplier_nr),
    CONSTRAINT supplier_supplier_id_fk FOREIGEN KEY(supplier_id)
        REFERENCES varugrupp(supplier_id)
);
Re: oracle primary key and foreign key within same table 80 80

Insert the rows with a unique supplier_nr for each row and an existing supplier_id.

Re: oracle primary key and foreign key within same table 80 80

Can you give me one example please!

Re: oracle primary key and foreign key within same table 80 80
INSERT INTO supplier VALUES (1, 'ID', 10)

The values shown above depend on what is already in your tables, so you may need to change those. For example 'ID' needs to be in the varugrupp table.

Re: oracle primary key and foreign key within same table 80 80

THANKS SIR

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.