ORA-20103: Null input is not allowed

Hi, Got a bit of a problem I'm struggling with. Hoping someone can help !
I've got some PL/SQL code which performs some simple checks against XML to see if its Malformed.I can't cut and paste the real code due to security constraints but this should give you the gist :
BEGIN
p:=xmlparser.newParser;
xmlparser.parseCLOB(p,c); -- where P is xmlparser.parser and c is a CLOB variable
doc:= xmlparser.getDocument(p);
--Check Elements
--Attributes etc
goes on through the elements etc checking for missing tags etc.
This code worked a treat but then when once in production we started getting some Java out of memory errors so I've added a xmlparser.freeparser(p) and a freedocument once everything is completed (the parser is created and destroyed for each CLOB as part of a cursor loop) but now when I run it I get a ORA-20103: Null input is not allowed error. I've traced it through and it bombs out with this error at the point where it performs the xmlparser.parseCLOB(p,c) call. I've checkd and the Clob variable has a clob in it at the point where parseCLOB is called.
What makes this really interesting is that the ORA-20103 error only occurs when you pass it a clob containing MALFORMED XML !! This didn't happen before I added the freeparser etc !!!
I've compared code and its identical save for the freeparser and freedocument calls, which come well AFTER the parseCLOB command.
Has anyone got any ideas as I'm out of them !!
Thanks in advanced for any help received.
Ta
Si

This should solve your problem
IF (xmldom.isNull(nf) = TRUE) THEN
dbms_output.put_line ('I am NULL');
ELSIF (xmldom.isNull(nf) = FALSE) THEN
dbms_output.put_line ('I am not NULL');
IF xmldom.getNodeType(nf) = xmldom.TEXT_NODE THEN
dbms_output.put_line (xmldom.getNodeValue(nf));
END IF;
END IF ;
Thanks
Devdatt

Similar Messages

  • ORA-01719: outer join operator (+) not allowed in operand of OR or IN

    I am getting the following Error when I tried to execute my Query.
    Error : ORA-01719: outer join operator (+) not allowed in operand of OR or IN
    select unique t.estblmt_src_typ_id as estblmt_src_typ_id,
    t.name as name from estblmt_src_typ t, src_estblmt_unknown_data u, estblmt_src eSrc, estblmt e,
    additional_addr aa, country c, src_country_state_region scsr
    where
    (t.estblmt_src_typ_id=u.estblmt_src_typ_id and
    e.state_region_id=scsr.state_region_id and
    upper(scsr.code1)='UNKNOWN' and
    u.processed_ind = 'N' and
    eSrc.Estblmt_Alt_Id = u.estblmt_alt_id and
    u.estblmt_src_typ_id = eSrc.estblmt_src_typ_id and
    eSrc.Estblmt_Id = e.estblmt_id and
    e.country_id = c.country_id and
    u.estblmt_element = 'State Region' and
    scsr.estblmt_src_typ_id = u.estblmt_src_typ_id and
    aa.estblmt_id(+)=e.estblmt_id and
    e.end_dt is null) or
    (t.estblmt_src_typ_id=u.estblmt_src_typ_id and
    aa.state_region_id=scsr.state_region_id and
    upper(scsr.code1)='UNKNOWN' and u.processed_ind = 'N' and
    eSrc.Estblmt_Alt_Id = u.estblmt_alt_id and
    u.estblmt_src_typ_id = eSrc.estblmt_src_typ_id and
    eSrc.Estblmt_Id = aa.estblmt_id and aa.country_id = c.country_id and (u.estblmt_element = 'Additional State Code' or u.estblmt_element = 'Additional State Province') and scsr.estblmt_src_typ_id = u.estblmt_src_typ_id
    and aa.estblmt_id=e.estblmt_id and e.end_dt is null) order by t.name

    First, is this query being executed within Apex or at the SQL prompt or in SQL Workshop, or something else? Some context of where it's being executed may help.
    Next, that's a query from hell. How about rewrting it to use ANSI join syntax instead, so it'a bit more readable?
    A quick example for part of it would be:
    FROM (additional_addr aa LEFT OUTER JOIN estblmt e ON aa.estblmt_id = e.estblmt_id )
    etc.
    Just add additional parenthesis for each additional table join, similar to:
    FROM ((additional_addr aa LEFT OUTER JOIN estblmt e ON aa.estblmt_id = e.estblmt_id )
    LEFT OUTER JOIN src_country_state_region scsr ON aa.state_region_id = scsr.state_region_id )
    In the long run it will make the query a bit more legible, so your where clause only lists the query conditions, not the join conditions. Then it becomes easier to quickly glance at it and see where potential problems may be.
    Bill Ferguson

  • Outer Join problems - "ORA-30563 outer join operator (+) not allowed in select-list"

    Products: Discoverer 4.1.33.0.2
    (Admin and User/Plus)
    8i EE 8.1.7 (Discoverer server)
    8i EE 8.1.5 ('source data' server)
    Background assumptions: (1) If a column from an "outer-joined" table is compared to a constant, the outer join operator must be applied to that column in order for the outer join to work. (2) A 'Condition' specified in Discoverer User/Plus manifests as a comparison to a constant.
    I created a join in Admin between two folders, selected 'outer join on detail' option. In User/Plus, created worksheet containing columns from the joined folders. When no Conditions are NOT specified, results seem ok. However, when Condition IS added, worksheet encounters "ORA-30563 outer join operator (+) not allowed in select-list" and returns blank sheet.
    To workaround, created Custom folder with outer join in place. Didn't work either with Conditions specified. No error, but I think that because Discoverer did not 'outer join' the Condition column, the outer join was ignored.
    Any insights, ideas, or workarounds are much appreciated.
    -Jim

    If you build a query that uses an outer join then any items from the potentially deficient side of the join will have (+) appended to them everywhere in the sql. Up until 8.1.7 this was OK in the select list as it was just treated as noise and ignored - However this now fails with ORA-30563:
    outer join operator (+) not allowed in select-list...
    In 4.1.33.1.6 you get the error 'ORA-30563 outer join operator(+) not allowed in select list'.
    In 4.1.36.1.10 the query runs OK.. Your work around I would guess would be to create a custom folder as you suggested.

  • ORA-00934: group function is not allowed here

    Hi,
    My requirement is to check oi.quantity is equal to sum of packing_detail. quantity
    by order_number
    select oi.quantity_ordered oi_qu, pd.quantity pq
    from ordered_items oi, packing_details pd
    where oi.ordered_item_id = pd.ordered_item_id
    and oi.quantity_ordered = sum(pd.quantity)
    and oi.order_number = '29';
    after executing above query I get error
    SQL Error: ORA-00934: group function is not allowed here
    00934. 00000 - "group function is not allowed here"
    Please tell me how to resolve it.
    Thanks in advance
    Sandy

    You have to make use of a subquery;
    select oi.quantity_ordered oi_qu, pd.quantity pq
    from ordered_items oi, packing_details pd 
    where oi.ordered_item_id = pd.ordered_item_id 
    and oi.quantity_ordered = *(select sum(pd.quantity) from packing_details pd1 group by pd1.ordered_item_id)* 
    and oi.order_number = '29';  This is based on the assumption that ordered_items is the summarize data and packing_details are the line item level data.
    regards,
    Dipankar.

  • PL/SQL: ORA-00934: group function is not allowed here

    Hi,
    I am writing a PL/SQL procedure. The structure is like :
    SET SERVEROUTPUT ON;
    CREATE OR REPLACE Procedure abc
    IS
    v_total_ip_rec number(14);
    v_total_op_rec number(14);
    v_total_rec number(14);
    BEGIN
    SELECT SUM (CASE
    WHEN <condition 1>
    THEN 1
    ELSE 0
    END
    ) into v_total_ip_rec,
    SUM (CASE
    WHEN <condition 2>
    THEN 1
    ELSE 0
    END
    ) into v_total_op_rec,
    SUM (1) into v_total_rec
    FROM A,B
    WHERE A.Col1=B.Col1;
    EXCEPTION
    WHEN OTHERS THEN
    raise_application_error(-20001,'An error was encountered - '||SQLCODE||' -ERROR- '||SQLERRM);
    END;
    When I run this procedure it gives me following error:
    "PL/SQL: ORA-00934: group function is not allowed here"
    Anybody have any idea?
    Any help would be appreciated.
    Thanks.

    Hi Arunkumar ,
    I think you don't need subquery.
    Regards Salim.
    Or.
    SELECT COUNT (CASE
                     WHEN <condition 1>
                        THEN 1
                  END) v_total_ip_rec,
           COUNT (CASE
                     WHEN <condition 2>
                        THEN 1
                  END) v_total_op_rec,
           COUNT (1) v_total_rec
      FROM a, b
    WHERE a.col1 = b.col1

  • Receiving an ORA-31020: The operation is not allowed...

    I'm trying to use a stylesheet that has several included stylesheets.
    It looks something like this...
    <?xml version='1.0'?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:include href="http://fhamiwsdt01/AMIWeb/namespaces/AmerisureClient.xsl"/>
    <xsl:include href="http://fhamiwsdt01/AMIWeb/namespaces/AmerisurePolicy.xsl"/>
    <xsl:include href="http://fhamiwsdt01/AMIWeb/namespaces/AmerisureRetailAgent.xsl"/>
    <xsl:include href="http://fhamiwsdt01/AMIWeb/namespaces/TransactionUtilities.xsl"/>
    My procedure is to grab an xml an bump it up against the stylesheet as follows.
    CREATE OR REPLACE FUNCTION transformPolicyXml RETURN CLOB IS
    -- Define the local variables
    xmldata XMLType;
    xsldata XMLType;
    newxml XMLType;
    xml clob;
    xsl clob;
    error varchar2(200);
    BEGIN
    -- Get the XML document using the getXML() function defined in the database.
    -- Since XMLType.transform() method takes XML data as XMLType instance,
    -- use the XMLType.createXML method to convert the XML content received
    -- as CLOB into an XMLType instance.
    xml := getxml('Policy.xml');
    xmldata := XMLType.createXML(xml);
    -- Get the XSL Stylesheet using the getXSL() function defined in the database.
    -- Since XMLType.transform() method takes an XSL stylesheet as XMLType instance,
    -- use the XMLType.createXML method to convert the XSL content received as CLOB
    -- into an XMLType instance.
    xsl := getxml('Amerisure EAI XSLT.xsl');
    xsldata := XMLType.createXML(xsl);
    -- Use the XMLtype.transform() function to get the transformed XML instance.
    -- This function applies the stylesheet to the XML document and returns a transformed
    -- XML instance.
    newxml := xmldata.transform(xsldata);
    -- Return the transformed XML instance as a CLOB value.
    RETURN newxml.getClobVal();
    EXCEPTION WHEN OTHERS THEN
    error := sqlerrm;
    raise_application_error (-20102, 'Exception occurred in transformPolicyXml :'||SQLERRM);
    END transformPolicyXml;
    The following statement is what causes an error:
    newxml := xmldata.transform(xsldata);
    the error i'm receiving is ORA-31020: The operation is not allowed, Reason: For security reasons, ftp and http access over XDB repository is not allowed on server side.
    Is there anyway to get around this error?

    As the error says, the XML DB does not allow ftp or http access to remote objects.
    You will need to make all your includes local to the DB server.

  • The 'Access-Control-Allow-Origin' header contains multiple values '*, *', but only one is allowed. Origin 'null' is therefore not allowed access.

    Hello. I added custom http response headers to my SP site web config file as follows: 
    <httpProtocol>
          <customHeaders>
                 <add name="Access-Control-Allow-Methods" value="POST,GET,OPTIONS" />
          <add name="Access-Control-Allow-Origin" value="*" />
          <add name="Access-Control-Allow-Headers" value="Content-Type,Authorization" />
          </customHeaders>
        </httpProtocol>
    When I try to call any web service, i get these headers two times each: 
    HTTP/1.1 200 OK
    Cache-Control: private, max-age=0
    Transfer-Encoding: chunked
    Content-Type: application/atom+xml;type=entry;charset=utf-8
    Expires: Sat, 01 Mar 2014 19:11:37 GMT
    Last-Modified: Sun, 16 Mar 2014 19:11:37 GMT
    ETag: "3"
    X-SharePointHealthScore: 0
    SPClientServiceRequestDuration: 20
    SPRequestGuid: b4e77d9c-bfc3-a050-493a-ca5d251d1a72
    request-id: b4e77d9c-bfc3-a050-493a-ca5d251d1a72
    X-FRAME-OPTIONS: SAMEORIGIN
    Persistent-Auth: true
    Access-Control-Allow-Methods: POST,GET,OPTIONS
    Access-Control-Allow-Origin: *
    Access-Control-Allow-Headers: Content-Type,Authorization
    X-AspNet-Version: 4.0.30319
    X-Powered-By: ASP.NET
    Access-Control-Allow-Methods: POST,GET,OPTIONS
    Access-Control-Allow-Origin: *
    Access-Control-Allow-Headers: Content-Type,Authorization
    MicrosoftSharePointTeamServices: 15.0.0.4569
    Date: Sun, 16 Mar 2014 19:11:37 GMT
    and that gives me error from ajax: The 'Access-Control-Allow-Origin'
    header contains multiple values '*, *', but only one is allowed. Origin 'null' is therefore not allowed access.
    The 'Access-Control-Allow-Origin' header contains multiple values '*, *', but only one is allowed.
     Origin 'null' is therefore not allowed access.
    Any idea???

    Hi Ann,
    Please check whether there are duplicate custom headers in your code.
    Similar issue for your reference:
    http://social.msdn.microsoft.com/Forums/office/en-US/b79b75f4-b46b-46ae-ae29-17a352b6b90b/custom-http-response-headers-for-sp-2013-shown-2-times?forum=sharepointdevelopment 
    Regards,
    Rebecca Tu
    TechNet Community Support

  • ORA-2935 - relative pathnames are not allowed - help needed

    I'm trying to generate XML document from a query using XSU and applying stylesheet with DBMS_XMLQUERY.setXSLT() procedure.
    I've got the following PL/SQL code:
    DECLARE
    q DBMS_XMLQUERY.ctxtype;
    result clob;
    BEGIN
    q := DBMS_XMLQUERY.newcontext('select * from test_xml1');
    DBMS_XMLQUERY.setxslt(q,'c:\test_xsl.xsl');
    result := DBMS_XMLQUERY.getxml(q);
    printclobout(result);
    DBMS_XMLQUERY.closecontext(q);
    END;
    and stylesheet (I made the simplest example possible):
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version = "1.0">
    <xsl:output indent="yes"/>
    <xsl:template match="ROW/COLUMNA1">
    <COL1><xsl:value-of select="COLUMNA1"/></COL1>
    </xsl:template>
    </xsl:stylesheet>
    and I'm getting error
    ORA-29532: Java call terminated by uncaught Java exception: java.lang.SecurityException: relative
    pathnames are not allowed(c:\test_xsl1.xsl)
    What am I doing wrong?
    How the DBMS_XMLQUERY.setXSLT() procedure should be used?
    Where is the DBMS_XMLquery package expecting to find the XSL file? Does the XSL stylesheet have to be stored in a database table, retrieve it and have it applied, or does it need to be an external file?
    Please help!
    Thanks!

    Hi,
    If you don't want these two columns ignore them in SELECT statement.
    If this is what you are looking for try this
    SELECT air_cntl_number, air_id, awos_cntl_number, NAME, elipsoid_elevation,
           state_code, country_code, airport_code, LOCATION, field_elevation,
           datum, magnetic_variance, magnetic_variance_year, weather_station,
           control_tower, control_zone, control_zone_operational,
           designated_enrout_airport_afis, sectional_chart, telephone_nbr,
           flight_inspection, procedure_development, region_code,
           audit_crt_datetime, audit_crt_user_id, audit_updt_datetime,
           audit_updt_user_id, lat_degree, lat_minute, lat_second, long_degree,
           long_minute, long_second, lat_dir, long_dir, pseudo, magvar_dir,
           icao_code, CATEGORY, vertical_datum, airport_use, nfdc_ident,
           icao_location_code,
            --NULL as AIRPORT_SPATIAL_LOCATION,
           official_use_flag, part_139_flag, survey_code,
           airport_ellip_elev_source, status_code, air_revision_number,
           air_revision_date, approach_landing_number,
           --NULL as  ACTIVATION_DATE,
           tpp_vol,
           ROW_NUMBER () OVER ( PARTITION BY  air_cntl_number
                               ,                  air_revision_number
                         ORDER BY       status_code        -- assuming 'A' and 'H' are the only possible values
                          )  AS r_num
      FROM
    mv_airport_all t
      where t.audit_updt_datetime = (Select max(AUDIT_UPDT_DATETIME) from MV_AIRPORT_ALL
      where AIR_CNTL_NUMBER=t.AIR_CNTL_NUMBER and AIR_REVISION_NUMBER= t.AIR_REVISION_NUMBER)Thanks

  • ORA-01719: outer join operator (+) not allowed in operand of OR

    Hi all:
    I understand the error, but I'm not sure how to fix my query. In our database, a person does not NEED to have an address. The report I'm trying to create has a parameter for which address the user would like to have displayed. BUT, I need to outer join to the address table since people don't need an address, but we'd want to display all records, even if the address is null. Here's only part of my code since the query is quite large. Let me know if more is needed, and I'll supply it. I'm definately stuck. At this point I'm thinkin' of just creating two reports; one that displays the clients address, and a second that'll display the house physical address. The code:
    WHERE
    :P_ADDR = 'Lessee Mailing Address' AND
    lessee.actor_inst = address.actor_inst (+)
    ) OR (
    :P_ADDR = 'Unit Address' AND
    housing.actor_inst = address.actor_inst (+)
    ) AND

    Stick with ANSI SQL Notation, then you can overcome this restriction.
    See Back to basics: outer joins
    and look for »ORA-01719«

  • ORA-02021: DDL operations are not allowed on a remote database

    Hi,
    While creating a trigger to keep track of every deletion on a remote table, I am receiving this error.
    I am not using any DDL within my trigger.
    My trigger code is:
    CREATE OR REPLACE TRIGGER neeraj.iuc_trig
    before delete on neeraj_test@iuc
    for each row
    DECLARE .........................
    Here iuc is public database link.
    Any idea ?
    Regards,
    Neeraj

    Hi Neeraj,
    you cannot define a trigger on a remote table.
    why don't you define the trigger just directly on
    the remote db.
    You can define some insert/update ... operations
    on "your" db in your trigger.
    you need a db_link for that on your remote-db
    to your "original"-db
    update emp@orig_db ...
    Regards
    Schoeib
    Message was edited by:
    schoeib

  • ORA-00934: group function is not allowed here Error - On validation screen

    Can anyone help me with this funtion Returning boolean PL/SQL expression
    begin
    select max(sim_trip.finish_time) into finish_time,
          max(sim_trip.start_time) into start_time  from sim_trip
    WHERE ((sim_trip.operator_counter = :P500_operator_counter));
    if (:P500_start_time > finish_time)
       then   return true;
    else
    return false;
    end if;
    end;

    Lucy,
    begin
    select max(sim_trip.finish_time) into finish_time,
          max(sim_trip.start_time) into start_time  from sim_trip
    WHERE ((sim_trip.operator_counter = :P500_operator_counter));
    if (:P500_start_time > finish_time)
       then   return true;
    else
    return false;
    end if;
    end;Your select statement is wrong. It should be:
    begin
    select max(sim_trip.finish_time),max(sim_trip.start_time)
      into :P500_start_time,:P500_finsh_time 
      from sim_trip
      WHERE ((sim_trip.operator_counter = :P500_operator_counter));
    if (:P500_start_time > :P500_finish_time)
       then   return true;
    else
    return false;
    end if;
    end;Robert
    http://apexjscss.blogspot.com

  • ORA-22902 CURSOR expression not allowed Error Cause: CURSOR on a subquery..

    Hi,
    I found same issue in a metalink thread which is addressed in Oracle 12.1 which doesn't help me now. I need to rewrite the below query. Does anyone have any suggestions how to go about it?
    thanks,
    April
    working in Oracle 11.2.0.3.1, windows server, doing an upgrade from 10g to 11g. Piece of code is failing with following error via TOAD
    Oracle Database Error Code ORA-22902 Description :
    CURSOR expression not allowed
    Error Cause:
    CURSOR on a subquery is allowed only in the top-level SELECT list of a query.
    The below code is returning a tree of data for projects, units within the buildings.
    Code as follows:
    SELECT LEVEL
    , p.project_id
    || NVL (p.file_ref, ' ')
    || '] ['
    || NVL (p.project_ref, ' ')
    || '] '
    || p.project_name
    || ' ( '
    || (SELECT COUNT (*)
    FROM PROJECT p1
    WHERE p1.parent_project_id = p.project_id)
    || ' sub-projects, '
    || (SELECT COUNT (*)
    FROM PROJECT_ELEMENT pe2
    WHERE pe2.project_id = p.project_id)
    || ' elements)' AS project_description
    CURSOR
    (SELECT pe.element_id
    || pe.element_ref
    || '] '
    || pe.element_name
    || ' ('
    || pe.unit_count
    || ')' AS element_description
    CURSOR
    (SELECT hu.hu_id
    || hu.hu_ref
    || '] '
    || CASE
    WHEN hu.bedroom_count IS NOT NULL
    THEN ', Bedrooms: ' || hu.bedroom_count
    ELSE NULL
    END
    || CASE
    WHEN hu.bedspace_count IS NOT NULL
    THEN ', Bedspaces: ' || hu.bedspace_count
    ELSE NULL
    END AS hu_descripton
    FROM HOUSING_UNIT hu
    WHERE hu.element_id = pe.element_id
    ORDER BY hu.hu_ref
    ) AS housing_units
    FROM PROJECT_ELEMENT pe
    WHERE pe.project_id = p.project_id
    ORDER BY pe.element_ref, pe.element_name
    ) elements
    FROM PROJECT p
    START WITH p.project_id = l_root_project_id
    CONNECT BY PRIOR p.project_id = p.parent_project_id -- connect by used with LEVEL keyword
    ORDER SIBLINGS BY p.file_ref DESC
    , p.project_ref DESC
    , p.project_name DESC;
    Edited by: AprilM on Jul 17, 2012 10:28 AM

    Interesting. I am getting even worse results on 11.2.0.1.0:
    SQL> select * from v$version
      2  /
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    SQL> select dname,cursor(select ename from emp e where e.deptno = d.deptno) from dept d
      2  /
    select dname,cursor(select ename from emp e where e.deptno = d.deptno) from dept d
    ERROR at line 1:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-00905: missing keyword
    SQL> connect scott
    Enter password: *****
    Connected.
    SQL> select * from v$version
      2  /
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod
    PL/SQL Release 10.2.0.4.0 - Production
    CORE    10.2.0.4.0      Production
    TNS for 32-bit Windows: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    SQL> select dname,cursor(select ename from emp e where e.deptno = d.deptno) from dept d
      2  /
    DNAME          CURSOR(SELECTENAMEFR
    ACCOUNTING     CURSOR STATEMENT : 2
    CURSOR STATEMENT : 2
    ENAME
    CLARK
    KING
    MILLER
    RESEARCH       CURSOR STATEMENT : 2
    CURSOR STATEMENT : 2
    ENAME
    SMITH
    JONES
    SCOTT
    ADAMS
    FORD
    SALES          CURSOR STATEMENT : 2
    CURSOR STATEMENT : 2
    ENAME
    ALLEN
    WARD
    MARTIN
    BLAKE
    TURNER
    JAMES
    6 rows selected.
    OPERATIONS     CURSOR STATEMENT : 2
    CURSOR STATEMENT : 2
    no rows selected
    SQL> And double CURSOR also works fine in 10g:
    SQL> select cursor(select dname,cursor(select ename from emp e where e.deptno = d.deptno) from dept d) from dual
      2  /
    CURSOR(SELECTDNAME,C
    CURSOR STATEMENT : 1
    CURSOR STATEMENT : 1
    DNAME          CURSOR(SELECTENAMEFR
    ACCOUNTING     CURSOR STATEMENT : 2
    CURSOR STATEMENT : 2
    ENAME
    CLARK
    KING
    MILLER
    RESEARCH       CURSOR STATEMENT : 2
    CURSOR STATEMENT : 2
    ENAME
    SMITH
    JONES
    SCOTT
    ADAMS
    FORD
    SALES          CURSOR STATEMENT : 2
    CURSOR STATEMENT : 2
    ENAME
    ALLEN
    WARD
    MARTIN
    BLAKE
    TURNER
    JAMES
    6 rows selected.
    OPERATIONS     CURSOR STATEMENT : 2
    CURSOR STATEMENT : 2
    no rows selectedSY.
    Edited by: Solomon Yakobson on Jul 17, 2012 1:27 PM

  • PL/SQL equivalent of T-SQL - "group function is not allowed here"

    Hi all, hope someone can give me a hand as I'm pretty stuck! I have been trying to convert some MS SQL Server T-SQL statements into Oracle PL/SQL and am stuck on the below one:
    SELECT
    CA.AssessmentID,
    (SELECT ProductName + ISNULL(' - ' + PrincipalBenefit,'')
    FROM rptPolicySnapshot WHERE PolicyID = MAX(CA.PolicyID)
    AND SnapshotID = 1),
    MAX(CA.PolicyID)
    FROM rptClaimInvoiceLineSnapshot CIL
    INNER JOIN rptClaimAssessmentSnapshot CA
    ON CIL.AssessmentID = CA.AssessmentID
    AND CIL.SnapshotID = CA.SnapshotID
    WHERE CIL.SnapshotID = 1
    GROUP BY CA.AssessmentID
    This works fine in MSSQL but returns the below error in Oracle:
    'ORA-00934: group function is not allowed here'
    If I take out the subquery the query works fine.
    Any ideas as to the syntax? I am new to Oracle so not sure as to how I should go about writing this.
    Thanks in advance!
    Leo

    WITH x AS (SELECT   ca.assessmentid,
                        MAX (ca.policyid) policy_id
               FROM rptclaiminvoicelinesnapshot cil
                    INNER JOIN rptclaimassessmentsnapshot ca
                        ON cil.assessmentid = ca.assessmentid
                       AND cil.snapshotid = ca.snapshotid
               WHERE cil.snapshotid = 1
               GROUP BY ca.assessmentid
    SELECT x.assessment_id,
           x.policy_id,
           productname + decode(principalbenefit,null,null,' - ' || principalbenefit ) prodname
    FROM   rptpolicysnapshot, x
    WHERE  policyid = x.policy_id
    AND    snapshotid = 1I think that's in the neighbourhood.

  • Getting Group Function is not Allowed

    Hello All....
    When I run the following in the SQL command screen it works fine... But when I try to use it in APEX to populate page values, it gives me the error...
    ERROR
    1 error has occurred
    ORA-06550: line 25, column 74: PL/SQL: ORA-00934: group function is not allowed here ORA-06550: line 24, column 1: PL/SQL: SQL Statement ignored
    CODE THAT WORKS IN SQL COMMAND SCREEN
    SELECT
    SUM(CASE WHEN SLOT = 'Q' THEN '1' ELSE '0' END) AS C_SLOT,
    SUM(CASE WHEN TEST = 'P' THEN '1' ELSE '0' END) AS C_TEST,
    FROM TBL_REC;
    CODE THAT GIVES ERROR ON APPLICATION EXPRESS PAGE
    SELECT
    SUM(CASE WHEN SLOT = 'Q' THEN '1' ELSE '0' END) INTO :P2_C_SLOT,
    SUM(CASE WHEN TEST = 'P' THEN '1' ELSE '0' END) INTO :P2_C_TEST,
    FROM TBL_REC;
    The colums SLOT and TEST have letter codes, I just want it to count just when it matches a certain letter. In the SQL Command Screen, it is returning one row, with the counts, everything is fine. It is only a problem when I try to use it anywere on a page in Application Express.
    The full version has about 20 lines that are all sum lines, but I can not even get the 2 line ver above to work.
    Any thoughts?

    This will work .. the into clause goes after the select columns ... into var1 ,var2 etc ..
    SELECT SUM(CASE
                 WHEN SLOT = 'Q' THEN
                  '1'
                 ELSE
                  '0'
               END),
           SUM(CASE
                 WHEN TEST = 'P' THEN
                  '1'
                 ELSE
                  '0'
               END)
      INTO :P2_C_SLOT, :P2_C_TEST,
      FROM TBL_REC;SS

  • Write File.vi does not allow for offset entry

    I am using a Write File.vi to write data to my hard drive like always but I have never used the offset before and it is not allowing me to enter an offset value and the error message does not make sense. The error says you have wired different data types but then say source long, sink long which are the same in my eyes.
    Is there a trick to using the offset?

    If you are writing to file different data types, the use of input is not allowed because it depends on the number of bytes used to store the type (that's why it should be just one type)

Maybe you are looking for

  • E72 upgrade to 054.005 Error message 12014

    Hi Folks I am trying to upgrade from 052.005 to 054.005. There is a problem with installing the software to your device .... Error 12014. Nokias online support only seems to tell me what I already did... I note that some people say you shouldn't use

  • Licensing cost: For SAP R/3 4.7 to ECC 6.0 Upgrade

    Hello, I am planning to upgrade my SAP R/3 4.7 System to ECC 6.0. I would like to know whether any additional Licensing cost is involved for this SAP software upgrade. Also, I have three system landscape. Can you give me some pointers to SAP Upgrade

  • App store not working after installing Mavericks

    After I installed OS Mavericks the app store no longer responds. This means I cannot install any of the updates. The notes app is also not working. I can start the programmes but they do not respond or close. I have to literraly close them through th

  • SpaceX seeking full-time LabVIEW programmer to join Texas team!

    Please email [email protected] for more info. General Description below... The Company SpaceX is a US based space technology company founded by its residing CEO and CTO, Elon Musk, the former co-founder of PayPal. The company's goal is to re

  • No startup, blinking folder, VERY hot

    Been about 4months since I tried last, but figured I'd give it a shot here. My 2007 iMac won't startup. Only shows blinking folder with question mark, and back of comp gets VERY hot if stays on. Tried doing they keyboard thing with apple key etc.., n