PL/SQL: ORA-00933: SQL not correctly completed command

Hello

CREATE or REPLACE PROCEDURE SAI (STATUS_CODE OUT varchar2)
AS
BEGIN
Select ename emp in STATUS_CODE where empno = '7369';
END SAI;

I get the error "* not correctly completed SQL command * ' when executing this procedure. Help, please.

Hello

user10503747 wrote:
Hello

CREATE or REPLACE PROCEDURE SAI (STATUS_CODE OUT varchar2)
AS
BEGIN
Select ename emp in STATUS_CODE where empno = '7369';
END SAI;

I get the error "* not correctly completed SQL command * ' when executing this procedure. Help, please.

I want to tell u that you made mistake of bases...

First you write a wrong syntax for your sql statement

Select ename emp in STATUS_CODE where empno = '7369';

its should be like

Select ename from STATUS_CODE from emp where empno = '7369';

your entire procedure will be as

CREATE OR REPLACE PROCEDURE SAI (STATUS_CODE out varchar2)
AS
BEGIN
select last_name into STATUS_CODE from employees where employee_id=102;
END SAI ;

and after that, you must declare a variable of liaison

Return_name VARIABLE VARCHAR2 (30);

Then exceute your interior

exec sai(:return_name);

print your value of variable binding

print :return_name;

RETURN_NAME
--------------------------------
De Haan

Regards

UMI

Tags: Database

Similar Questions

  • XML request error. ORA-00933: SQL not correctly completed command.

    Hi all

    My Version of the database: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0.

    CREATE table test (name VARCHAR2 (3), identification number);

    Insert test values ('abc', 61);

    Insert test values ('def', 46);

    Select table_name,
    column_name,
    search_string 'abc ',.
    result
    CLO, xmltable (('ora: view("'||))) table_name |' ") / RANK /' | column_name | "[ora:contains (text,' %'|)] "abc". "% ») > 0]')
    result varchar2 columns (10) path '.'
    )
    where table_name in ('TEST');

    and I get: ORA-00933: SQL not correctly completed command it points on ' * xmltable *'
    SQL> SELECT extractValue(value(t), '/CustomerInformation/Customerid') "Customerid"
      2       , extractValue(value(t), '/CustomerInformation/CustomerName') "CustomerName"
      3       , extractValue(value(t), '/CustomerInformation/Country') "Country"
      4  FROM xml_document_table x
      5     , TABLE(
      6         XMLSequence(
      7           extract(x.xml_document, '/Customer/CustomerInformation')
      8         )
      9       ) t
     10  ;
    
    Customerid            CustomerName             Country
    --------------------- ------------------------ -------------
    1                     xxxx                     4
    2                     yyyy                     5
     
    
  • ORA-00933: SQL not correctly completed command.

    Hello

    I get the following error:-ORA-00933: SQL not correctly completed command

    select
                (select max(x.exec_id) from log_exec x) exec_id,
                'c2uv_sys_map' table_name, 'All' upload_file_name,
                count(*) rows_ok, 0 rows_duplicate, 0 rows_rejected, 0 rows_bad, e.upload_file_id
                from c2uv_sys_map e
                where e.row_err_id=0
                group by e.upload_file_id
                UNION
                select max(x.exec_id) from log_exec x) exec_id,
                'c2uv_sys_map' table_name, 'All' upload_file_name,
                count(*) rows_ok, 0 rows_duplicate, 0 rows_rejected, 0 rows_bad, e.upload_file_id
                from c2uv_sys_map e
                group by e.upload_file_id
                UNION
                select (select max(x.exec_id) from log_exec x) exec_id,
                'c2uv_sys_map' table_name, 'All' upload_file_name,
                0 rows_ok, count(*) rows_duplicate, 0 rows_rejected, 0 rows_bad, e.upload_file_id
                from c2uv_sys_map  e
                where e.row_err_id=2
                group by e.upload_file_id
                UNION
                select (select max(x.exec_id) from log_exec x) exec_id,
                'c2uv_sys_map' table_name, 'All' upload_file_name,
                0 rows_ok, 0 rows_duplicate, count(*) rows_rejected, 0 rows_bad, e.upload_file_id
                from c2uv_sys_map  e
                where (e.row_err_id =1) or (e.row_err_id >2)
                group by e.upload_file_id
                UNION
                select (select max(x.exec_id) from log_exec x) exec_id,
                'c2uv_sys_map' table_name, 'All' upload_file_name,
                0 rows_ok, 0 rows_duplicate, 0 rows_rejected, u.no_of_bad_rows rows_bad, t.upload_file_id
                from c2uv_sys_map t right outer join chn_upload u on t.upload_file_id = u.config_id
                inner join chn_upload_config c on u.config_id = c.config_id
                inner join chc_data_filetype f on c.data_filetype_id = f.data_filetype_id
                where f.data_filetype_id = 11
                group by u.no_of_bad_rows, t.upload_file_id
    Edited by: 872435 January 6, 2012 06:09

    It seems that this parenthesis corresponds to nothing:

    select (select max(x.exec_id) from log_exec x) exec_id,
           'c2uv_sys_map' table_name,
           'All' upload_file_name,
           count(*) rows_ok,
           0 rows_duplicate,
           0 rows_rejected,
           0 rows_bad,
           e.upload_file_id
      from c2uv_sys_map e
     where e.row_err_id = 0
     group by e.upload_file_id
    UNION
    select max(x.exec_id)
      from log_exec x)         -- <-- Here
    ...
    
  • Error: ORA-00933: SQL not correctly completed command

    Hello

    When I run the query of delimit (who used to write the result of refsursor) in sql * plus, it works well.
    OPEN result FOR
         SELECT site_direction_id direction_numbers,
               site_lane_id lane_numbers
          FROM site_lanes
             JOIN report_parameters 
               ON site_lane_id = report_parameter_value
            WHERE site_lanes.site_id = my_site_id
              AND report_parameters.report_parameter_id  = in_report_parameter_id
              AND report_parameters.report_parameter_group = 'LANE'
           AND report_parameters.report_parameter_name  = 'LANE'
      ORDER BY site_direction_id ASC,
               site_lane_id ASC
          FROM SYS.DUAL;
    But inside a procedure, when compiling, throwing me the following error message. I'm not sure why it generates this error.
     ----------------------------------------------------
     PL/SQL: SQL Statement ignored
     PL/SQL: ORA-00933: SQL command not properly ended
    Could someone help me?

    Thank you.

    Published by: user10641405 on June 8, 2009 11:39

    Hello

    It really works in SQL * more? He has two FROM clauses.

    You probably want to remove 'OF SYS. DOUBLE"of the last line.

  • ORA-00933: SQL not correctly completed command (similar question titles exist - can not find my question).

    Hi all

    I have a couple of (relatively simple) tables (see DDL and DML below and try to join them,)

    but I get the error ORA-00933 - and I can't for the life of understand me why?

    I also put this on SQLFiddle for those who do not have a very convenient server.

    This is the SELECT query - internal works without problem, but I can't

    all for work.

    Any help appreciated - TIA and rgs,

    Paul...

    [code]

    CREATE TABLE ticket

    (

    ticket_id INT PRIMARY KEY,

    ticket_description VARCHAR (25)

    );

    INSERT INTO ticket VALUES (1, 'ticket 1');

    INSERT INTO ticket VALUES (2, 'ticket 2');

    INSERT INTO ticket VALUES (3, ' ticket 3 ");

    INSERT INTO ticket VALUES (4, 'ticket 4');

    INSERT INTO ticket VALUES (5, 'ticket 5');

    CREATE TABLE my_comment

    (

    comment_id INT PRIMARY KEY,

    ticket_id INT NOT NULL,

    comments_comment VARCHAR (45) NOT NULL,

    comments_timestamp INT NOT NULL

    );

    INSERT INTO my_comment VALUES (1, 1, 'comment 1 ticket to 1', ((TO_DATE ('2013-11-30 15:15:30 ', ' yyyy-mm-jj HH24:mi:ss)-TO_DATE ('1970-01-01 00:00:00 ',' yyyy-mm-dd HH24:mi:ss)) * 86400));))

    INSERT INTO my_comment VALUES (2, 1, 'Comment 2 1 notes', ((TO_DATE ('2014-02-13 15:15:30 ', ' yyyy-mm-jj HH24:mi:ss)-TO_DATE ('1970-01-01 00:00:00 ',' yyyy-mm-dd HH24:mi:ss)) * 86400));))

    INSERT INTO my_comment VALUES (3, 1, ' comment 3 tickets on 1', ((TO_DATE ('2014-06-30 15:15:30 ', ' yyyy-mm-jj HH24:mi:ss)-TO_DATE ('1970-01-01 00:00:00 ',' yyyy-mm-dd HH24:mi:ss)) * 86400));))

    INSERT INTO my_comment VALUES (4, 1, ' comment 4 tickets on 1', ((TO_DATE ('2014-07-09 15:15:30 ', ' yyyy-mm-jj HH24:mi:ss)-TO_DATE ('1970-01-01 00:00:00 ',' yyyy-mm-dd HH24:mi:ss)) * 86400));))

    INSERT INTO my_comment VALUES (5, 2, 'comment 1 ticket in 2', ((TO_DATE ('2013-11-30 15:15:30 ', ' yyyy-mm-jj HH24:mi:ss)-TO_DATE ('1970-01-01 00:00:00 ',' yyyy-mm-dd HH24:mi:ss)) * 86400));))

    INSERT INTO my_comment VALUES (6, 2, 'Comment 2 on 2 ticket', ((TO_DATE ('2014-02-13 15:15:30 ', ' yyyy-mm-jj HH24:mi:ss)-TO_DATE ('1970-01-01 00:00:00 ',' yyyy-mm-dd HH24:mi:ss)) * 86400));))

    INSERT INTO my_comment VALUES (7, 2, 'comment on ticket 2 3', ((TO_DATE ('2014-07-30 15:15:30 ', ' yyyy-mm-jj HH24:mi:ss)-TO_DATE ('1970-01-01 00:00:00 ',' yyyy-mm-dd HH24:mi:ss)) * 86400));))

    INSERT INTO my_comment VALUES (8, 2, 'comment on ticket 2 4', ((TO_DATE ('2014-08-09 15:15:30 ', ' yyyy-mm-jj HH24:mi:ss)-TO_DATE ('1970-01-01 00:00:00 ',' yyyy-mm-dd HH24:mi:ss)) * 86400));))

    INSERT INTO my_comment VALUES (9, 3, 'comment 1 ticket of 3', ((TO_DATE ('2001-11-30 15:15:30 ', ' yyyy-mm-jj HH24:mi:ss)-TO_DATE ('1970-01-01 00:00:00 ',' yyyy-mm-dd HH24:mi:ss)) * 86400));))

    INSERT INTO my_comment VALUES (10, 3, 'Comment 2 tickets in 3', ((TO_DATE ('2002-02-13 15:15:30 ', ' yyyy-mm-jj HH24:mi:ss)-TO_DATE ('1970-01-01 00:00:00 ',' yyyy-mm-dd HH24:mi:ss)) * 86400));))

    INSERT INTO my_comment VALUES (11, 3, 'comment on ticket 3 3', ((TO_DATE ('2004-06-30 15:15:30 ', ' yyyy-mm-jj HH24:mi:ss)-TO_DATE ('1970-01-01 00:00:00 ',' yyyy-mm-dd HH24:mi:ss)) * 86400));))

    INSERT INTO my_comment VALUES (12, 3, ' comment 4 tickets in 3', ((TO_DATE ('2004-07-09 15:15:30 ', ' yyyy-mm-jj HH24:mi:ss)-TO_DATE ('1970-01-01 00:00:00 ',' yyyy-mm-dd HH24:mi:ss)) * 86400));))

    INSERT INTO my_comment VALUES (13, 4, 'comment 1 ticket on 4', ((TO_DATE ('2003-11-30 15:15:30 ', ' yyyy-mm-jj HH24:mi:ss)-TO_DATE ('1970-01-01 00:00:00 ',' yyyy-mm-dd HH24:mi:ss)) * 86400));))

    INSERT INTO my_comment VALUES (14, 4, 'Comment 2 tickets in 4', ((TO_DATE ('2004-02-13 15:15:30 ', ' yyyy-mm-jj HH24:mi:ss)-TO_DATE ('1970-01-01 00:00:00 ',' yyyy-mm-dd HH24:mi:ss)) * 86400));))

    INSERT INTO my_comment VALUES (15, 4, 'comment on ticket 4 3', ((TO_DATE ('2004-07-09 15:15:30 ', ' yyyy-mm-jj HH24:mi:ss)-TO_DATE ('1970-01-01 00:00:00 ',' yyyy-mm-dd HH24:mi:ss)) * 86400));))

    INSERT INTO my_comment VALUES (16, 4, ' comment 4 tickets 4', ((TO_DATE ('2006-06-30 15:15:30 ', ' yyyy-mm-jj HH24:mi:ss)-TO_DATE ('1970-01-01 00:00:00 ',' yyyy-mm-dd HH24:mi:ss)) * 86400));))

    INSERT INTO my_comment VALUES (17, 5, 'comment 1 ticket to 1', ((TO_DATE ('2013-11-30 15:15:30 ', ' yyyy-mm-jj HH24:mi:ss)-TO_DATE ('1970-01-01 00:00:00 ',' yyyy-mm-dd HH24:mi:ss)) * 86400));))

    INSERT INTO my_comment VALUES (18, 5, 'Comment 2 on 2 ticket', ((TO_DATE ('2014-02-13 15:15:30 ', ' yyyy-mm-jj HH24:mi:ss)-TO_DATE ('1970-01-01 00:00:00 ',' yyyy-mm-dd HH24:mi:ss)) * 86400));))

    INSERT INTO my_comment VALUES (19, 5, 'comment on ticket 3 3', ((TO_DATE ('2014-06-30 15:15:30 ', ' yyyy-mm-jj HH24:mi:ss)-TO_DATE ('1970-01-01 00:00:00 ',' yyyy-mm-dd HH24:mi:ss)) * 86400));))

    INSERT INTO my_comment VALUES (20, 5, ' comment 4 tickets 4', ((TO_DATE ('2014-07-09 15:15:30 ', ' yyyy-mm-jj HH24:mi:ss)-TO_DATE ('1970-01-01 00:00:00 ',' yyyy-mm-dd HH24:mi:ss)) * 86400));))

    [\code]

    do not use 'UNDER' keyword in alias for the table

    SELECT t.ticket_id,

    t.ticket_description,

    x.c_max_date,

    z.comments_comment

    FROM (SELECT ticket_id, MAX (c.comments_timestamp) AS c_max_date

    OF my_comment c

    WHERE (c.comments_timestamp

    ((TO_DATE ('2013-11-30 15:15:30 ', ' yyyy-mm-jj HH24:mi:ss)-TO_DATE ('1970-01-01 00:00:00 ',' yyyy-mm-dd HH24:mi:ss)) * 86400-60000000)))

    )

    GROUP BY ticket_id) x

    INNER JOIN t ticket

    ON t.ticket_id = x.ticket_id

    INNER JOIN my_comment z

    WE z.comments_timestamp = x.c_max_date;

    ----

    Ramin Hashimzade

  • Aargh. "sql not correctly completed comand" - something wrong with my join...

    Select *.
    FROM table1 t1
    Join table2 t2 on t1.pkid = t2.pkid

    These aren't my real table names, but this structure is sufficient to generate my mistake. Clearly I can't join syntax. After Google search, I tried various permutations, with the join condition in parens, prefacing the names table with the schema and stuff like that. No change - always get ora00933.

    The only thing that worked was comma-ing, the tables and put the join condition in a where clause clause. Who doesn't for me in the end because the full query I need joined much more and it'll look terrible like that.

    Little help on just a simple inner join?

    Thank you!

    Edited by: sherifffruitfly January 4, 2011 10:18

    The ANSI join syntax was introduced in Oracle in version 9.1. Your version has been out of favor for a dozen years, and is the latest version of Oracle 11.2.

    Unless you can move to something of this century, to do joins in the where clause.

    John

  • Can someone help me - error:-not correctly completed SQL command

    Hello

    This code has an error, I tried to find this error but I don't find it so please help me: -.

    error report:
    ORA-06550: line 1, column 149:
    PL/SQL: ORA-00933: SQL not correctly completed command
    ORA-06550: line 1, column 7:
    PL/SQL: SQL statement ignored

    Code

    Select HTMLDB_ITEM. HIDDEN(1,SEQ_ID),
    HTMLDB_ITEM. C001 Text(2,a.C001).
    HTMLDB_ITEM. C002 Text(3,a.C002).
    HTMLDB_ITEM. C003 Text(4,a.C003).
    APEX_ITEM. SELECT_LIST_FROM_QUERY (5, a.c004, 'SELECT D P_ID, P_ID R OF PARTY_DETAIL') c004.
    APEX_ITEM. SELECT_LIST_FROM_QUERY
    (6, a.c005,)
    ' SELECT CATEGARY_NAME D, ' |' CATEGARY_NAME ITEM_CATEGARY R'.
    "style =" width: 220px "'"
    ||' OnChange = "get_select_list_xml1 (this, e
    || 'f7_ '.
    || LPAD (seq_id, 4, '0')
    || ')"',
    '' YES. ''
    '0',
    "- Select -",
    « f6_ » || LPAD (seq_id, 4, '0'),
    NULL,
    'NO') c005
    APEX_ITEM. SELECT_LIST_FROM_QUERY
    (7, a.c006,)
    "SELECT ITEM_CODE D.
    ||' ITEM_CODE ITEM_MASTER R'
    ||' WHERE CATEGARY_NAME ='
    || C005,
    "style =" width: 220px "',"
    '' YES. ''
    '0',
    "- Select Code (')"
    || (Select Count (*)
    of ITEM_MASTER
    where CATEGARY_NAME = c005)
    || ')-',
    « f7_ » || LPAD (seq_id, 4, '0'),
    NULL,
    'NO') c006
    APEX_ITEM. SELECT_LIST_FROM_QUERY (8, a.c007, 'SELECT nom_element, nom_element R OF ITEM_MASTER D') c007,.
    HTMLDB_ITEM. C008 Text(9,a.C008).
    APEX_ITEM. SELECT_LIST_FROM_QUERY (10, a.c009, 'SELECT PACK_TYPE D, PACK_TYPE R OF ITEM_PACKING') c009,.
    HTMLDB_ITEM. Text(11,a.C010) c010.
    HTMLDB_ITEM. Text(12,a.C011) c011.
    HTMLDB_ITEM. C012 Text(13,a.C012).
    HTMLDB_ITEM. C013 Text(14,a.C013)
    OF wwv_flow_collections one
    where a.collection_name = 'REC_ITEM. '




    Thank you
    Maury

    Published by: Ed on September 10, 2009 03:36

    Can you copy and paste this code into SQL * more and see if it runs properly? You can check your single quote (') and double quote characters ("") to make sure that those who at the height correctly because it is difficult to say when copied on the web.

  • Not correctly completed SQL command

    can not find why this error occurs: not correctly completed SQL command

    PROCEDURE FORMA4_25_11)

    P_GO IN VARCHAR2,

    P_DATE_1 IN VARCHAR2,

    P_DATE_2 IN VARCHAR2,

    P_DAY_COUNT NUMBER,

    DATA_SET ON SYS_REFCURSOR)

    AS

    DB_QUERY VARCHAR (32767).

    BEGIN

    DB_QUERY: = ' SELECT T1.ad, T1.admin_count, T1.cnt)

    SELECT dc.NAME ad,

    Count (am. IDN) admin_count,.

    Admn.Say NTC

    SINCE DC dictionaries.customs

    INNER JOIN kadr.tper_master mf

    ON mf.branch_code = dc.code_int AND mf.status = 0

    INNER JOIN vpdgk.vp_admin am

    ON am.mufet_id = mf.idn

    LEFT JOIN (SELECT branch_code,

    Say Count (branch_code) AS

    OF (m_id SELECT c.mufet_id,

    b.branch_code,

    Count (c.mufet_id) mufet_count

    OF vpdgk.vp_qeydiyyat A

    INNER JOIN kadr.tper_master b

    ON b.idn = a.mufet_id

    INNER JOIN vpdgk.vp_admin c

    ON c.mufet_id = A.mufet_id

    AND (c.uid_ IS NOT NULL

    GOLD c.uid_reserv IS NOT NULL)

    INNER JOIN dictionaries.customs d

    ON d.code_int = b.branch_code

    WHEN Trunc (A.insert_date) BETWEEN

    TO_DATE('''||) P_DATE_1 | " ', "DD. MM YYYY ")

    AND

    TO_DATE('''||) P_DATE_2 | " ', "DD. MM YYYY ")

    C.mufet_id GROUP, b.branch_code

    HAVING COUNT (c.mufet_id) < ' | P_DAY_COUNT |')

    GROUP BY branch_code Admn)

    ON admn.branch_code = dc.code_int

    Dc.NAME, admn.say) AS T1 WHERE T1.ad = ' | P_GO | ";

    DATA_SET OPEN FOR DB_QUERY;

    END;

    Hi Afa

    At the end of SQL you write 'AS '. Remove it

    Excample:

  • Order SQL ORA-00933 not correctly completed, UNION ALL

    I apologize if it's really simple, but it made me turn round...

    I inherited the spaghetti code to fix and revise (550 line sql request sent from VBA). I'm putting it in pieces in the form of views. In the following code, I'm calling two subqueries, which I stored in the form of views (Credit_Report_Exposure_P_Sub_A and Credit_Report_Exposure_P_Sub_B). I have create a UNION of them, and it works fine - until I add a WHERE clause. So:

    ---------------------------------------------------------------------------------
    SELECT
    PROFILENAME,
    months,
    sum

    Of
    Credit_Report_Exposure_P_Sub_A

    UNION ALL

    (SELECT
    ccp_profile_name PROFILENAME,
    VWMONTH month,
    SUM SUM (PSJ_TOTAL_AMOUNT)
    Of
    Credit_Report_Exposure_P_Sub_B
    GROUP by
    VWMONTH,
    ccp_profile_name)
    ------------------------------------------------------------------------------------------

    It works very well, to select the same 3 columns in each subquery (ignoring for a moment the wrong choice of alias 'months' and 'sum').

    But when I add the following WHERE clause:
    ------------------------------------------------------------------------------------------
    WHERE
    month = ' 2008-09'
    ------------------------------------------------------------------------------------------
    I get the error in the subject line - which is not properly completed.

    But: if I comment on each half of the UNION, so the WHERE clause works very well.

    Am I missing something obvious? I tried wrapping the whole of the UNION more in parentheses, and the first clause of the UNION as well, but that only creates more errors on supposed lack of right parens.

    Thanks for any help.

    Hello

    Whenever you have a problem with a query, view query. It is unclear where exactly you added the WHERE clause.

    You don't need parentheses around the second part of the UNION all.

    Half of the effect of the WHERE clause of the will UNION ALL? If both, you must add two times, or do the UNION ALL in a subquery and add the WHERE clause to the query of super.

  • Current NetIncome do not correctly complete fairness after elimination

    The dilemma I have is that PL value circulating cannot not properly after actions in that elimination took place on the PL

    Both company A & B share a common parent called Parent1


    CYNetIncome is a liability account.

    NetIncome is a revenue account

    PKI dividend income= sales. PlugAccount = DividendsDiff

    DividendsPaid = passive (equity). Account = DividendsDiff card

    Societele reported NetIncome of $150. $50 is derived from a PKI dividend income (CompanyB receipt (as such relationships with partner PKI Societele value))

    CompanyB reports $50 of dividendspaid in equity with partner ICP Societele.  CompanyB reported NetIncome of $200

    A PL (income statement) Parent1should have NetIncome of $300 150-50(From CompanyA) + 200 (CompanyB). The deduction of $50 is the elimination of PKI dividend income. Value of TNE $300 to Parent1 is correct, but does not correct into account CYNetIncomes count NetIncome.

    The problem I have is Parent1 when the NetIncome fills CyNetIncome (CynetIncome = NetIncome) I get $350. He does not consider the elimination.

    No idea why this would happen is greatly appreciatee

    I have replaced #Functional with TotCustom1 C1 # C1 and this solved my problem

    Thank you

  • ora-00933 not correctly completed sql command

    The following query is implementation error. Please help fix

    Actual output

    Mv_payment operating data:
    program_key,amount,received_date
    14               400        07/11/2010
    14               200          
    14               300        08/11/2010
    
    Expected output
    from mv_payment_holding
    program_key        sum(amount)          latest received date
    14                        900                    08/11/2010
     SELECT DISTINCT 
      PROGRAM_NAME_ID ||'. '|| program_name_descr Surcharge,program_name_id,
      get_total('110831559486','90869506814') "Total Amount Due",t.program_key,
      nvl(T.PI_AMOUNT,0) "Penalty Interest",
      sum(nvl(h.Amount,0)) "Payment Amount",
      get_total('110831559486','90869506814')+nvl(T.PI_AMOUNT,0)+sum(nvl(Amount,0))  "Period Balance",
      max(to_char(h.received_date,'MM/DD/YY')) "Last Payment Date"
      FROM mv_program_dict P, mv_PROG_SURCH T,mv_billing b,mv_payment_holding h
      WHERE p.program_key= t.program_key(+)
      AND t.billing_key=b.billing_key
      AND b.company_id=h.company_id
      AND b.report_period=h.report_period
      AND t.program_key=h.program_key
      AND t.BILLING_KEY='110831559486'
      And t.program_key='90869506814'
      group by program_name_id,program_name_descr Surcharge,t.program_key,PI_AMOUNT
      order by PROGRAM_NAME_ID
    Published by: KK on March 28, 2011 10:24

    If you want just your output of the mv then

    SELECT program_key, SUM (amount), MAX (received_date)
      FROM mv_payment_holding
    GROUP BY program_key;
    

    you are missing a comma in group by.

    SELECT DISTINCT
           PROGRAM_NAME_ID || '. ' || program_name_descr Surcharge,
           program_name_id,
           get_total ( '110831559486', '90869506814') "Total Amount Due",
           T.program_key,
           NVL (T.PI_AMOUNT, 0) "Penalty Interest",
           SUM (NVL (h.Amount, 0)) "Payment Amount",
             get_total ( '110831559486', '90869506814')
           + NVL (T.PI_AMOUNT, 0)
           + SUM (NVL (Amount, 0))
             "Period Balance",
           MAX (TO_CHAR ( h.received_date, 'MM/DD/YY')) "Last Payment Date"
      FROM mv_program_dict P,
           mv_PROG_SURCH T,
           mv_billing b,
           mv_payment_holding h
     WHERE P.program_key = T.program_key(+)
       AND T.billing_key = b.billing_key
       AND b.company_id = h.company_id
       AND b.report_period = h.report_period
       AND T.program_key = h.program_key
       AND T.BILLING_KEY = '110831559486'
       AND T.program_key = '90869506814'
    GROUP BY program_name_id,
             program_name_descr,
             T.program_key,
             PI_AMOUNT
    ORDER BY PROGRAM_NAME_ID
    

    Published by: Ganesh aboumagahrif March 28, 2011 13:33

  • 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

  • ORA-00933 with the valid request

    During some tests with valid Oracle 12 c, I encountered the following problem:

    Environment:

    CREATE TABLE( adressen2)

    ADRID NUMBER (10) ALWAYS AS IDENTITY GENERATED,.

    persid NUMBER (10) NOT NULL,

    Strasse, VARCHAR2 (50 CHAR).

    TRO VARCHAR2 (50 CHAR),

    Land NUMBER (5),

    Please VARCHAR2 (8 CHAR),

    adrtyp NUMBER (2),

    Valid PERIOD

    );

    Insert a few lines without using "valid" (means valid)

    INSERT INTO adressen2 (persid, road, please, ort, Land, adrtyp, gueltig_start, gueltig_end)

    VALUES (100073, "Hohestraße 37', 50123', 'Burscheid', 7, 11, to_timestamp ('01.07.2014 ',' DD.)") MM YYYY'), NULL);

    UPDATE adressen2

    SET gueltig_end = to_timestamp ('30.06.2014 ',' DD.) MM YYYY')

    WHERE ADRID = 11;

    COMMIT;

    Connection with SQL * Plus 12.1.0.1.0

    SQL > SELECT * FROM adressen2 from the PERIOD OF valid SYSDATE WHERE adrid = 11;

    ADRID PERSID STRASSE ORT BUNDESLAND PLZ ADRTYP

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

    11 100073 Scharnhorststrasse 15 07950 11 Triebes

    SQL > SELECT * FROM adressen2 ad from the PERIOD OF valid SYSDATE WHERE adrid = 11;

    SELECT * FROM adressen2 ad from the PERIOD OF valid SYSDATE WHERE adrid = 11

    *

    ERROR on line 1:

    ORA-00933: SQL not correctly completed command.

    So if I omit the table alias everything works fine, but for a real application, this is not enough.

    Well, it helps to have the right syntax - check the syntax diagram in the docs:

    The alias goes after the flashback query clause.

  • Urgent help please.  Inner join caused the error ora-00933

    I ran it, works great:
    SELECT DIFFERENT EXP. EXP_ID,
    EXP. DATU_EXP_WIRE_CENTER_CLLI,
    EXP. DATU_EXP_IP,
    EXP. DATU_EXP_CLLI,
    EXP. DATU_EXP_PORT,
    EXP. DATU_EXP_NAME,
    EXP. DATU_EXP_CITY,
    EXP. DATU_EXP_STATE,
    EXP. DATU_EXP_SW_VERSION,
    DECODE (LAST_ALARM. LAST_ALARM_DATE, NULL, TO_CHAR (SYSDATE, ' YYYY/MM/DD HH24:MI:SS'),
    TO_CHAR (LAST_ALARM. LAST_ALARM_DATE, "YYYY/MM/DD HH24:MI:SS")) AS STATUS_DATE,
    DECODE (LAST_ALARM. ALARM_NAME, NULL, "disconnected", LAST_ALARM. ALARM_NAME) AS DATU_STATUS,
    DECODE (LAST_ALARM. ALARM_CLASS, NULL, 'OTHER', LAST_ALARM. ALARM_CLASS) AS IS_ERROR_STATUS,

    DECODE (LAST_RESOURCE. LAST_ALARM_DATE, NULL, ", TO_CHAR (LAST_RESOURCE. LAST_ALARM_DATE, "YYYY/MM/DD HH24:MI:SS")) AS RESOURCE_STATUS_DATE,
    DECODE (LAST_RESOURCE. RESOURCE_CODE_NAME, NULL, ", LAST_RESOURCE. RESOURCE_CODE_NAME) AS RESOURCE_STATUS,
    DECODE (LAST_RESOURCE. RESOURCE_CODE_CLASS, NULL, ", LAST_RESOURCE. RESOURCE_CODE_CLASS) AS IS_RESOURCE_ERROR_STATUS,
    DECODE (LAST_OPER. LAST_ALARM_DATE, NULL, ", TO_CHAR (LAST_OPER. LAST_ALARM_DATE, "YYYY/MM/DD HH24:MI:SS")) AS OPER_STATUS_DATE,
    DECODE (LAST_OPER. OPER_CODE_NAME, NULL, ", LAST_OPER. OPER_CODE_NAME) AS OPER_STATUS,
    DECODE (LAST_OPER. OPER_CODE_CLASS, NULL, ", LAST_OPER. OPER_CODE_CLASS) AS IS_OPER_ERROR_STATUS,

    EXP BEGIN_MAINT_WINDOW, RTU. RTU_NAME
    OF TT_DATU_EXP_UNIT_INFO EXP
    left outer join
    (SELECT distinct alarmed_datus. EXP_ID, c.ALARM_NAME, c.ALARM_TYPE, c.ALARM_CLASS and alarmed_datus. LAST_ALARM_DATE
    Of alarmed_datus (SELECT EXP_ID, MAX (ALARM_TIME) AS LAST_ALARM_DATE FROM TT_DATU_EXP_ALARM_INFO GROUP BY EXP_ID)
    inner join TT_DATU_EXP_ALARM_INFO b on b.EXP_ID = alarmed_datus. EXP_ID AND b.ALARM_TIME = alarmed_datus. LAST_ALARM_DATE
    inner join TT_DATU_EXP_ALARM_TYPES c on b.ALARM_TYPE = c.ALARM_TYPE
    ) LAST_ALARM on EXP.. EXP_ID = LAST_ALARM. EXP_ID
    left outer join
    (SELECT distinct a.EXP_ID, c.RESOURCE_CODE_NAME, c.RESOURCE_CODE_TYPE, c.RESOURCE_CODE_CLASS, a.LAST_ALARM_DATE
    FROM (SELECT EXP_ID, MAX (RESOURCE_CODE_TIME) AS LAST_ALARM_DATE
    OF TT_DATU_EXP_RESOURCE_CODE_INFO GROUP BY EXP_ID) a
    inner join TT_DATU_EXP_RESOURCE_CODE_INFO b on b.EXP_ID = a.EXP_ID AND b.RESOURCE_CODE_TIME = a.LAST_ALARM_DATE
    inner join TT_DATU_EXP_RESOURCECODE_TYPES c on b.RESOURCE_CODE_TYPE = c.RESOURCE_CODE_TYPE
    ) LAST_RESOURCE on EXP.. EXP_ID = LAST_RESOURCE. EXP_ID
    left outer join
    (SELECT distinct a.EXP_ID, c.OPER_CODE_NAME, c.OPER_CODE_TYPE, c.OPER_CODE_CLASS, a.LAST_ALARM_DATE
    FROM (SELECT EXP_ID, MAX (OPER_CODE_TIME) AS LAST_ALARM_DATE
    OF TT_DATU_EXP_OPER_CODE_INFO GROUP BY EXP_ID) a
    inner join TT_DATU_EXP_OPER_CODE_INFO b on b.EXP_ID = a.EXP_ID AND b.OPER_CODE_TIME = a.LAST_ALARM_DATE
    inner join TT_DATU_EXP_OPER_CODE_TYPES c on b.OPER_CODE_TYPE = c.OPER_CODE_TYPE) LAST_OPER on EXP.. EXP_ID = LAST_OPER. EXP_ID
    inner join TT_DATU_LRN_MAP on exp. EXP_ID = NAB NAB. EXP_ID AND TRIM (NAB. LRN) AS p_LRN
    inner join TT_RTU_TYPES on exp. RTU_TYPE_ID = RTU RTU. RTU_TYPE_ID
    WHERE THERE IS NOT (SOME SATELLITE_EXP_ID OF TT_HOST_SATELLITE WHERE EXP. EXP_ID = SATELLITE_EXP_ID)
    AND EXP.IS_PRIMARY_ADDRESS LIKE p_isPrimary;
    ON THE OTHER
    OPEN FOR V_cursor
    SELECT EXP. EXP_ID,
    EXP. DATU_EXP_WIRE_CENTER_CLLI,
    EXP. DATU_EXP_IP,
    EXP. DATU_EXP_CLLI,
    EXP. DATU_EXP_PORT,
    EXP. DATU_EXP_NAME,
    EXP. DATU_EXP_CITY,
    EXP. DATU_EXP_STATE,
    EXP. DATU_EXP_SW_VERSION,
    DECODE (LAST_ALARM. LAST_ALARM_DATE, NULL, TO_CHAR (SYSDATE, ' YYYY/MM/DD HH24:MI:SS'), TO_CHAR (LAST_ALARM. LAST_ALARM_DATE, "YYYY/MM/DD HH24:MI:SS")) AS STATUS_DATE,
    DECODE (LAST_ALARM. ALARM_NAME, NULL, "disconnected", LAST_ALARM. ALARM_NAME) AS DATU_STATUS,
    DECODE (LAST_ALARM. ALARM_CLASS, NULL, 'OTHER', LAST_ALARM. ALARM_CLASS) AS IS_ERROR_STATUS,

    DECODE (LAST_RESOURCE. LAST_ALARM_DATE, NULL, ", TO_CHAR (LAST_RESOURCE. LAST_ALARM_DATE, "YYYY/MM/DD HH24:MI:SS")) AS RESOURCE_STATUS_DATE,
    DECODE (LAST_RESOURCE. RESOURCE_CODE_NAME, NULL, ", LAST_RESOURCE. RESOURCE_CODE_NAME) AS RESOURCE_STATUS,
    DECODE (LAST_RESOURCE. RESOURCE_CODE_CLASS, NULL, ", LAST_RESOURCE. RESOURCE_CODE_CLASS) AS IS_RESOURCE_ERROR_STATUS,
    DECODE (LAST_OPER. LAST_ALARM_DATE, NULL, ", TO_CHAR (LAST_OPER. LAST_ALARM_DATE, "YYYY/MM/DD HH24:MI:SS")) AS OPER_STATUS_DATE,
    DECODE (LAST_OPER. OPER_CODE_NAME, NULL, ", LAST_OPER. OPER_CODE_NAME) AS OPER_STATUS,
    DECODE (LAST_OPER. OPER_CODE_CLASS, NULL, ", LAST_OPER. OPER_CODE_CLASS) AS IS_OPER_ERROR_STATUS,

    EXP BEGIN_MAINT_WINDOW, RTU. RTU_NAME
    OF TT_DATU_EXP_UNIT_INFO EXP
    (in left outer join
    SELECT distinct alarmed_datus. EXP_ID, c.ALARM_NAME, c.ALARM_TYPE, c.ALARM_CLASS and alarmed_datus. LAST_ALARM_DATE
    Of alarmed_datus (SELECT EXP_ID, MAX (ALARM_TIME) AS LAST_ALARM_DATE FROM TT_DATU_EXP_ALARM_INFO GROUP BY EXP_ID)
    inner join TT_DATU_EXP_ALARM_INFO b on b.EXP_ID = alarmed_datus. EXP_ID AND b.ALARM_TIME = alarmed_datus. LAST_ALARM_DATE
    inner join TT_DATU_EXP_ALARM_TYPES c on b.ALARM_TYPE = c.ALARM_TYPE)
    LAST_ALARM on EXP.. EXP_ID = LAST_ALARM. EXP_ID
    left outer join
    (SELECT distinct a.EXP_ID, c.RESOURCE_CODE_NAME, c.RESOURCE_CODE_TYPE, c.RESOURCE_CODE_CLASS, a.LAST_ALARM_DATE
    FROM (SELECT EXP_ID, MAX (RESOURCE_CODE_TIME) AS LAST_ALARM_DATE
    OF TT_DATU_EXP_RESOURCE_CODE_INFO GROUP BY EXP_ID) a
    inner join TT_DATU_EXP_RESOURCE_CODE_INFO b on b.EXP_ID = a.EXP_ID AND b.RESOURCE_CODE_TIME = a.LAST_ALARM_DATE
    inner join TT_DATU_EXP_RESOURCECODE_TYPES c on b.RESOURCE_CODE_TYPE = c.RESOURCE_CODE_TYPE) LAST_RESOURCE on EXP.. EXP_ID = LAST_RESOURCE. EXP_ID
    left outer join
    (SELECT distinct a.EXP_ID, c.OPER_CODE_NAME, c.OPER_CODE_TYPE, c.OPER_CODE_CLASS, a.LAST_ALARM_DATE
    FROM (SELECT EXP_ID, MAX (OPER_CODE_TIME) AS LAST_ALARM_DATE
    OF TT_DATU_EXP_OPER_CODE_INFO GROUP BY EXP_ID) a
    inner join TT_DATU_EXP_OPER_CODE_INFO b on b.EXP_ID = a.EXP_ID AND b.OPER_CODE_TIME = a.LAST_ALARM_DATE
    inner join TT_DATU_EXP_OPER_CODE_TYPES c on b.OPER_CODE_TYPE = c.OPER_CODE_TYPE
    ) LAST_OPER on EXP.. EXP_ID = LAST_OPER. EXP_ID ORDER BY EXP. DATU_EXP_CLLI
    inner join TT_RTU_TYPES on exp. RTU_TYPE_ID = RTU RTU. RTU_TYPE_ID
    WHERE THERE is NOT (SOME SATELLITE_EXP_ID OF TT_HOST_SATELLITE WHERE EXP.. EXP_ID = SATELLITE_EXP_ID) AND EXP.IS_PRIMARY_ADDRESS love
    p_isPrimary;


    However this one:

    SELECT EXP. EXP_ID,
    EXP. DATU_EXP_WIRE_CENTER_CLLI,
    EXP. DATU_EXP_IP,
    EXP. DATU_EXP_CLLI,
    EXP. DATU_EXP_PORT,
    EXP. DATU_EXP_NAME,
    EXP. DATU_EXP_CITY,
    EXP. DATU_EXP_STATE,
    EXP. DATU_EXP_SW_VERSION,
    DECODE (LAST_ALARM. LAST_ALARM_DATE, NULL, TO_CHAR (SYSDATE, ' YYYY/MM/DD HH24:MI:SS'),
    TO_CHAR (LAST_ALARM. LAST_ALARM_DATE, "YYYY/MM/DD HH24:MI:SS")) AS STATUS_DATE,
    DECODE (LAST_ALARM. ALARM_NAME, NULL, "disconnected", LAST_ALARM. ALARM_NAME) AS DATU_STATUS,
    DECODE (LAST_ALARM. ALARM_CLASS, NULL, 'OTHER', LAST_ALARM. ALARM_CLASS) AS IS_ERROR_STATUS,


    DECODE (LAST_RESOURCE. LAST_ALARM_DATE, NULL, ", TO_CHAR (LAST_RESOURCE. LAST_ALARM_DATE, "YYYY/MM/DD HH24:MI:SS")) AS RESOURCE_STATUS_DATE,
    DECODE (LAST_RESOURCE. RESOURCE_CODE_NAME, NULL, ", LAST_RESOURCE. RESOURCE_CODE_NAME) AS RESOURCE_STATUS,
    DECODE (LAST_RESOURCE. RESOURCE_CODE_CLASS, NULL, ", LAST_RESOURCE. RESOURCE_CODE_CLASS) AS IS_RESOURCE_ERROR_STATUS,
    DECODE (LAST_OPER. LAST_ALARM_DATE, NULL, ", TO_CHAR (LAST_OPER. LAST_ALARM_DATE, "YYYY/MM/DD HH24:MI:SS")) AS OPER_STATUS_DATE,
    DECODE (LAST_OPER. OPER_CODE_NAME, NULL, ", LAST_OPER. OPER_CODE_NAME) AS OPER_STATUS,
    DECODE (LAST_OPER. OPER_CODE_CLASS, NULL, ", LAST_OPER. OPER_CODE_CLASS) AS IS_OPER_ERROR_STATUS,


    EXP BEGIN_MAINT_WINDOW, RTU. RTU_NAME
    OF TT_DATU_EXP_UNIT_INFO EXP
    left outer join
    (
    SELECT distinct alarmed_datus. EXP_ID, c.ALARM_NAME, c.ALARM_TYPE, c.ALARM_CLASS and alarmed_datus. LAST_ALARM_DATE
    Of alarmed_datus (SELECT EXP_ID, MAX (ALARM_TIME) AS LAST_ALARM_DATE FROM TT_DATU_EXP_ALARM_INFO GROUP BY EXP_ID)
    inner join TT_DATU_EXP_ALARM_INFO b on b.EXP_ID = alarmed_datus. EXP_ID AND b.ALARM_TIME = alarmed_datus. LAST_ALARM_DATE
    inner join TT_DATU_EXP_ALARM_TYPES c on b.ALARM_TYPE = c.ALARM_TYPE) LAST_ALARM on EXP.. EXP_ID = LAST_ALARM. EXP_ID

    left outer join
    (SELECT distinct a.EXP_ID, c.RESOURCE_CODE_NAME, c.RESOURCE_CODE_TYPE, c.RESOURCE_CODE_CLASS, a.LAST_ALARM_DATE
    FROM (SELECT EXP_ID, MAX (RESOURCE_CODE_TIME) AS LAST_ALARM_DATE
    OF TT_DATU_EXP_RESOURCE_CODE_INFO GROUP BY EXP_ID) a
    inner join TT_DATU_EXP_RESOURCE_CODE_INFO b on b.EXP_ID = a.EXP_ID AND b.RESOURCE_CODE_TIME = a.LAST_ALARM_DATE
    inner join TT_DATU_EXP_RESOURCECODE_TYPES c on b.RESOURCE_CODE_TYPE = c.RESOURCE_CODE_TYPE) LAST_RESOURCE on EXP.. EXP_ID = LAST_RESOURCE. EXP_ID
    left outer join
    (SELECT distinct a.EXP_ID, c.OPER_CODE_NAME, c.OPER_CODE_TYPE, c.OPER_CODE_CLASS, a.LAST_ALARM_DATE
    FROM (SELECT EXP_ID, MAX (OPER_CODE_TIME) AS LAST_ALARM_DATE
    OF TT_DATU_EXP_OPER_CODE_INFO GROUP BY EXP_ID) a
    inner join TT_DATU_EXP_OPER_CODE_INFO b on b.EXP_ID = a.EXP_ID AND b.OPER_CODE_TIME = a.LAST_ALARM_DATE
    inner join TT_DATU_EXP_OPER_CODE_TYPES c on b.OPER_CODE_TYPE = c.OPER_CODE_TYPE
    ) LAST_OPER on EXP.. EXP_ID = LAST_OPER. EXP_ID ORDER BY EXP. DATU_EXP_CLLI
    inner join TT_RTU_TYPES on exp. RTU_TYPE_ID = RTU RTU. RTU_TYPE_ID
    WHERE the EXP.IS_PRIMARY_ADDRESS as p_isPrimary;

    It does not work kept send me errors:
    [ORA-00933: SQL not correctly completed command]


    Any guru can help? I need to have this resolved effect today.
    Thanks in advance.
  • ORA-00933 sql is not properly completed.

    Dear members,

    I have the following query in Report Builder 10g,

    Select a, b, c
    FROM table1
    where a = 12

    & p_whr_fy & p_whr_supp & p_whr_bt & p_whr_mat_spec & p_whr_lc_num & p_whr_cotton & P_WHR_LOC_ID

    Union of all the

    Select a, b, c
    from table2
    where a = 12

    & p_whr_fy & p_whr_supp & p_whr_bt & p_whr_mat_spec & p_whr_lc_num & p_whr_cotton & P_WHR_LOC_ID

    Here I used the lexical settings, and with spaces in the lines its ok but when trying to change the query / remove spaces in the lines, it gives the error.

    ORA-00933 sql not successfully completed

    With regard to:

    Hello
    Check your default values for substitution variables, at least one of them is not empty and causes an error.
    kikolus

Maybe you are looking for

  • Firefox crashes while watching a movie on you tube (plugin)

    Greetings,I was watching a movie on you tube. I run it forward to see if I watched the movie before. It stops. I clicked on another movie to watch, the movie screen is kind of gray and plugin sign appeared, I clicked it. I continued to see what movie

  • Epson scanner does not work with el capitan

    My Epson Perfection 1660 Photo scanner won't work because I've upgraded to El Capitan. I downloaded the latest driver from Epson. Any ideas?

  • replace cpu for Pavilion dv6-6031er

    I have a laptop Pavilion dv6-6031er processor Phenom II P960. Is it possible to change the Phenom II N970 или Phenom II X 920 processor?

  • BlackBerry Blackberry classic classic froze during reset to factory settings

    Hello I wanted to do a factory reset on my classic Blackberry settings. But, it has benn 4 dayx and it is not yet complete. It is stuck at 99%. I read that I had to download BBLink and reinstal the os from there, but my phone is not recognized becaus

  • Global scaling by default to search drop downs

    I'm looking for more information on how to set the default values for drop downs in PLM.  For example, when an Internet user searches for hardware specifications in GSM, the default is to search by name.  However, is it possible to have this set to f