DB insert problem
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 8 of 8

Thread: DB insert problem

  1. #1
    Join Date
    Oct 2004
    Posts
    8

    DB insert problem

    Hi

    I got a table called S and it looks like this:

    snr varchar2(5)
    sname varchar2(15)
    status number(10)
    city varchar2(15)

    When I try to do this insert:

    insert into S (
    snr, sname, status, city)
    values(
    s1, 'smith', 20, 'London')
    ;

    I get the following error message:

    ERROR at line 4:
    ORA-00984: column not allowed here

    What is wrong? What does this mean?

    Please help me

  2. #2
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    what's s1?
    Jeff Hunter
    marist89@yahoo.com
    http://marist89.blogspot.com/
    Get Firefox!
    "I pledge to stop eating sharks fin soup and will not do so under any circumstances."

  3. #3
    Join Date
    Oct 2004
    Posts
    8
    it is just a value to be inserted into the snr column

  4. #4
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,333
    put quotes round it

    Code:
    SQL> create table s (snr varchar2(5), sname varchar2(10), status number(10), city varchar2(10));
    
    Table created.
    
    SQL> insert into S
    (snr, sname, status, city)
    values
    ('s1', 'smith', 20, 'London');
      2    3    4
    1 row created.
    
    SQL> rollback;
    
    Rollback complete.
    
    SQL> insert into S (
    snr, sname, status, city)
    values(
    s1, 'smith', 20, 'London')
    ;  2    3    4    5
    s1, 'smith', 20, 'London')
    *
    ERROR at line 4:
    ORA-00984: column not allowed here
    Last edited by davey23uk; 10-25-2004 at 11:30 AM.

  5. #5
    Join Date
    Oct 2004
    Posts
    8
    Thanks a lot. Not it's working.

    /Stefan

  6. #6
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    3,999

    Re: DB insert problem

    Originally posted by netchtech

    insert into S (snr, sname, status, city)
    values ('s1', 'smith', 20, 'London');
    Are you saying that this gives you the following error?

    "ERROR at line 4: ORA-00984: column not allowed here"

    this space intentionally left blank

  7. #7
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,333
    i'm guessing he meant "now" its working

  8. #8
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    3,999
    Originally posted by davey23uk
    i'm guessing he meant "now" its working
    Right, I should have guessed that.
    this space intentionally left blank

Posting Permissions

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



Click Here to Expand Forum to Full Width