Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Call Function from PLSQL--ORA-31013 : Invalid XPATH expressioon

mustafa_yilmazJul 8 2013 — edited Jul 8 2013

I tried the following SQL statement. when I called function,it giving error.


select *

from v$version;

----

1Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
2PL/SQL Release 10.2.0.3.0 - Production
3CORE              10.2.0.3.0Production
4TNS for Linux: Version 10.2.0.3.0 - Production
5NLSRTL Version 10.2.0.3.0 - Production



function READ_SYSTEM_RESPONSE(PARAM IN CLOB)

  RETURN NUMBER

  AS

    l_namespace varchar2(1000):='xsi:schemaLocation="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader PackageProxy.xsd"

                                xmlns:sh="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader"

                                xmlns:ef="http://www.efatura.gov.tr/package-namespace"

                                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"';

    x  XMLTYPE

      := XMLTYPE('<?xml version="1.0" encoding="UTF-8"?>

                    <sh:StandardBusinessDocument xsi:schemaLocation="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader PackageProxy.xsd"

                      xmlns:sh="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader"

                      xmlns:ef="http://www.efatura.gov.tr/package-namespace"

                      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

                <sh:StandardBusinessDocumentHeader>

                <sh:HeaderVersion>1.0</sh:HeaderVersion>

                </sh:StandardBusinessDocumentHeader>

                </sh:StandardBusinessDocument>');

    CURSOR ana IS

          SELECT 1--EXTRACTVALUE(VALUE (p),'/sh:StandardBusinessDocumentHeader/sh:HeaderVersion',l_namespace) AS IMZA

          FROM TABLE(XMLSEQUENCE (EXTRACT (x,'/sh:StandardBusinessDocument',l_namespace))) p;

    BEGIN

    FOR r IN ana

    loop

    dbms_output.put_line('- - - - - - -');

    end loop;

    RETURN 1;

    EXCEPTION WHEN OTHERS THEN

    dbms_output.put_line(sqlerrm);

      RETURN 0;

    END;

This post has been answered by odie_63 on Jul 8 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 5 2013
Added on Jul 8 2013
2 comments
721 views