1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Problem with simple table

Discussion in 'General' started by adammint7, Oct 7, 2010.

  1. adammint7

    adammint7 Active Member

    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    55
    Hi guys,

    I am a very new sql developer and i keep coming up with problems, i have looked around on this fourm and the quality of the posts are outstanding so i thought, ill ask these guys if they can help me out :)

    anyway

    i am trying to create my table

    drop table emp33;
    create table emp33 (
    empno number (5),
    ename varchar2 (10),
    ejob varchar2 (10),
    mgr number (5),
    hiredate varchar2 (15),
    sal number (5),
    comm number (5),
    deptno number (3));

    insert into emp33 values (7369,"smith","clerk",7902,"17-dec-80",800,null,20);
    insert into emp33 values (7499,"allen","salesman",7698,"20-feb-81",1600,800,30);
    insert into emp33 values (7521,"ward","salesman",7698,"22-feb-81",1250,500,30);
    insert into emp33 values (7566,"jones","manager",7839,"02-apr-81",2975,null,20);
    insert into emp33 values (7654,"martin","salesman",7698,"28-sep-81",1250,1400,30);
    insert into emp33 values (7698,"blake","manager",7839,"01-may-81",2975,null,30);
    insert into emp33 values (7782,"clark","manager",7839,"09-jun-81",2450,null,10);
    insert into emp33 values (7788,"scott","analyst",7566,"19-apr-87",3000,2000,20);
    insert into emp33 values (7839,"king","president",null,"17-nov-81",5000,null,10);
    insert into emp33 values (7844,"turner","salesman",7698,"08-sep-81",1500,0,30);
    insert into emp33 values (7876,"adams","clerk",7788,"23-may-87",1100,null,20);
    insert into emp33 values (7900,"james","clerk",7698,"03-dec-81",950,null,30);
    insert into emp33 values (7902,"ford","analyst",7566,"03-dec-81",3000,2000,20);
    insert into emp33 values (7934,"miller","clerk",7782,"23-jan-82",1300,null,10);


    and all i keep getting is this error for each of my insert lines

    Error starting at line 12 in command:
    insert into emp33 values (7369,"smith","clerk",7902,"17-dec-80",800,null,20)
    Error at Command Line:12 Column:52
    Error report:
    SQL Error: ORA-00984: column not allowed here
    00984. 00000 - "column not allowed here"
    *Cause:
    *Action:


    if any of you guys could help me out it would be amazing :)
     
  2. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,347
    Likes Received:
    348
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    Oracle uses single quotes around string values, not double quotes (like MySQL). Change your " to ' in your VALUES statements.
     
  3. adammint7

    adammint7 Active Member

    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    55
    Ahh right. i cant believe i missed that :(...i must be still in the java mindset.

    thanks zargon
     
  4. Puru

    Puru Forum Advisor

    Messages:
    32
    Likes Received:
    1
    Trophy Points:
    90
    Use single quote to insert alphanumeric values / varchar values. Example
    insert into emp33 values (7369,'smith','clerk',7902,'17-dec-80',800,null,20);
     
    Sadik likes this.
  5. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,347
    Likes Received:
    348
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    I thought I'd said that same thing yesterday ...