ORA-00907 MISSING RIGHT PARENTHESIS

Hi all

The query

FLASHBACK TABLE schema.table_name to TIMESTAMP (January 18, 2008 18:55:58 ',' MON-DD-YYYY HH24:MI:SS');


gives me error

ORA-00907 MISSING RIGHT PARENTHESIS

WHAT AM I MISSING HERE?


kAI

WHAT AM I MISSING HERE?

Try

flashback table schema.table_name to timestamp( to_timestamp('18-JAN-2008 18:55:58','DD-MON-YYYY HH24:MI:SS'));

Tags: Database

Similar Questions

  • Please help me with the missing right parenthesis

    The code below gives me error of missing right parenthesis. can someone help me understand the error code. Thank you.

    SELECT * FROM CIRC.DRAW_TYPE A
    WHERE A.CITY_CODE IN CASE WHEN :Rnzip='WithZip' THEN   ('46301', '46302') ELSE  A.CITY_CODE END

    You can try this.

    SELECT *
      FROM CIRC.DRAW_TYPE A
     WHERE (A.CITY_CODE = decode(:Rnzip,'WithZip','46301',A.CITY_CODE))
        Or (A.CITY_CODE = decode(:Rnzip,'WithZip','46302',A.CITY_CODE))
    

    Note: not tested

  • ORA-00906 missing left parenthesis

    Hello

    I get "ORA-00906 missing opening parenthesis" error during the creation of the foreign key on the short-term in the table t_friends column.

    (1) parent table:

    create the table t_city
    (
    city_name varchar2 primary key (60)
    )

    (2) child table:

    create the table t_friends
    (
    friend_name varchar2 (30) not null,
    city_name varchar2 (60)
    )

    ALTER table t_friends add constraint city_cons foreign key short-term reference t_city (short-term);

    Please can you tell me what is the error that I do in the syntex above.

    Thank you
    Michel K

    Try this:

    alter table t_friends add constraint city_cons foreign key (city_name) references t_city(city_name);
    

    You forgot to put the column in parentheses.

  • Missing right parenthesis when you use the CONTAINS function

    Hello

    The following sql causes the error "missing right parenthesis. Its a search engine simple execution of PHP that dynamically adds each keyword to a connection variable. This works fine if I use only 1 keyword, but as soon as others are added, I get the error.

    Here's the SQL echo:
    SELECT SCORE(1), TITLE FROM MYTABLE WHERE CONTAINS(TITLE, :1 AND :2, 1) > 0 ORDER BY SCORE(1), TITLE ASC
    My 1st thought was contains it seeks single quote so I tried the following combinations:
     CONTAINS(TITLE, ':1' AND ':2', 1) > 0
     CONTAINS(TITLE, ':1 AND :2', 1) > 0
    Both through the crossover so maybe its nothing to do with citations. I also tried to use single quotes when concatinating the sql in PHP. No joy :(

    CONTAINS the second parameter is a string, so you should concatenate your variables of two link with the chain AND:

    CONTAINS (TITLE,: 1 |) ' AND ' | (: 2, 1) > 0

  • ERROR: in the first line ORA-00907 missing paréntesis

    He comes to the table I was trying to create:

    create table (Department)
    dept_id integer not null,
    dept_name varchar2 (20) not null,
    key constraint primary pk_departement (dept_id));

    The response was:

    ERROR at the forefront
    ORA-00907 closing missing paréntesis

    Does someone of you can give me a help?

    Thank you very much

    Nicolò

    Using the exact code to Sean:

    SQL> create table department (
      2  dept_id integer not null,
      3  dept_name varchar2(20) not null,
      4  constraint pk_departement primary key (dept_id));
    
    Table created.
    

    What tool do you use? You can paste the session?

  • Missing right parenthesis

    Hi all

    Im trying to insert these results to my table of facts (fact_apartments) with the following:

    INSERT INTO fact_apartments (avg_price, segmentid, projectid)

    SELECT (AVG (Price), segmentid, projectid)

    OF projetou

    WHERE projectid = '1';

    but the return with the missing closing parenthesis, it could not know what the problem

    I don't know why you get this error, probably because you have other errors.

    you will need a group on your query. FOR EXAMPLE

    INSERT INTO fact_apartments (avg_price, segmentid, projectid)

    SELECT AVG (Price), segmentid, projectid

    OF projetou

    WHERE projectid = '1'

    GROUP BY segmentid, projectid;

    Concerning

    André

  • Missing right parenthesis error

    I have all brackets correctly syntxed, however, I still get the missing parenthesis error. Someone please help!

    create the table w_agree_d
    (
    DATASOURCE_NUM_ID NUMERIC (10,0) NOT NULL,
    ETL_PROC_WID NUMERIC (10,0) NOT NULL,
    INTEGRATION_ID VARCHAR2 (30) NOTNUL,.
    MINI_WID NUMERIC (10,0) NOT NULL DEFAULT 0,
    ROW_WID NUMERIC (10,0) NOT NULL,
    STAMP OF APPR_DT,
    STAMP OF EFF_DT,
    END_DT TIMESTAMP,
    RENEWABLE_FLG VARCHAR2 (1).
    SERVICE_FLG VARCHAR2 (1).
    STAMP OF START_DT,
    VALID_FLG VARCHAR2 (1).
    AGREE_CD VARCHAR2 (30),
    AGREE_CD_I VARCHAR2 (50).
    AGREE_NUM VARCHAR2 (30),
    APPR_BY_EMP VARCHAR2 (50).
    NAME VARCHAR2 (50).
    PAR_INTEGRATION_ID VARCHAR2 (30),
    PAR_NAME VARCHAR2 (50).
    PRI_LST_NAME VARCHAR2 (50).
    PR_SALES_EMP VARCHAR2 (50).
    RATE_LST_NAME VARCHAR2 (50).
    STATUS_CD VARCHAR2 (30),
    STATUS_CD_I VARCHAR2 (50));

    Welcome to the forum!

    NOT NULL

    should be

    NOT NULL
    

    You are missing the SPACE between NO and NULL

    Please read the FAQ on {message identifier: = 9360002} to ask the question in a better way.

  • get the error missing right parenthesis

    Hello

    I get error of parenthesis to absent on the script below

    select * from
            (
              select t_rpt_facility_id, t_ccf_drawn, t_main_acl_type, t_main_acl_id, t_b_restructured, t_rating_id
                     , t_rw, t_outstanding, least(t_outstanding,t_security_value) t_security_value
              from
              (--5
                select
                (case when t_b_ucc =0 then
                          (case when (t_nonTL = 1 )
                                then 13
                                else
                                (case when (t_original_maturity <= 1)
                                     then 13
                                     when t_original_maturity > 1
                                     then 14
                                end)
                           end)
                         when t_b_ucc =1 then
                           15
                         when t_b_ucc =2 then
                           7
                   end
                  ) t_rpt_facility_id
                ,  ( case when (t_nonTL = 1 and t_b_ucc =0 )
                          then t_UD_LE_1YR_CCF
                          else t_ccf
                    end ) t_ccf_drawn
                , (select c.main_acl_type from c2rc_xbrl_main_acl c where c.main_acl_id
                   = t_main_acl_id
                  )  t_main_acl_type
                , t_main_acl_id
                , t_b_restructured
                , (case when (t_main_acl_id =1)
                        then 0
                        else t_rating_id
                   end
                   )     t_rating_id
                , t_rw
                , (case when t_b_ucc = 1
                        then t_ua_limit_ccy_ccy_cf
                        else
                            ( case when qry=1
                                   then
                                        (t_unavailed_limit - (t_net_exposure_secu_guar*100/( case when t_nonTL = 1  then t_UD_LE_1YR_CCF else t_ccf end ) ))
                                   else
                                       --Guarantors
                                        (t_net_exposure_secu_guar*100/( case when t_nonTL = 1  then t_UD_LE_1YR_CCF else t_ccf end ) )
                                   end
                            )
                   end) t_outstanding
                ,t_security_value
                from
                (---4
                         select 1 as qry,
                         t.b_ucc t_b_ucc
                        ,t.original_maturity  t_original_maturity
                        ,(select bsl_ccf from c2c_ccf z where z.ccf_id = 102) t_UD_LE_1YR_CCF
                        ,t.ccf t_ccf
                        --- Handling the NonTL case for HDFC.
                        ,(case when ( t.facility_type_id <> 1  and (exists(select 1 from c2p_this_inst i where i.bank_inst_id = 'HDFC')))
                               then 1
                               else 0
                          end) t_nonTL
                        , nvl((select m.main_acl_id from c2rc_xbrl_acl_mapping m where m.sub_acl_id=t.sub_acl_id),18) t_main_acl_id
                        , t.sub_acl_id t_sub_acl_id
                        , t.b_restructured t_b_restructured
                        ,    (case when (select m.main_acl_id from c2rc_xbrl_acl_mapping m where m.sub_acl_id=t.sub_acl_id) in (6,7)
                                   then (select e.crar from c2m_client e where e.client_id = t.client_id)
                                   else ( case when t.rating_id >205 then 205 else t.rating_id end)
                              end)
                           t_rating_id
                        , t.rw t_rw
                        ,(t.ua_limit_ccy *  t.ccy_cf)   t_ua_limit_ccy_ccy_cf
                        , t.net_exposure_secu_guar   t_net_exposure_secu_guar
                        , t.unavailed_limit   t_unavailed_limit
                        ----To adjust cases where only limit(unavailed) is uploaded .
                        ---In On-Bal,the security is not to shown in ON Bal
                        ---As its unavailed , the same will be shown in NMR off bal.
                        , (case when  (t.limit_exp_id = 1 and t.outstanding > 0)
                                then 0
                                else
                                    (t.security_value + t.provisions)
                          end)      t_security_value
                        from c2m_limit t
                        where
                        t.b_npa = 0
                        ---This condition will eliminate the double counting of the security value in case of unavalied limits
                      and t.limit_exp_id in (1,2))
    Published by: BluShadow on October 20, 2011 13:45
    Fixed barcode labels

    I'd start with this grooming and remove unnecessary parenthesis, a bit like this...

    select *
    from (select t_rpt_facility_id, t_ccf_drawn, t_main_acl_type, t_main_acl_id, t_b_restructured, t_rating_id, t_rw, t_outstanding, least(t_outstanding,t_security_value) t_security_value
          from (-- 5
                select case when t_b_ucc =0 then
                              case when t_nonTL = 1 then 13
                              else case when t_original_maturity <= 1 then 13
                                        when t_original_maturity > 1 then 14
                                   end)
                              end
                            when t_b_ucc =1 then 15
                            when t_b_ucc =2 then 7
                       end as t_rpt_facility_id
                      ,case when (t_nonTL = 1 and t_b_ucc =0 then t_UD_LE_1YR_CCF
                       else t_ccf
                       end as t_ccf_drawn
                      ,(select c.main_acl_type from c2rc_xbrl_main_acl c where c.main_acl_id = t_main_acl_id) as t_main_acl_type
                      ,t_main_acl_id
                      ,t_b_restructured
                      ,case when t_main_acl_id =1 then 0 else t_rating_id end as t_rating_id
                      ,t_rw
                      , case when t_b_ucc = 1 then t_ua_limit_ccy_ccy_cf
                       else case when qry=1 then t_unavailed_limit - (t_net_exposure_secu_guar*100/(case when t_nonTL = 1 then t_UD_LE_1YR_CCF else t_ccf end))
                            else t_net_exposure_secu_guar*100/(case when t_nonTL = 1 then t_UD_LE_1YR_CCF else t_ccf end) --Guarantors
                            end
                       end as t_outstanding
                      ,t_security_value
                from (-- 4
                      select 1 as qry
                            ,t.b_ucc as t_b_ucc
                            ,t.original_maturity as t_original_maturity
                            ,(select bsl_ccf from c2c_ccf z where z.ccf_id = 102) as t_UD_LE_1YR_CCF
                            ,t.ccf as t_ccf
                             --- Handling the NonTL case for HDFC.
                            ,case when t.facility_type_id != 1 and exists(select 1 from c2p_this_inst i where i.bank_inst_id = 'HDFC') then 1 else 0 end as t_nonTL
                            ,nvl((select m.main_acl_id from c2rc_xbrl_acl_mapping m where m.sub_acl_id=t.sub_acl_id),18) as t_main_acl_id
                            ,t.sub_acl_id as t_sub_acl_id
                            ,t.b_restructured as t_b_restructured
                            ,case when (select m.main_acl_id from c2rc_xbrl_acl_mapping m where m.sub_acl_id=t.sub_acl_id) in (6,7)
                                  then (select e.crar from c2m_client e where e.client_id = t.client_id)
                             else case when t.rating_id >205 then 205 else t.rating_id end
                             end as t_rating_id
                            ,t.rw t_rw
                            ,t.ua_limit_ccy*t.ccy_cf as t_ua_limit_ccy_ccy_cf
                            ,t.net_exposure_secu_guar as t_net_exposure_secu_guar
                            ,t.unavailed_limit as t_unavailed_limit
                             ----To adjust cases where only limit(unavailed) is uploaded .
                             ---In On-Bal,the security is not to shown in ON Bal
                             ---As its unavailed , the same will be shown in NMR off bal.
                            ,case when t.limit_exp_id = 1 and t.outstanding > 0 then 0 else t.security_value+t.provisions end as t_security_value
                        from c2m_limit t
                        where t.b_npa = 0
                        ---This condition will eliminate the double counting of the security value in case of unavalied limits
                        and   t.limit_exp_id in (1,2)
                     )
             )  <--- MISSING bracket here
        ) <--- MISSING bracket here
    

    and then work to try and eliminate some of the queries online one selects them and turn them into joints if possible.
    Some of the case statements can probably be simplified.

  • ORA-00907 is missing a closing parenthesis in the value

    Hi all

    I am writing code for a table, the value type, but is ORA-00907 missing right parenthesis at the opening of the LOV in the window to submit competing demand.
    The internal code of the defined value is as follows:

    Table:_ gl_ledgers_public_all_v gl, gl_ledgers lg, gl_ledger_configurations lc

    Columns in the table:_
    Value: gl.name
    ID: gl.ledger_id

    Où :_
    WHERE gl.ledger_id = lg.ledger_id 
          AND lg.configuration_id = lc.configuration_id 
          AND :$FLEX$.FND_MO_REPORTING_LEVEL='1000'
    UNION ALL
    SELECT name, organization_id
       FROM hr_operating_units
       WHERE :$FLEX$.FND_MO_REPORTING_LEVEL='3000'
    Where FND_MO_REPORTING_LEVEL is a value which returns Char and is used by a previous setting.

    I looked around for the triggers of this error (misuse apostrophes, questions of subquery...) but nothing in my case. Can someone check to see what could be the cause of this error? Thanks in advance.

    Oops!
    It looks like we can't use UNION / GROUP BY / SEEN in value sets' where clause article, as it implecitly by adding parentheses.
    Of http://docs.oracle.com/cd/A60725_05/pdf/flex.pdf

    Special treatment for WHERE the Clauses
    Behind the scenes, the flexfield adds one and... clause in the WHERE clause that you set for your table validated set of values.
    If your WHERE clause contains a RC, then the seal in the annex AND clause may not apply to your WHERE clause integer (without the brackets).
    and could not get the desired result.
    Then, flexfields put implicitly parentheses around your WHERE clause.

    http://docs.Oracle.com/CD/A60725_05/HTML/comnls/us/FND/fndffm03.htm

    Of http://docs.oracle.com/cd/E18727_01/doc.121/e12892/T354897T361276.htm
    You can create a view with the UNION and use it in the set of values.
    (Or) you will need to have an internal selection in the field of the table itself.

    By
    VAMSi

  • ORA-00907: lack of right parenthesis

    Hi all

    on 11.2.0.4 on Win 2008

    When executing:

    Select creele, TRUNC ((creele, 'DD')) of loans;

    I get:

    ORA-00907: missing a closing parenthesis (on column 28).

    Any idea?

    Let's see creele format:

    Select creele loans;

    CREELE

    --------

    10/11/14

    21/10/14

    Thank you.

    Can you tell me please why column A and B have different results:

    Select trunc (AVG (trunc(rendule,'DD')-trunc(creele+1,'DD')), 2) A.

    TRUNC (AVG (trunc(rendule,'DD')-trunc(creele,'DD') + 1), (2) B

    details, loans

    WHERE details.emprunt = emprunts.numero

    and borrowing. NUMBER = dΘtails. LOAN

    AND details.rendule is not null

    GROUP Member;

    Because you say to do different things. Suppose that there is just a line in your table, with a rendule of 30/04/2015 and a creele from 20/04/2015.

    A = 30/04/2015 - (20/04/2015 + 1) = 30/04/2015 - 21/04/2015 = 9

    B = 30/04/2015-4/20/2015 + 1 = 10 + 1 = 11

    If you want to arithmetic operations to be performed in a particular order, it is best to use parentheses to make the order without ambiguity. This would return the same value as the A (if that's what you want):

    TRUNC (AVG (trunc(rendule,'DD') - (TRUNC(creele,'DD') + 1)), 2).

  • materialized view ora-00907, although sql query works well

    Hello

    It seems to be a bug with db oracle 10.2.0.1 and his prod. env, I can't apply the patch quickly, can anyone give me a tip

    CREATE THE MV_TEN MATERIALIZED VIEW
    BUILDING THE INDEX REFRESH IMMEDIATE TO COMPLETE ON DEMAND HELP
    AS
    SELECT ten.tcy_refno AS TENANCY_REF,
    Rev.rac_accno AS REV_ACC_NO,
    Rev.rac_last_aba_date AS LAST_ABA_DATE,
    Rev.rac_last_aba_balance AS LAST_ABA_BALANCE,
    AAA.aca_status AS ARREARS_STATUS,
    AAA.aca_ara_code AS ARREARS_ACTION_CODE,
    AAA.aca_effective_date AS EFFECTIVE_DATE,
    AAA.aca_balance AS ACCOUNT_BALANCE,
    ARA.ara_description AS ARREARS_DESCRIPTION,
    NPA.nop_text
    OF REVENUE@remotedb rev.
    Ten TENANCT@remotedb.
    ACCOUNT_ARREARS_ACTIONS@remotedb aaa
    LEFT OUTER JOIN ARREARS_ACTIONS@remotedb ara
    ON aaa.aca_ara_code = ara.ara_code
    LEFT OUTER JOIN NOTEPADS@remotedb IR
    ON aaa.aca_reusable_refno = npa.nop_reusable_refno
    WHERE ten.tcy_refno = rev.rac_tcy_refno
    AND rev.rac_end_date IS NULL
    AND rev.rac_accno = aaa.aca_rac_accno
    AND aaa.aca_status! = "DEL".
    AND npa.nop_current_ind = 'Y ';

    ORA-00907: missing just paraenthesis


    Thank you

    See

    http://asktom.Oracle.com/pls/asktom/f?p=100:11:4226402560732847:P11_QUESTION_ID:6585774577187

  • Problem with right parenthesis.

    Hello
    I'm trying to do something simple, and it doesn't.
    During an attempt which:
    declare 
    solde number;
    journal varchar2(2);
    dossier varchar2(12);
    begin
    journal:='21';
    dossier:='1707029205';
    execute immediate 'select sum(a.debi)-sum(a.cred)
    into solde
    from auxiloc a,
      dossier d,
      client c
    where d.clie =c.code
    and a.doss in (select o.code from dossier o where o.clie=c.code )
    and a.cmpt   =4111
    and a.xdate <=
      (select dar2 from qt:1 where doss=d.code
      )
    and d.jqt =:2
    and d.code=:3' using journal,journal,dossier;
    end;
    I get a "missing right parenthesis" on line 8, which is the line with immediate execution.
    Obviously, there is no missing brackets, I am must be missing something, but what?

    The query such as:
    select sum(a.debi)-sum(a.cred)
    --into solde
    from auxiloc a,
      dossier d,
      client c
    where d.clie =c.code
    and a.doss in (select o.code from dossier o where o.clie=c.code )
    and a.cmpt   =4111
    and a.xdate <=
      (select dar2 from qt21 where doss=d.code
      )
    and d.jqt =21
    and d.code=1707029205;
    works without a hitch...

    clues?

    Don't look for the error of "in" first time.
    You must move the "in" out of the sql string.

    execute immediate 'select ...' into solde using ....
    
  • Using DBMS_METADATA. GET_DDL get error: ORA-00907: lack the right parenthesis

    Hello

    I try to extract the schema DDL to a base (10.2.0.4.0 - 64-bit Enterprise Edition on Solaris 10). I ran the query below and get an ORA-00907: parenthesis right absent error.

    SELECT DBMS_METADATA. GET_DDL (REPLACE(object_type,' ','_') AS object_type, object_name) FROM user_objects WHERE object_type NOT IN ('TABLE_PARTITION', "INDEX_PARTITION", "LOB");

    This is the output when executing the above in the sqlplus worksheet

    Select DBMS_METADATA. GET_DDL (REPLACE (object_type, ", '_') as object_type, object_name) FROM user_objects if object_type in ('TABLE_PARTITION',"INDEX_PARTITION","LOB")
    *
    ERROR on line 1:
    ORA-00907: lack of right parenthesis

    remove the where the clause gives the following:

    Select DBMS_METADATA. GET_DDL (REPLACE (object_type, ", '_') as object_type, object_name) FROM user_objects
    *
    ERROR on line 1:
    ORA-00907: lack of right parenthesis

    Pointers would be welcome. I know I could get the DDL using exp/imp, but I'd like to understand why I get the error of missing parenthesis.

    see you soon,

    Ewan

    SELECT DBMS_METADATA. GET_DDL (REPLACE(object_type,' ','_') AS object_type, object_name) FROM user_objects WHERE object_type NOT IN

    You don't need an alias here. Getting rid of the "as long as object_type' and it should work.

  • ORA-00907 - "lack the right parenthesis.

    Hello

    I am trying to create a procedure to add table scores each month. This is my code:

    create or replace procedure add_partitions

    as

    v_partition all_tab_partitions.partition_name%type;

    v_limit varchar2 (50);

    LONG v_sql;

    Start

    Select to_char (trunc (add_months(sysdate,1), 'MM'), 'Mon_YYYY')

    in v_partition

    Double; -napr. 072014

    Select to_char (trunc (add_months(sysdate,2), 'MM'), 'DD-MM-YYYY')

    in v_limit

    Double; -napr. 08/01/2014

    v_sql: = ' ALTER TABLE CENTRUMADMIN. AUD$ _BACKUP ADD PARTITION '. v_partition | «VALUES LESS THAN (' |)» v_limit | ') tablespace BACKUP_AUDIT';

    immediately run v_sql;

    end;

    /

    The procedure is compiled without errors, but when I run it I get this error:

    ORA-00907 - "lack the right parenthesis.

    After some tests, I am sure that this problem is here: VALUES LESS THAN (' | v_limit |) (')... but I'cant understand whats wrong

    Any ideas? Thanks in advance

    Honza

    Hi Mika,

    Try

    VALUES LESS THAN ("' | v_limit |) (') - three times - 2 gives you a ' in your statement - the 3rd chain delimited

    concerning
    Kay

  • ORA-00907: lack the right parenthesis when using Group by clause with xmlagg

    I have the following query and I am getting ORA-00907 error when I use the clause with the xmlagg function group.
    select xmlelement("Mitigation",
                    xmlelement("m_szMethodName",tm.DisplayName),
                    xmlelement("SubstanceInterferenceProtocolList",
                                (select xmlagg(xmlelement("MitigationProtocol",
                                        xmlelement("m_szMethodName",tm.DisplayName),
                                        xmlelement("m_szInterferenceProtocolName",tmp.protocol_name),
                                        xmlelement("m_szInterferenceSubstance",tmp.intf_mtrl_prod_code),
                                        xmlelement("m_ProtocolParameters",
                                            xmlelement("m_szProtocolName",tmp.protocol_name),
                                                xmlelement("m_Consumables",
                                                    xmlelement("Consumable",
                                                        xmlelement("m_szConsumId", xrl.rgnt_pack_name),
                                                        xmlelement("m_szProductCode",xrl.pack_prod_code),
                                                        xmlelement("m_nVolume",tmp.fluid_vol),
                                                        xmlelement("m_szProtocolStep",xps.protocol_step_name))),
                                                    xmlelement("m_ProtParamList",
                                                        xmlagg(
                                                        xmlelement("ParameterValues",
                                                            xmlelement("m_szProtocolName",tmp.protocol_name),
                                                            xmlelement("m_Time",xpsd.parameter_ntime_value))
                                                        group by tmp.ccd_test_id,tmp.intf_mtrl_prod_code)
                    )))
                    order by tmp.ccd_test_id, tmp.intf_mtrl_prod_code, xps.protocol_step_intprotocolstep )
                    from XPR_tdef_mitigation_protocol tmp, xp_reagentlist xrl,
                    xpr_protocol_settings xps, xpr_protocol_settings_default xpsd
                    where tmp.ccd_test_id = tm.ccd_test_id
                    and tmp.ccd_test_id = xrl.ccd_test_id
                    and tmp.pack_prod_code = xrl.pack_prod_code
                    and tmp.intf_type = 1
                    and xps.protocol_name = xpsd.protocol_name
                    and xps.protocol_step_name = xpsd.protocol_step_name
                    and xps.ps_action_parameterlist = xpsd.ps_action_parameterlist
                    and xps.protocol_name =  tmp.PROTOCOL_NAME
                    )))
    from XPtoXPRTdef_defn_mapping tm
    where tm.DisplayName = 'SYPH'
    If I remove the clause xmlagg and the group by clause, the query works well and not give me the result.
    But in this code XML, the output format is incorrect for my application.

    Could someone help out here?

    Now my problem is that this unique coating is more than 32767 characters and utl_file can write 32767 bytes per line.
    Someone deal with this?

    Serialize the output as CLOB and DBMS_XSLPROCESSOR.clob2file procedure used to write to a file:

    DECLARE
      xml_output CLOB;
    BEGIN
      SELECT XMLElement("Department",
               XMLAgg(
                 XMLElement("Employee",e.job_id||' '||e.last_name)
                 ORDER BY e.last_name
               )
             ).getClobVal() AS "Dept_list"
      INTO xml_output
      FROM hr.employees e
      WHERE e.department_id = 30 OR e.department_id = 40;
    
      DBMS_XSLPROCESSOR.clob2file(xml_output, 'XML_DIR', 'test.xml');
    END;
    /
    

Maybe you are looking for