REP-300: lack of right parenthesis

Hi, after having migrated from 6i to 10 g I get the above message when I am tryting to generate a report. the main request in the report is this:

Select F.facility_id,
F.domestic_registration_nbr,
F.field_establishment_nbr,
F.primary_business_name
F facilities
where F.ber_status_text = 'ACTIVE'.
and F.facility_id; in (select B1.facility_id
F1 facilities,
ber_action_history B1
where F1.facility_id = B1.facility_id
and F1.ber_status_text = 'ACTIVE '.
& P_WHERE2
and B1.action_type_cd = 'PA')
& P_WHERE1
& P_ORDER

When I comment on the parameters of the query works fine in Toad.

I've been stuck with this problem for days, any help will be greatly appreciated by g.

Try:

function boolean return AfterPForm is
Start
: P_WHERE2: = "" and 1 = 1; ".
return (TRUE);
end;

Tags: Oracle Development

Similar Questions

  • 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

  • One more time: lack of right parenthesis

    Hi guys,.

    I searched the forum for another thread that might give me the answer I'm looking for, but I found no one.

    I'm new to APEX and I have to build a crosstab. To do this, I founded my development on really force crosstab / Pivot report example.

    My package is completely identical it is on that page and I have adapted to the query of the report (= classic, non-interactive) based on PL/SQL, so it fits my needs, the result is:

    DECLARE

    l_return_value VARCHAR2 (32767).

    BEGIN

    l_return_value: = PK_PIVOT. PivotSQL ("SELECT * FROM"Ploegrapport - view "', 'SOD_OMSCHR_LANG, OOD_OMSCHR_LANG, ACT_OMSCHR_LANG, TAAK_OMSCHR_LANG, ORG_NIV4, ORG_NIV5', 'NK_WERKNEMER', 'MIN', 'J_N', nvl (:P2_PAGENUMBER,1));)

    RETURN l_return_value;

    END;

    When I try to run it, I get the error ORA-00907: lack the closing parenthesis.

    When I click on "debug", it changes to:

    debug logging error ORA-06502: PL/SQL: digital or value error: character string of the buffer too small ORA-00907: lack the right parenthesis

    Failed to parse the SQL query:

    ORA-00907: lack of right parenthesis

    When I then click on "debug mode" I get the following:

    ... Run the statement: declare function x return varchar2 is begin DECLARE l_return_value VARCHAR2 (32767). BEGIN l_return_value: = PK_PIVOT. PivotSQL ("SELECT * FROM"Ploegrapport - view "', 'SOD_OMSCHR_LANG, OOD_OMSCHR_LANG, ACT_OMSCHR_LANG, TAAK_OMSCHR_LANG, ORG_NIV4, ORG_NIV5', 'NK_WERKNEMER', 'MIN', 'J_N', nvl (:P2_PAGENUMBER,1));) RETURN l_return_value; END; Returns a null value. end; begin wwv_flow.g_computation_result_vc: = x; end;

    ...... Result = SELECT SOD_OMSCHR_LANG, OOD_OMSCHR_LANG, ACT_OMSCHR_LANG, TAAK_OMSCHR_LANG, ORG_NIV4, ORG_NIV5, MIN (DECODE (NK_WERKNEMER 'XXXXX' J_N, null)) as "XXXXX", MIN (DECODE (NK_WERKNEMER 'XXXXX' J_N, null)) as "XXXXX", MIN (DECODE (NK_WERKNEMER 'XXXXX' J_N, null)) as "XXXXX", MIN (DECODE(NK_WERKNEMER,XXXXX',J_N,null)) as "XXXXX", MIN (DECODE (NK_WERKNEMER Null 'XXXXX' ((, J_N,)) as "XXXXX" MIN (DECODE (NK_WERKNEMER 'XXXXX' J_N, null)) as "XXXXX", MIN (DECODE (NK_WERKNEMER 'XXXXX' J_N, null)) as "XXXXX", MIN (DECODE (NK_WERKNEMER 'XXXXX' J_N, null)) 'XXXXX', MIN (DECODE (NK_WERKNEMER 'XXXXX' J_N, null)) as "XXXXX", MIN (DECODE (NK_WERKNEMER 'XXXXX' J_N, null)) as "XXXXX", MIN (DECODE (NK_WERKNEMER, J_N ' XXXXX', null)) as 'XXXXX '. MIN (DECODE(NK_WERKNE~), MIN (DECODE (NK_WERKNEMER 'XXXXX' J_N, null)) as 'XXXXX'

    (Don't worry the XXXXX, I put it there manually because this is sensitive information, the field is actually correct and represents the names of people.) The query works when I cut the last piece, which is broken, and when I add a group, so the query he built seems to be OK

    As you can see the query in debug is actually broken after 999 characters, this is simply due to the fact that debugging will show no more than 999 characters, or is this really my problem, that the query is broken before the full statement is complete.

    If this is the first option: then where would my problem? If it's the latter: I checked the report query code and the package code and I can't find a reason why this request would be accepted to exist out of 999 characters.

    I am currently working with the test environment Oracle supplied us, because we test if we can use APEX in our company.

    The version is Application Express 4.2.2.00.11 and it is running on Oracle 11 g.

    If you need more information, just ask and I'll post it as soon as possible.

    During the validation of the responses, please keep in mind that I am a beginner at this and have trouble understanding complex responses .

    Thanks for your help!

    NDG

    Hello

    I discovered what the problem was.

    In my data, there is an employee with a '-character in his name and that's what makes the query returns an error. I tried again, this time without taking account of all the names with a '-character and that the query ran successfully, now a column made dynamically for each employee, just as I wanted.

    Thank you Tom for your efforts!

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

  • Formula node error: lack the right parenthesis

    Community salvation OR,.

    I work with the structure of nodes formula for the first time and I came across this error that I can't fix.

    He says he finds a character #, but the strange thing is that there is no character. Is there someone who can help me with this one please?

    Kind regards

    Thomas Ruts

    On your first long form you are missing a closing parenthesis.  It is in the last half of the formula.  You have two left parenthesis, but only a right.

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

  • error: ora-00907 lack the right parenthesis

    Hello


    I don't know where I am doing wrong, please help me


    update of tmp_data_mins p

    SET p.DISPLAY_VOLUME = ((select display_volume from tmp_data_mins

    where RULE_APPLIED =' rule 2: three consecutive time intervals are

    missing with the period ') q

    where (to_char (p.DAYASDATE,'DD/MM/YYYY HH24')) =

    (to_char (q.DAYASDATE,'DD/MM/YYYY HH24'))

    AND p.HOURASNUMBER = q.HOURSNUMBER);


    Thanks in advance

    Your syntax is disabled, you try to make a mixture of subquery and join that is not valid.  It should be something more like:

    update of tmp_data_mins p

    SET p.DISPLAY_VOLUME = (select display_volume

    of tmp_data_mins q

    where q.RULE_APPLIED =' rule 2: three consecutive time intervals are missing the period ' and

    trunc (p.DAYASDATE, 'hh24') = trunc (q.DAYASDATE, 'hh24')

    AND p.HOURASNUMBER = q.HOURSNUMBER)

    where exists (select display_volume

    of tmp_data_mins q

    where q.RULE_APPLIED =' rule 2: three consecutive time intervals are missing the period ' and

    trunc (p.DAYASDATE, 'hh24') = trunc (q.DAYASDATE, 'hh24')

    AND p.HOURASNUMBER = q.HOURSNUMBER);

    I'm not ethat you really need the trunc applied to dates, but it is equivalent to your expression to_char, and it is generally much safer to compare dates in dates rather than convert a date to a string and compare those.

    Also note that, as wrote your query and mine updates all rows in the parameter tmp_data_mins display_volume table to null for rows that do not match the subquery.  You would (probably) need to add another predicate in the outer query the identifu only the lines that you want to update, and there are predicate using the same query in the clause set would be a likely candidate.

    That said, I don't understand what you're trying to accomplish with this update because you're updating at the same table you are querying of.  As said by Frank, a few examples of data and an explanation of what you're trying to accomplish would be useful.

    John

    After seeing just this thread https://community.oracle.com/thread/3560425 I think I understand what you're trying to do and changed the query above (I think) do the update that you want, and it seems that you have the trunc applied to dates.

    Post edited by: John Spencer

  • [Error] Run (): ORA-00907: lack the right parenthesis

    Hello world

    help out me fom this problem

    SELECT (SELECT LPAD (s.b_borough_no, 2, 0) |) '/' || LPAD (s.site_no, 6, '0')

    OF s app.sites@sfm

    ID WHERE = sit_id)

    as full_id,

    TRS.*,

    VP. FINPERID,

    VP. FINPERCH

    OF tr_review_schedules trs, TIMINGREVIEW. VP VW_FINANCIAL_PERIODS

    WHERE the trs.sched_closeout_date BETWEEN (vp. PERSTARTDATE = TO_DATE (APRIL 1, 2011 00:00:00 "," MM/DD/YYYY HH24:MI:SS')))

    AND (vp. PERENDDATE = TO_DATE (APRIL 30, 2011 00:00:00 "," MM/DD/YYYY HH24:MI:SS')))

    AND trs.trd_id IS NOT NULL

    AND trs.reportable = 'Y '.

    ORDER BY 1;

    Your problem is in him between predicate.  The format of is:

    column between value1 and value2

    I don't quite know what you're trying to do with the columns perstartdate and perenddate, but maybe something more like:

    Select (select lpad (s.b_borough_no, 2, 0) |) '/' || LPAD (s.site_no, 6, '0')

    of app.sites@sfm s

    where id = sit_id) as full_id,

    TRS.*, vp.finperid, vp.finperch

    of tr_review_schedules trs, timingreview.vw_financial_periods vp

    where trs.sched_closeout_date between vp.perstartdate and vp.perenddate and

    TRS.trd_id is not null and

    TRS.reportable = 'Y' and

    VP.perstartdate = to_date (April 1, 2011 00:00:00 ',' dd/mm/yyyy hh24:mi:ss') and

    VP.perenddate = to_date (April 30, 2011 00:00:00 ',' hh24:mi:ss' of dd/mm/yyyy)

    order by 1;

    However, I am not convinced that this is between a reasonable join between tr_review_schedules and vw_financial_periods.

    John

  • 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;
    /
    
  • script to return the amount of left & right parenthesis & media

    The copy of ingredients below seems correct you?  Try the evidence and feel our frustration.

    Well, I tend to believe there is an extra right parenthesis, and this is a perfect job for a script. Can we make a script to return:

    Left parentheses: XX

    Right parenthesis: XX

    Left parentheses: XX

    Right media: XX

    Left braces: XX

    Right braces: XX

    or propose another method for the County / evidence. I've been the colorization of sections.

    INGREDIENTS: Dulce De Leche Caramel [corn syrup, sweetened condensed milk (pasteurized milk, sugar), water, palm oil, cream, glycerine, pectin, salt, Phosphate disodium, (emulsifier), soy lecithin, natural and artificial flavor, CARRAGEENAN and Sorbate de Potassium (conservative)], the Whip topping [water, corn syrup, palm kernel oil, sugar, contains less than 2% of the following: COPRA oil] (, (derived from A milk) Sodium caseinate, dextrose, gum Arabic, gum of carbohydrates, salt, xanthan gum, natural flavour, extracted, morning of beta carotene to rice), wheat flour, palm oil, sugar, eggs, pecan nuts, milk, butter [cream (milk), water]. Chocolate drizzle [corn syrup, water, cocoa (processed with alkali),-modified maize starch, glycerine, (conservative) potassium sorbate, artificial flavour], cocoa (processed with Alkali), baking soda, Benzoate de Sodium (conservative)

    CONTAINS: Milk, soy, wheat, eggs, Pecans

    Hi Mike,.

    It's been many moons (10 months) that I posted here. Anyway, I have been 'hidden' forums every day since and did some searching for something today and came across this thread so I decided to post. I don't know whether or not you have received one response from others (cough: Carlos ;-), in any case, perhaps this will help your efforts, otherwise, it's a basic example):

    // ---------------------------------------------------
    // Script Purpose: Check And Count All Brackets
    // Script Name: W_J_T_checkBrackets.js
    // Test Environment: Mac - Illustrator CS5
    // Forum Source: https://forums.adobe.com/thread/1564938
    // © W_J_T 2/24/2015
    // ---------------------------------------------------
    
    function checkBrackets() {
        if (app.documents.length == 0) {
            alert("Script Aborted:\nNo Open Document Found");
            return;
        }
        if (app.activeDocument.selection.length != 1 || app.activeDocument.selection[0].typename != 'TextFrame') {
            alert("Script Aborted:\nPlease select a single text frame and try again");
            return;
        }
        if (app.activeDocument.selection[0].typename == 'TextFrame') {
        // This section returns the # count for each type of bracket:
            var txtString = app.activeDocument.selection[0].contents;
            var LP = txtString.split("(").length - 1;
            var RP = txtString.split(")").length - 1;
            var LB = txtString.split("[").length - 1;
            var RB = txtString.split("]").length - 1;
            var LC = txtString.split("{").length - 1;
            var RC = txtString.split("}").length - 1;
            alert("Results:\n" + "Left Parenthesis:  " + LP + "\nRight Parenthesis:  " + RP + "\nLeft Brackets:  " +LB + "\nRight Brackets:  " + RB + "\nLeft Curly Brackets:  " + LC + "\nRight Curly Brackets:  " + RC);
            // This section returns just the brackets as a string to see the visual sequence:
            alert(returnBrackets(txtString).split('').join(' ') + "\n * visual representation of brackets");
            function returnBrackets(txt) {
                var brackets = /[^()\[\]{}]/g;
                return ("" + txt).replace(brackets, "");
            };
            // This section changes the color to RED, size to 20 and font to Verdana of all brackets in the selected text for easier finding and editing:
            // Note: However keep in mind, the execution time will increase for large portions of text when using this portion of the code.
            var redColor = new RGBColor();
            redColor.red = 255;
            redColor.green = 0;
            redColor.blue = 0;
            var txtString = app.activeDocument.selection[0];
            for (var i = 0, l = txtString.characters.length; i < l; i++) {
                var txtChar = txtString.characters[i];
                if (txtChar.contents == "(" || txtChar.contents == ")" || txtChar.contents == "[" || txtChar.contents == "]" || txtChar.contents == "{" || txtChar.contents == "}") {
                    txtChar.characterAttributes.fillColor = redColor;
                    txtChar.size = 20;
                    txtChar.characterAttributes.textFont = app.textFonts.getByName("Verdana");
                }
            }
        }
    }
    checkBrackets();
    

    I suppose it could be expanded further, but it is a starting point and could, however, be useful for your efforts. It will be useful.

    W_J_T

  • 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

  • RPT to Oracle 10g - REP 300 error: table or view does not exist GROUP BY...

    Hello - I have a request to the Interior of my data model that works very well when I launches the report inside reports developer & works well in TOAD. But when I try to run from our forms 10 g GUI report fails with a REP 300 error: table or view does not GROUP OF S.SOURCE_NAME

    Source_name is my group of field & as mentioned, it works very well to the developer reports & TOAD, so I can't understand why the GUI is having a problem. The GUI uses some features to export the data to Excel. I have no more info on how the GUI do that then maybe no one will be able to help, but if you run into this situation before, any input you have would be greatly appreciated. Thank you!

    Hello

    connect you as a user even in the forms and the TOAD?

  • 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

  • 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'));
    
  • 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 ....
    

Maybe you are looking for