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:

Tags: Database

Similar Questions

  • 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.

  • 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

  • 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

  • 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.

  • 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

  • This is not correct in SQL Query?

    Hello world

    I was reading some tutorials on job cuts. And I discovered the query to be something like:

    RUN DBMS_JOB. REMOVE (2);

    2 where is the job number. I ran the same command and I get the error like 'SQL statement' invalid. Does this mean the tutorial is wrong? :(

    The link to the tutorial is:
    http://www.dbasupport.com/Oracle/ora9i/jobqueue2.shtml

    the place where you run the job...?

    exec (UTE) is a sql... more command you can use from several sql...
    All publishers that allows sql commands will accept over the command. Developer SQL only accepts the exec command. If you need to write a pl/sql block it as

    begin
    DBMS_JOB.REMOVE(12);
    end;
    

    But since sql like

    EXECUTE DBMS_JOB.REMOVE(2); 
    

    is sufficient.

    Ravi Kumar

  • 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

  • Trigger not successfully completed

    If changed from null to a date, on all of the related records of the Stock available.
    create or replace TRIGGER trig_return_date3
       AFTER UPDATE ON hire
       FOR EACH ROW
    BEGIN
       IF :NEW.hir_returndate IS NOT NULL
       THEN
       UPDATE STOCK
       SET sto_available = 'Y'
       WHERE STOCK_HIRE.stohir_id = STOCK.sto_id
       END IF;
    END;
    /
    
    show errors
    Not correctly completed SQL command

    Hello

    Whenever you have any questions, post a small example data (CREATE TABLE and only relevant columns, INSERT statements) and the desired results from these data.
    In the case of a trigger, the sample data should show what looks like the tables before the trigger fires. After some DML statements that would cause the trigger to fire and the contents of the or some tables modified after each of them.
    Explain, using specific examples, how you get these results from these data.
    Always tell what version of Oracle you are using.

  • 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

  • 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

Maybe you are looking for

  • I need to clear the Cache?

    I stuck my last EtreCheck below. It reads very well, but tells me that 3.88 GB of Ram used is cached. That's all what I can improve and if so, how? In addition, he said that my backup of disks are too small, and yet they erase automatically the oldes

  • Satellite L30 will not recognize battery

    Hi guys Having a problem with my battery. The battery itself is not so old and works in another machine. My current L30 for some reason any will not recognize the battery. When the captain came out of the computer does not use the battery. It sometim

  • Ive forgot my computer model

    The computer says that my model is asus k73e/k73sd/k73sv series but whose one of the computers is this?

  • OptiPlex 990 no boot after BIOS flash

    I have an OptiPlex 990 that several problems after a power surge, so I replaced the power supply, motherboard and installed a new hard drive. Once I had everything back together, I booted the system and tried to upgrade to the latest version of the B

  • The creative cloud reads 'Install updates', but the progress bar is stuck at 0

    I can't access all the other screens in the CC window. My apps still work, and I can work on my projects; However, I like to keep up to date and I can't. Summer in this way for about 2 months. I use a MacBook Air. Any idea on what to do? I don't thin