COMMAND NOT PROPERLY ENDED ORA00993:SQL

Hi am having this error in this query

SELECT EMPNAME,EMPNO FROM EMPLOYEE
ORDER BY EMPNAME,EMPNO
UNION
SELECT EMPNAME,EMPNO FROM EMPLOYEE
ORDER BY EMPNAME,EMPNO

but when I delete order by is ok

get rid of the table alias in your order by...

order of unit_cde_frm, dept_cde_frm, wrk_req_no

Tags: Database

Similar Questions

  • Problems crossing timestamp variable block-SQL command not properly ended

    Can you please help me answer or direct me to resources to answer the following.

    I'm trying to pass a timestamp of a block variable but me make mistakes with all the methods I've tried yet.

    The following example tries to generate a list of all the dates of sales for orders after March 21, 2000.

    DECLARE
    BeginDate Orders.PurchaseDate%TYPE: = to_date (March 21, 2000 "," dd-mm-yyyy "");
    Target Orders.PurchaseDate%TYPE;

    BEGIN
    DBMS_OUTPUT. Put_line(to_char (BeginDate));
    SELECT PurchaseDate from separate orders to target WHERE PurchaseDate > BeginDate;
    END;

    When you run it - it returns
    ORA-00933: command not properly ended SQL ORA-06512: line 8
    please notify

    Hello

    I guess you miss a semicolon as a variable binding for the USING keyword.

    BEGIN
     DBMS_OUTPUT.PUT_LINE(to_char(BeginDate,'DD.MM.YYYY'));
     sql1 = 'SELECT MAX(PurchaseDate) INTO Target from Orders WHERE PurchaseDate> :var_date';
     Execute Immediate sql1 Using BeginDate;
     DBMS_OUTPUT.PUT_LINE(to_char(Target,'DD.MM.YYYY'));
    END;
    

    You can also check out the links below:
    http://download.Oracle.com/docs/CD/B10500_01/AppDev.920/a96624/11_dynam.htm#13131
    http://download.Oracle.com/docs/CD/B19306_01/AppDev.102/b14261/executeimmediate_statement.htm

    HTH,
    Thierry

  • Error: Command not properly ended SQL...

    The code someone tell me what I am doing wrong in this code? It is said that a SQL command not properly ended...

    Thank you

    Tom


    SELECT D.DEPOSIT_ITEM_DT,
    Sum (D.DEPOSIT_ITEM_AMT) AS DEPOSIT_ITEM_AMT,
    S.SUSPENSE_DT,
    S.ORIGINAL_AMT
    OF DEPOSIT_ITEM D


    FULL JOIN
    (
    Select SUSPENSE_DT,
    SUM (ORIGINAL_AMT) AS ORIGINAL_AMT
    OF SUSPENSE_ITEM
    SUSPENSE_DT group
    ) S

    ON D.DEPOSIT_ITEM_DT = S.SUSPENSE_DT

    D.DEPOSIT_ITEM_DT group, S.SUSPENSE_DT

    Where NVL(D.DEPOSIT_ITEM_AMT,0)! = NVL(S.ORIGINAL_AMT,0);

    Hello

    835780 wrote:
    The code someone tell me what I am doing wrong in this code? It is said that a SQL command not properly ended...

    Please post the complete error message you got, including Illll numbers. Parts that you don't think are important, like line numbers, can help someone else find the problem.

    In your main query, the WHERE clause must go before the GROUP BY clause.

    In SQL * Plus, the SQLBLANKLINES parameter determines if you have completely empty lines, or lines containing nothing else than a white space in the middle of an SQL statement. By default, you can ' have empty linest, but if you really want to, you can override this setting at a meeting by saying:

    SET     SQLBLANKLINES   ON
    

    or you could put comments on lines incriminated, so that they are more completely blank, like this:

    SELECT        D.DEPOSIT_ITEM_DT,
           Sum(D.DEPOSIT_ITEM_AMT)      AS DEPOSIT_ITEM_AMT,
           S.SUSPENSE_DT,
           AVG (S.ORIGINAL_AMT)      AS ORIGINAL_AMT     -- See note, below
    FROM        DEPOSIT_ITEM D
              --
              --
              --
    FULL JOIN
    (
         Select        SUSPENSE_DT,
                SUM(ORIGINAL_AMT)     AS ORIGINAL_AMT
         FROM        SUSPENSE_ITEM
         Group BY  SUSPENSE_DT
    ) S
              --
              --
    ON        D.DEPOSIT_ITEM_DT      = S.SUSPENSE_DT
              --
              --
    Where NVL(D.DEPOSIT_ITEM_AMT,0) != NVL(S.ORIGINAL_AMT,0)
              --
    Group BY  D.DEPOSIT_ITEM_DT, S.SUSPENSE_DT
    ;
    

    If s.original_amount is not in the GROUP BY clause, then it cannot be in the SELECTION clause unless it is the argument of an aggregate function. I don't know what you want to do here, so I can't say with certainty how. This is unrelated to your current problem, but once solve you your current problem, you will get other errors because of it.

    For best results, always post a small example of data (CREATE TABLE and INSERT statements) and the desired results of these data, whenever you have a question.
    It never hurts to say what version of Oracle you are using.

    Published by: Frank Kulash, February 25, 2011 17:33

  • command not properly ended

    Can someone explain why this error occurs?

    ORA-00933: SQL not correctly completed command.

    SELECT u.id LIKE username, (SUM (CASE WHEN c.teachermark = 0 1 THEN 1 ELSE END) * 100 / 19) LIKE rawgrade, MAX (c.teachertimestamp) AS dategraded FROM m_user AS u LEFT JOIN m_checklist_check AS FROM c m_user LIKE u LEFT JOIN m_checklist_check AS c ON u.id = c.userid WHERE c.item IN (21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,3 AND u.id IN (38392) GROUP BY u.id
    SQL> select * from dual as T;
    select * from dual as T
                       *
    ERROR at line 1:
    ORA-00933: SQL command not properly ended
    
    SQL> select * from dual T;
    
    D
    -
    X
    

    So, delete 'UNDER' in FROM CLAUSE:
    Not ' m_user LIKE u", should be"ROM m_user u.

  • Error "Command not properly ended SQL" CASES

    This error is driving me crazy... I have read several threads and google it so much, I am sure its obvious that miss me, but can someone help to point out? I get the not properly completed "SQL command" error and its location the | just before the case statement. Here's my request, I haven't posted a CREATE TABLE because I think it's just my syntax is incorrect?

    SELECT

    f.CT_ID,

    f.BUSINESS,

    f.CT_DS,

    d.ETL_DT,

    d.ACTIVITY_DT,

    d.MINUTE_KEY,

    d.FCST_CONTACTS_RECEIVED

    Of

    (LIGHTHOUSE. IEX_CT_DIM b

    JOIN INTERNAL LIGHT. D THE IEX_CTACTIVEFORECAST (b.CT_KEY = d.CT_KEY))

    JOIN INTERNAL LIGHT. TBL_GEN_CT_BUSINESS f

    WE (f.CT_ID = b.CT_ID)

         || CASE WHEN F.CT_DS = END "THI Spanish' THEN 'MODERATE_NR' AND

    (f.BUSINESS IN ('THI_PL', 'THI_ESC')) AND

    (d.ACTIVITY_DT BETWEEN TO_DATE)

    27 January 2014 00:00:00 ',

    "MM/DD/YYYY hh24:mi:ss")

    AND TO_DATE)

    27 April 2014 00:00:00 ',

    "MM/DD/YYYY hh24:mi:ss")) AND

    (f.EFF_DT = TO_DATE)

    29 January 2014 00:00:00 ',

    "MM/DD/YYYY hh24:mi:ss")) AND

    d.ETL_DT = (SELECT

    MAX (ETL_DT)

    Of

    LIGHTHOUSE. IEX_CTACTIVEFORECAST

    WHERE

    ACTIVITY_DT = d.ACTIVITY_DT AND

    CT_KEY = d.CT_KEY AND

    MINUTE_KEY = d.MINUTE_KEY)

    Means, you try to select ct_ds. If ct_ds = "Spanish THI", then you must replace that Word with "Moderate_nr". If it is put like this the case statement in the selection as list below

    SELECT

    f.CT_ID,

    f.BUSINESS,

    DECODE (F.CT_DS, 'Spanish THI', 'MODERATE_NR',F.CT_DS) ct_ds,.

    d.ETL_DT,

    d.ACTIVITY_DT,

    d.MINUTE_KEY,

    d.FCST_CONTACTS_RECEIVED

    Of

    (LIGHTHOUSE. IEX_CT_DIM b

    JOIN INTERNAL LIGHT. D THE IEX_CTACTIVEFORECAST (b.CT_KEY = d.CT_KEY))

    JOIN INTERNAL LIGHT. TBL_GEN_CT_BUSINESS f

    WE (f.CT_ID = b.CT_ID)

    (f.BUSINESS IN ('THI_PL', 'THI_ESC')) AND

    (d.ACTIVITY_DT BETWEEN TO_DATE)

    27 January 2014 00:00:00 ',

    "MM/DD/YYYY hh24:mi:ss")

    AND TO_DATE)

    27 April 2014 00:00:00 ',

    "MM/DD/YYYY hh24:mi:ss")) AND

    (f.EFF_DT = TO_DATE)

    29 January 2014 00:00:00 ',

    "MM/DD/YYYY hh24:mi:ss")) AND

    d.ETL_DT = (SELECT

    MAX (ETL_DT)

    Of

    LIGHTHOUSE. IEX_CTACTIVEFORECAST

    WHERE

    ACTIVITY_DT = d.ACTIVITY_DT AND

    CT_KEY = d.CT_KEY AND

    MINUTE_KEY = d.MINUTE_KEY)

    Post edited by: 000000

  • SQL command not properly ended.

    Hello
    I have connected the aplication to the oracle database in developer j. I used the Insert buttons and validation included.
    For debugging application it runs correctly. but sometimes it gives error sql command not completed successfully.
    I checked the requests when it runs successfully, it runs the query ' insert into Schema_name.table_name (column names) values (?)'.
    but when it gives an error it runs the query ' insert into Schema_name. Schema_name. Schema_name. Schema_name. Schema_Name.table_name(column names) VALUES (?) e

    Can someone tell me what is the reason of it?

    Thank you.

    Can you try to change your query of

    SELECT CD_ID, Data_Type, Data_Value, Misc1, Misc2 FROM Sample_ADF_FinIQ_Common.Common_data
    

    TO

    SELECT CD_ID, Data_Type, Data_Value, Misc1, Misc2 FROM Common_data
    

    Note that I deleted the schema name of the query. Specific no reason why you use in front of the table schema name (I assume that you have created the connection to the schema on which you perform these operations).

    Arun-

  • Classic report command SQL ORA-00933 not properly completed when you enable sorting

    Hello

    Oracle 11g r2, APEX 4.1.1.00.23.

    I have a few reports of type SQL Query (PL/SQL, returning the SQL query function body), so the source is as follows:
    begin
      return points_ui.get_points_query(:P0_FILTER_TYPE);
    end;
    Without no sort option, the report is made successfully.

    But I got the following error during a test to enable the sorting option for a column:
    ORA-00933: SQL command not properly ended
    I read about this error on the Oracle forums, and I saw it was a bug in an older version, but I thought it was fixed in 4.0.2...

    Any help would be appreciated.

    Thank you.

    Yann.

    The Order By clause and the column sort is kind of mutually exclusive.
    If your SQL in the report area has an Order By inside and you apply the sort order on the columns in the report attributes tab, then errors occur during execution.

    Concerning

  • drop the triggers in the SQL code causes not properly completed order.

    running the following command in SQL developer, giving the following error message
    ORA-00933: SQL not correctly completed command.
    What I am doing wrong
    Begin  
    For I In (Select Trigger_Name, Owner From Dba_Triggers Where Trigger_Name Like 'ABC%' And Owner = 'my_schema')
      Loop  
        Execute Immediate 'DROP TRIGGER '||I.Owner||'.'||I.Trigger_Name;  
      End Loop;  
    End;
    Published by: Mo2 on April 16, 2010 12:21

    Published by: Mo2 on April 16, 2010 12:24

    MO2 wrote:
    Yes he has.
    is an example of the names BIN$ + i6ls2WnR/Svz0wA5LSG8A == $0

    In fact these triggers created by the database after I have remove the tables. is there a way to avoid their creation?

    drop trigger BIN$+i6ls2WnR/Svz0wA5LSG8A==$0;
    drop trigger BIN$+i6ls2WnR/Svz0wA5LSG8A==$0
                     *
    ERROR at line 1:
    ORA-00933: SQL command not properly ended
    

    Yes, oracle complained about it during a fall.
    These objects will be created if you recyclebin on.

    You can either disable your recyclebin or you can purge these items in recyclebin after a fall. Make sure that you require this function or objects in the future.

    Concerning
    Anurag

  • error from EXEC_SQL:921ORA - 00921: unexpected end of sql command

    EXEC_SQL.PARSE(CONNECTION_ID,CURSOR_NUMBER, 'SELECT count(*) FROM "Work"@PASS WHERE "PId" = (SELECT PId from cr_layout where L_NO =''' || :CT.L_NO || '''');
    
    Gives this error -- unexpected error from EXEC_SQL:921ORA-00921:Unexpected end of sql command
    
    I know it's related to the bracket at the end but I'm not able to correct it...plz. help

    This?

     EXEC_SQL.PARSE(CONNECTION_ID,CURSOR_NUMBER, 'SELECT count(*) FROM "Work"@PASS WHERE "PId" = (SELECT PId from cr_layout where L_NO =''' || :CT.L_NO || ''')');
    

    -Clément

  • SUPERIOR service... ORA-00921: unexpected end of SQL command

    Hello

    get the below error.

    SQL > @c:\test_user.sql;

    Enter the user name value: mapple
    old 1: DROP USER UPPER(&&USERNAME) CASE
    new 1: DROP USER UPPER (mapple) WATERFALL
    DROP USER UPPER (mapple) WATERFALL
    *
    ERROR on line 1:
    ORA-00921: unexpected end of SQL command


    you want to convert to uppercase in user input.

    cant we use UPPER() function here?

    How can we do?

    Regarding

    No, you can use the UPPER part.

    Or do you need it. Oracle will automatically translate all identifiers (table names, column names, etc.) in uppercase, except if you wrap them in double quotes.
    If you insist on the use of capital letters:

    Set sqlcase higher

    send all your statements translated into letters on the server.

    -------------
    Sybrand Bakker
    Senior Oracle DBA

  • When I try to use Windows Media Player 11 I get the message: Windows Media Player is not properly installed on windows vista

    Original title: MediaPlayer does not open. Followd Scout121 answr. Got the message: not recognized as int/ext control.  Help!

    I followed the directions for the question of Scout121, posted by Bikesh T 20 October 2011.  When I entered the "regsvr32vbscript.dll", I got the message: is not recognized as internal or external, command an executable program or batch file.

    We have Windows Vista Home Premium 32 bit version 6.0 (Build 6002: Service Pack 2).

    I received a validation code windows, but when I try to use Windows Media Player 11 but the message: Windows Media Player is not properly installed.   When I try to install the player form Microsoft Web site, I get the message that the installation has failed.

    Please notify.  We are clueless.  Thank you.

    Hello

    What troubleshooting steps you have done until now?

    Click on the link below and run the fixit.

    Method 1: Solve the problems of Windows Media Player video and other media or library

    http://support.Microsoft.com/mats/windows_media_player_diagnostic/

     

    Method 2: Disable Windows Media Player and then turn it on to Windows features and check if the problem persists.

    Disable and enable Windows Media Player and check if it opens.

    (a) click Start and select Control Panel.

    (b) click on programs and features.

    (c) click on or turn off Windows features turn on on the left side.

    (d) develop the features of media; clear the check box Windows Media Player.

    (e) click Yes and OK to continue.

    (f) restart the computer.

    Note: If windows media player is already disabled, follow the steps mentioned below:

    After the restart, follow these steps:

    (a) click Start and select Control Panel.

    (b) click on programs and features.

    (c) click on or turn off Windows features turn on on the left side.

    (d) develop the features of media; Check the Windows Media Player.

    (e) click Yes and OK to continue.

    (f) restart the computer.

    This would be re - install windows media player 12.

    See the link: http://windows.microsoft.com/en-US/windows-vista/Turn-Windows-features-on-or-off

    Method 3: Perform scan of SFC (System File Checker) and see if the problem persists.

    http://support.Microsoft.com/kb/929833

    Let us know the status of the issue.

  • Impossible to delete the two files and shows me the error message windows does not properly

    Hello

    can't delete two files that actually a song file VLC webrib exdr video...
    cannot select the option to delete the time I click file tht it shows me the message "windows doesn't work maybe not properly" and the file stops immediately once that I close this error message... Please give me a solution to this

    Hi MakPatel,

    You can delete these files via the command prompt, if your window closes...

    (1) open the command prompt. (Click the Startbutton .) In the search box, type command, and then prompt in the list of results, double-click command prompt. )

    2) navigate to the download folder where the video file is present, using the "cd"command.

    For example, if your file is present in the "C:\Users\user1\Downloads".

    Type cd C:\Users\user1\Downloads and press enter in the command prompt.

    (3) Delete (Remove) the file name using the "del" command.

    For example, if your video file name is "sample.mp4.

    Led sample.mp4 type and press enter in the command prompt.

  • SDCLI command not working only not on a linux machine?

    I installed sql developer 4.1 and jdk1.8.0_45 on a linux machine. I'm in the directory/opt/sqldeveloper/sqldeveloper/bin and shot 'sdcli' command to run the unit test. but get error command not found. I ran test cases on windows with the command 'sdcli' machine of the same file and it worked. Why it does not work under linux? There are additional parameters that missed me?

    Hello

    "Sdcli" command now works. Add/opt/sqldeveloper/sqldeveloper/bin in the 'PATH' environment at startup only '

    [oracle@windmill bin] $ echo $PATH

    /op/sqldeveloper/sqldeveloper/bin:/u01/app/oracle/product/11.2.0/dbhome_11204/bin:/opt/sqldeveloper/sqldeveloper/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/u01/app/oracle/product/11.2.0/dbhome_11204/bin:/home/oracle/bin:/usr/java/jdk0.8.0_45

  • PHP is not properly configured on your web server.

    Hello, I download a site Web of muse and me always error at the end - "1 WARNING.
    PHP is not properly configured on your web server. Forms of the muse does not work correctly unless PHP is enabled on the web server. Contact your Web host or Web site administrator on how to enable PHP support. "

    already on the site online form that do not send the email from the same mistake.

    How can I solve my problem?

    Thank you


    Margarida Amara

    Hello Margarida,

    Your Web host must support PHP and the PHP mail service must be properly configured to send e-mail messages. If you use the feature to download FTP in the Muse, Muse will attempt to warn you if it detects that your Web host does not meet these requirements.

    I suggest you contact your hosting provider in order to get this resolved.

    Thank you

    Ankush;

  • sqlplus: command not found

    I installed oracle as user ora102 and create a new one like:

    / etc/passwd:

    Oracle: x: 54321:54321: / home/oracle: / bin/bash

    ora102:x:54322:54322: / home1/ora102: / bin/ksh

    Headof:x:54323:54325: / home1/mbs/ho/maintain: / bin/bash

    hoserv:x:54324:54325: / home1/mbs/ho/maintain: / bin/bash

    / etc/group:

    oinstall:x:54321:

    DBA:x:54322:Oracle, ora102

    Headof:x:54323:

    hoserv:x:54324:

    test: x: 54325:ora102

    For the user Lechefdela that I have:

    -bash - $3.2 id - a

    UID = 54323 (headof) gid = 54325 (test) groups = 54325 (test)

    My problem is when I run sqlplus:

    -bash-3, $ 2 sqlplus

    -bash: sqlplus: command not found

    the $ORACLE_HOME environment has been defined in the profile of ora102

    Please help me

    Apparently, you have correctly set home.  Follow my previous comment and try to start the database:

    sqlplus/nolog

    ...

    SQL > connect / as sysdba

    Connect to an instance is idle.<===== you="" should="" see="" this="" message="" after="" you="">

    SQL > startup

    David Fitzjarrell

Maybe you are looking for

  • MacBook Air does not illuminate

    SO this is what happened: the night before my laptop was working fine. The battery at the time was about 20%. I turned off. The next morning I tried to turn it on, but she didn't only turn on. I tried to plug my charger but the "light" is not getting

  • Equium L40-14i BIOS update now no start

    Hi allI had some problems with my lappie, checked if Toshiba support looking for updated drivers to slow down.They was a BIOS update with specified 2.00WIN an improvement in performance. My BIOS is v 1.60I'm running Vista and my model number is PSL49

  • What do the icons on the top of the N300 - x 1000

    There are 8 small icons on the top of this wireless router which I just bought and I know that the first 3 are the ethernet connection, but would like to know the functions of the other 5 Thank you

  • having problems become my printer to work after you download the compatible driver loading. Also I can't open a Web site from a link

    2 problems 1. always problems to get my printer to work after you download the compatible driver loading.  I have a HP7660 and was instructed to use a driver for HP 5600.  Printer still does not print. 2. when I go on a website of my e-mail address,

  • Move from one mac to another - CS4 disappeared

    When I moved all my programs and data to migrate Assistant of the Macbook air Macbook pro all programs where transferred except Adobe Photoshop . Why is it? The card is "Photoshop CS4" and many other maps such as: Configuration, Legal, Local, MATLAB,