Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2012
    Posts
    2

    Lightbulb Unanswered: error in insert values oracle sql

    hello
    good evening
    am new user in dbforums
    i have create a table name branch and other table employee

    * the branch table and values work fine in oracle sql
    * the employee table work but the values cant insert into it

    what the problem is ? can someone check it out . Thanks

    CREATE TABLE Branch
    (
    Branch_No numeric(10) not null,
    Location_Branch VARCHAR(20),
    Telephone_Branch VARCHAR(20),
    Address VARCHAR(50),
    CONSTRAINT branchno_pk PRIMARY KEY (Branch_No)

    );

    insert into Branch values (01,'Manama','17442589','H:125,R:125,BH:125');
    insert into Branch values (02,'Muharraq','17784125','H:1588,R:1475,BH:1447') ;
    insert into Branch values (03,'Sitra','1778963','H:4789,R:147,BH:12');
    insert into Branch values (04,'Isa Town','17552519','H:125,R:125,BH:125');

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

    CREATE TABLE Employee
    (
    Emp_ID number(10) constraint empid_pk PRIMARY KEY NOT NULL,
    Branch_No numeric(10) not null,
    CONSTRAINT fk_branchno
    FOREIGN KEY (Branch_No)
    REFERENCES Branch(Branch_No),
    Emp_Name VARCHAR(50),
    Emp_Adress VARCHAR(50),
    Emp_Phone VARCHAR(20),
    Emp_NationalID VARCHAR(20),
    Emp_Salary int,
    Emp_Vacition INT

    );


    insert into Employee ( 011 , 01 , ' Hani ' , ' Manama 123 St Bab Bahrain' , ' 1772345' , 'Bahraini' , 1400 , 234 );
    insert into Employee ( 012 , 02 , ' Mohammed ' , 'Muhrraq ' , '1234556' , 'Bahraini' , 500 , 222);
    insert into Employee ( 013 , 03 , ' Ali ' , ' Muharraq' , '13444565; , 'Bahraini' , 700 , 333 );
    insert into Employee ( 014 ,04 , ' Salman ' , 'Isa town ' , '1456345' , 'Bahraini' , 800 , 444);

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    INSERT INTO EMPLOYEE statements are missing the VALUES keyword.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Dec 2012
    Posts
    2
    thanks alot brother

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •