What is wrong with my script? (ORA-00984: column not allowed here)

  • CREATE TABLE appuser (

    id number(10) NOT NULL,

    created_by varchar2(10),

    changed_by varchar2(10),

    created_date timestamp,

    changed_date timestamp,

    active char(1),

    comsi varchar2(10)

    );

    INSERT INTO appuser VALUES (1, 'GZM', 'GZM', '2015-09-30 13:13:09.73688', '2015-09-30 13:13:09.73688', true, 'GZM');​

  • vviston (10/1/2015)


    CREATE TABLE appuser (

    id number(10) NOT NULL,

    created_by varchar2(10),

    changed_by varchar2(10),

    created_date timestamp,

    changed_date timestamp,

    active char(1),

    comsi varchar2(10)

    );

    INSERT INTO appuser VALUES (1, 'GZM', 'GZM', '2015-09-30 13:13:09.73688', '2015-09-30 13:13:09.73688', true, 'GZM');?

    That's an Oracle error and this is a SQL Server forum so you might get more help elsewhere. That said, have a look at the link http://www.techonthenet.com/oracle/errors/ora00984.php which might point you in the right direction.


    On two occasions I have been asked, "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" ... I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
    —Charles Babbage, Passages from the Life of a Philosopher

    How to post a question to get the most help http://www.sqlservercentral.com/articles/Best+Practices/61537

  • Not an Oracle guy myself, but I am guessing its something to do with "true" needing to be 'Y' or 'N', guessing Oracle isn't converting true to Y as its a char(1) and not a boolean

  • anthony.green (10/1/2015)


    Not an Oracle guy myself, but I am guessing its something to do with "true" needing to be 'Y' or 'N', guessing Oracle isn't converting true to Y as its a char(1) and not a boolean

    I'd spotted that too. The error message is about using a column name in the wrong place apparently so I wonder if it's seeing true as a column name because it's not 'Y' or 'N'.


    On two occasions I have been asked, "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" ... I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
    —Charles Babbage, Passages from the Life of a Philosopher

    How to post a question to get the most help http://www.sqlservercentral.com/articles/Best+Practices/61537

  • Hi! Thanks for quick response. The boolean value was really the problem. And now the problems are the other columns too. E.g. date format and so on...:)

  • vviston (10/1/2015)


    Hi! Thanks for quick response. The boolean value was really the problem. And now the problems are the other columns too. E.g. date format and so on...:)

    Can't see nothing wrong with the date columns personally, as previously mentioned this is a Microsoft SQL Server site not Oracle, if your having issues with Oracle, might be worth finding an Oracle support site.

  • as i remember it, oracle doesn't auto cast strings to date nicely the way SQL Server does. you have to use the TO_DATE(' '2015-09-30 13:13:09.73688','YYYY-MM-DD HH:MI:SS') i think would work.

    http://www.techonthenet.com/oracle/functions/to_date.php

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply