Error using XMLTYPE & Cursor

Please help me on rectifying my query. this query returns
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "SYS.XMLTYPE", line 343
ORA-06512: at line 1
               SELECT          xmlelement("worflowAGMT",
               XMLTYPE(CURSOR (SELECT
                                             xmlelement("AGMT",
                                                       xmlelement("auditData"),                                        
                                                       xmlelement("AGMTID",h.AGMT_unq_id),
                                                            xmlelement("AGMTLevelValue", i.level_value),
                                                            xmlelement("AGMTSeqNbr", i.level_value),--not selected
                                                            xmlelement("nofication",
                                                            xmlelement("notificationId", i.notification_id),
                                                                 xmlelement("isNotifyInitiator", j.initiator_user_flag),
                                                                 xmlelement("isNotifyApprover", j.approver_user_flag),
                                                                 xmlelement("isNotifyReject", j.approver_user_flag),
                                                                 xmlelement("isNotifyCustomUsers", j.initiator_user_flag),
                                                            xmlelement("notifyCustomUsers",
                                                                 xmlelement("auditData"),
                                                                      xmlelement("notifyCustomId", k.notification_custom_id),
                                                                      xmlelement("role", xmlelement("roleId",k.role_id)),
                                                                      xmlelement("department", xmlelement("departmentId", k.department_id)),
                                                                      xmlelement("company", xmlelement("companyId", k.company_id)),
                                                                      xmlelement("division", xmlelement("divisionId", k.division_id))
               FROM WORKFLOW_AGMT_TBL h,
               AGMT_TBL i,
               NOTIFC_TBL j,
               NOTIFC_CUSTOMUSR_TBL k
               WHERE h.workflow_unq_id = x.workflow_unq_id
               AND h.AGMT_unq_id = i.AGMT_unq_id
               AND i.notification_id = j.notification_id
               AND j.notification_id = k.notification_id
               )))--worflowAGMT                         
               FROM WORKFLOW_TBL x, WF_WORKFLOW_TYPE y
               WHERE y.workflow_type_id = x.workflow_type_id

Hi,
Most often, you get this type of error with CURSOR expression when it does not return any row, then the XMLType constructor fails.
But it's hard to say here as you don't provide sample data.
It looks like you want to aggregate rows coming from the CURSOR subquery. It's better to use XMLAgg function in this case.
Something like :
SELECT xmlelement("worflowAGMT",
        ( SELECT xmlagg(
                   xmlelement("AGMT",
...

Similar Messages

  • Error using XMLType.transform() parammap argument

    Hello;
    I've hit a snag trying to pass top-level XSLT parameter via XMLType.transform's parammap argument.
    Whenever I run the code sample at the end of this message on 9.2.0.1.0, I get the following error:
    ORA-00600: internal error code, arguments: [KGHAL02], [0x0], [], [], [], [], [], []
    This error does not occur if you remove the 'name=value' parammap value.
    Any ideas?
    Brian.
    set serveroutput on
    declare
         stylesheet xmltype;
         result xmltype;
         xmldoc xmltype;
    begin
         stylesheet := XMLType(
    '<?xml version="1.0"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    >
    <xsl:param name="name"/>
    <xsl:output
    method="xml"
    />
    <xsl:template match="hello" >
         <xsl:value-of select="text()"/>
    </xsl:template>
    </xsl:stylesheet>'
         xmldoc := XMLType('<hello>world </hello>');
         result := xmldoc.transform(stylesheet,'name=value');
         dbms_output.put_line(result.getStringVal());
    end;
    /

    I've worked around this bug successfully by using dbms_xslprocessor package directly - but yuck. The dbms_xslprocessor and related packages is pretty messy to work with.
    I also ran into problems implementing the workaround as dbms_xmldom.getDocumentElement could not find the root element on the resulting DOMDocumentFragment (converted appropriately using dbms_xmldom.makeDocument - sigh). I had to write the fragment (converted to a node first using dbms_xmldom.makeNode - heavy sigh) to a clob (dbms_xmldom.writeToClob), and then reload it using dbms_xmldom.newDOMDocument). Not to mention having to remember to freeXXX all the things I had to create.
    Gross... 4 times the code with lots more opportunities for bugs & leaks.
    Brian.

  • Invalid SQL error using REF CURSOR

    I'm getting an "invalid SQL statement" in my function that is returning a REF CURSOR. I have tested this function in SQL*Plus and it works fine.
    -- package level variable
    TYPE t_cursor IS REF CURSOR;
    Function find_patient
         p_ssan IN varchar2,
         p_patient_details OUT t_cursor
         RETURN t_cursor
         IS
         v_cursor t_cursor;
         BEGIN
         OPEN v_cursor FOR
         SELECT name,sex,pay_grade,
              FLOOR(MONTHS_BETWEEN(sysdate,birthdate) / 12) AS age,
              patient_num
         FROM patient
         WHERE ssan = p_ssan;
         p_patient_details := v_cursor;
         RETURN p_patient_details;
         END find_patient;
    -- C# code
    OracleParameter ssan_in = new OracleParameter("p_ssan",OracleDbType.Varchar2);
    OracleParameter cursor_out = new OracleParameter("p_patient_details",OracleDbType.RefCursor);
    cmd.Parameters.Add(ssan_in).Direction = ParameterDirection.Input;
    cmd.Parameters.Add(cursor_out).Direction = ParameterDirection.Output;
    ssan_in.Value = "555555555";
    OracleRefCursor cur = (OracleRefCursor) cursor_out.Value;
    try
    dbconn.Open();
                        OracleDataReader dr = cmd.ExecuteReader();
                        while (dr.Read())
                             pat_name.Text = dr["NAME"].ToString();
                             age.Text = dr["AGE"].ToString();
                             rank.Text = dr["PAY_GRADE"].ToString();
                             gender.Text = dr["SEX"].ToString();
                             pat_num.Text = dr["PATIENT_NUM"].ToString();
    Any suggestions?

    First, you have an output parameter of type ref cursor and a return value. You shouldn't have both.
    Second, try CommandType.Text and a CommandText like:
    "begin :rc := find_patient(:ssan); end;"
    It's easier to see how to bind the parameters like that. Bind first a OracleRefCursor output parameter, then an ssan%type InputParameter.
    David

  • Restrictions while using ref cursor inside an xmltype

    Hi,
    Looks like that getclobVal() can't be used in select where select statement is ref cursor for xmltype.
    example
    SQL> select xmltype(cursor(select xmltype('<a>1</a>').getclobval() from dual)) from dual;
    select xmltype(cursor(select xmltype('<a>1</a>').getclobval() from dual)) from dual
    ERROR at line 1:
    ORA-03001: unimplemented feature
    ORA-22806: not an object or REF also doesn't work the following select
    SQL> select xmltype(cursor(select xmltype('<a>'||lpad('a',1,'a')||'</a>') from dual)) from dual;
    ERROR:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00234: namespace prefix
    "XMLTYPE_x0028__x0027__x003C_A_x003E__x0027__x007C__x007C_LPAD_x0028_" is not
    declared
    Error at line 4
    ORA-06512: at "SYS.XMLTYPE", line 334
    ORA-06512: at line 1DB version 10.2.0.1
    Ants
    Message was edited by:
    Ants Hindpere

    I'm not sure if it is about datatypes per se. Looks to more of a restriction of the XMLTYPE object itself:
    SQL> select cursor (select xmltype ('<A>1</A>').getclobval () a from dual) from dual
    select cursor (select xmltype ('<A>1</A>').getclobval () a from dual) from dual
    Error at line 0
    ORA-03001: unimplemented feature
    ORA-22806: not an object or REF
    but astonishingly
    SQL> select cursor (select xmlelement(A, 1).getclobval () a from dual) from dual
    Cursor (A)
    <A>1</A> 

  • JAXB 2.0 with JXDM gives error.  Use @XmlType.name and @XmlType.namespace

    Hi,
    I am getting the below error for JXDM when using. It was mentioned in http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6302524 that it is fixed. Still getting this error.
    a) Appreciate if anyone can tell how to use the bug fix b20 that is mentioned in the above? I downloaded the latest jaxb 2.0 from this site and also from the jaxb RI(Reference Implementation and tried both).
    b) Is there any workaround to get through this?
    Will appreciate if any one can give advise on this.
    ************** Here is the error message ******************
    There was this problem creating a context com.sun.xml.bind.v2.runtime.IllegalAnn
    otationsException: 1 counts of IllegalAnnotationExceptions
    Two classes have the same XML type name "usStateCodeType". Use @XmlType.name and
    @XmlType.namespace to assign different names to them.
    this problem is related to the following location:
    at gov.ojp.it.jxdm.usps_states._1.USStateCodeType
    at protected gov.ojp.it.jxdm.usps_states._1.USStateCodeType gov.
    ojp.it.jxdm._3_0_2.proxy.usps_states._1.USStateCodeType.value
    at gov.ojp.it.jxdm._3_0_2.proxy.usps_states._1.USStateCodeType
    at protected gov.ojp.it.jxdm._3_0_2.proxy.usps_states._1.USState
    CodeType generated.CjsAddressType.locationStateCodeUSPostalService
    at generated.CjsAddressType
    at protected java.util.List generated.CjsPersonType.personAddres
    s
    at generated.CjsPersonType
    at protected generated.CjsPersonType generated.CjsSuspectType.su
    spectPerson
    at generated.CjsSuspectType
    at protected generated.CjsSuspectType generated.CjsReportType.su
    spect
    at generated.CjsReportType
    at public generated.CjsReportType generated.ObjectFactory.create
    CjsReportType()
    at generated.ObjectFactory
    this problem is related to the following location:
    at gov.ojp.it.jxdm.fips_5_2._1.USStateCodeType
    at protected gov.ojp.it.jxdm.fips_5_2._1.USStateCodeType gov.ojp
    .it.jxdm._3_0_2.proxy.fips_5_2._1.USStateCodeType.value
    at gov.ojp.it.jxdm._3_0_2.proxy.fips_5_2._1.USStateCodeType
    at protected java.util.List gov.ojp.it.jxdm._3_0.AddressType.loc
    ationStateCodeFips52Alpha
    at gov.ojp.it.jxdm._3_0.AddressType
    at protected java.util.List gov.ojp.it.jxdm._3_0.LocationType.lo
    cationAddress
    at gov.ojp.it.jxdm._3_0.LocationType
    at protected java.util.List gov.ojp.it.jxdm._3_0.OrganizationTyp
    e.organizationLocation
    at gov.ojp.it.jxdm._3_0.OrganizationType
    at protected java.util.List gov.ojp.it.jxdm._3_0.BookingType.boo
    kingAgency
    at gov.ojp.it.jxdm._3_0.BookingType
    at generated.CjsBookingType
    at public generated.CjsBookingType generated.ObjectFactory.creat
    eCjsBookingType()
    at generated.ObjectFactory
    Check this out
    Exception in thread "main" java.lang.NullPointerException
    at bpd.MakeNewItem.marshallItem(MakeNewItem.java:119)
    at bpd.MakeNewItem.persistItem(MakeNewItem.java:112)
    at bpd.MakeNewItem.<init>(MakeNewItem.java:31)
    at bpd.MakeNewItem.main(MakeNewItem.java:137)
    ********************End of error message ******************
    Thanks
    Sat
    Message was edited by:
    sat_p

    In Help > About > Properties:
    sqldeveloper.oci.available = true

  • Error while using a cursor on select

    Hello,
    I am using a cursor for a select statement below is the code.
      OPEN CURSOR g_cursor FOR
        SELECT bkpf~blart
               bkpf~budat
               bkpf~usnam
               bsegc~bukrs
               bsegc~belnr
               bsegc~rfzei
               bsegc~kunnr
               bsegc~aunum
               bsegc~ccins
               bsegc~ccnum
               bsegc~rcrsp
               FROM bkpf
               INNER JOIN bsegc
            ON bkpf~bukrs = bsegc~bukrs AND
               bkpf~belnr = bsegc~belnr AND
               bkpf~gjahr = bsegc~gjahr
            WHERE bkpf~budat  IN s_budat
            AND   bsegc~bukrs IN s_bukrs
            AND   bsegc~rcrsp NE space.
      DO.
        FETCH NEXT CURSOR g_cursor APPENDING CORRESPONDING FIELDS OF TABLE i_bkpf PACKAGE SIZE g_pack.
        IF sy-subrc <> 0.
          EXIT.
        ENDIF.
      ENDDO.
      CLOSE CURSOR g_cursor.
      CLEAR g_cursor.
    The program gives me a dump on the fetch statement , can anyone help me understand the possible cause of this dump and suggest a solution?
    Thanks,
    Alok.

    Hi,
    What is the message that you get in the Dump?
    Regards
    Prasenjit

  • Unable to convert BLOB to XML using XMLTYPE

    Hello (XML) Experts
    I need your help with manipulating a BLOB column containing XML data - I am encountering the following error:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00200: could not convert from encoding UTF-8 to WINDOWS-1252
    Error at line 1
    ORA-06512: at "SYS.XMLTYPE", line 283
    I am on Windows 7 64 bit, Oracle 11.2.0.3 64 bit and database character set is WE8MSWIN1252, NLS_LANG is set to AMERICAN_AMERICA.AL32UTF8. The BLOB column contains the following XML data:
    <?xml version="1.0" encoding="utf-8"?>
    <Root CRC="-4065505">
      <Header Converted="0">
        <Version Type="String" Value="512" />
        <Revision Type="String" Value="29" />
        <SunSystemsVersion Type="String" Value="" />
        <Date Type="String" Value="20080724" />
        <Time Type="String" Value="165953" />
        <DAG Type="String" Value="" />
        <ChkID Type="String" Value="" />
        <FormType Type="String" Value="1" />
        <DB Type="String" Value="AllBusinessUnits" />
        <FuncID Type="String" Value="SOE" />
        <Status Type="String" Value="" />
        <FileType Type="String" Value="SFL" />
        <Descriptions>
          <Default Type="String" Value="Sales Order Entry" />
          <L01 Type="String" Value="Sales Order Entry" />
          <L33 Type="String" Value="Saisie commande client" />
          <L34 Type="String" Value="Entrada de órdenes de venta" />
          <L39 Type="String" Value="Inserimento ordine di vendita" />
          <L49 Type="String" Value="Aufträge erfassen" />
          <L55 Type="String" Value="Entrada de pedido de venda" />
          <L81 Type="String" Value="å?—注オーダー入力" />
          <L86 Type="String" Value="销售订å?•å½•å…¥" />
          <L87 Type="String" Value="銷售訂單錄入" />
        </Descriptions>
      </Header>
    <FormDesignerAppVer Type="String" Value="5.1" SFLOnly="1" />
    </Root>I am using the XMLTYPE constructor and passing in the BLOB column and the character set id of the XML data stored in the BLOB column in order to extract and update a node in the XML as follows:
    select xmltype(srce_form_detail,873) from SRCE_FORM where 873 above corresponds to the utf-8 encoding of the XML data in the BLOB column i.e. AL32UTF8, but this results in the above error.
    I have also tried converting the BLOB to a CLOB first as below where BLOB2CLOB is a function that converts the BLOB to a CLOB:
    select xmltype(BLOB2CLOB(srce_form_detail)).EXTRACT('/Root/Header/DB').getStringVal() XMLSrc  from SRCE_FORM;This results in the following error:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00210: expected '<' instead of '¿'
    Error at line 1
    ORA-06512: at "SYS.XMLTYPE", line 272
    ORA-06512: at line 1
    Looking at the XML in the BLOB I noticed that it contains a BOM(byte order mark) and this is causing the XML parsing to fail and I don't know how to deal with it and I don't want to simply SUBSTR it out.
    What I am trying to achieve is to extract the contents of the DB node in the XML and depending on its value I need to update the 'Value' part of that node. I am stuck at the point of extracting the contents of the DB node.
    I hope I have provided enough information and I would appreciate any suggestions on how best to resolve this - my XML knowledge is very limited so I would appreciate any help.
    Regards,
    Mohinder

    Hi Marc
    Thanks for your response.
    You are correct that the blob contains Japanese and Chinese characters but I was expecting that using the XMLTYPE constructor would convert the character set albeit with some data loss or then not display the Chinese and Japanese characters correctly.
    It seems to me that XMLTYPE is not handling/interpreting the BOM contained in the BLOB since even converting the BLOB to CLOB is resulting in an error. If I use SUBSTR and ignore the BOM to extract the XML from the BLOB then it works and as expected the Chinese and Japanese characters are not displayed correctly, they are displayed as '¿' corresponding to the lines beginning with L81, L86 & L87 , see below:
    select xmltype(SUBSTR(BLOB2CLOB(srce_form_detail),4)) from SRCE_FORM
    <?xml version="1.0" encoding="utf-8"?>
    <Root CRC="-4065505">
      <Header Converted="0">
        <Version Type="String" Value="512" />
        <Revision Type="String" Value="29" />
        <SunSystemsVersion Type="String" Value="" />
        <Date Type="String" Value="20080724" />
        <Time Type="String" Value="165953" />
        <DAG Type="String" Value="" />
        <ChkID Type="String" Value="" />
        <FormType Type="String" Value="1" />
        <DB Type="String" Value="AllBusinessUnits" />
        <FuncID Type="String" Value="SOE" />
        <Status Type="String" Value="" />
        <FileType Type="String" Value="SFL" />
        <Descriptions>
          <Default Type="String" Value="Sales Order Entry" />
          <L01 Type="String" Value="Sales Order Entry" />
          <L33 Type="String" Value="Saisie commande client" />
          <L34 Type="String" Value="Entrada de ¿¿rdenes de venta" />
          <L39 Type="String" Value="Inserimento ordine di vendita" />
          <L49 Type="String" Value="Auftr¿¿ge erfassen" />
          <L55 Type="String" Value="Entrada de pedido de venda" />
          <L81 Type="String" Value="¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿" />
          <L86 Type="String" Value="¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿" />
          <L87 Type="String" Value="¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿" />
        </Descriptions>
      </Header>Can you please let me know how I can extract the binary dump of the BLOB and post it on the forum as I don't know how to do this. Below is snippet of the hexadecimal dump, that includes the BOM. I can post the full hexadecimal dump if this can help you to reproduce the error ?
    EFBBBF3C3F786D6C2076657273696F6E3D22312E302220656E636F64696E673D227574662D38223F3E0D0A3C526F6F74204352433D222D34303635353035223E0D0A20203C48656164657220436F6E7665727465643D2230223E0D0A202020203C56657273696F6E20547970653D22537472696E67222056616C75653D2235313222202F3E0D0A202020203C5265766973696F6E20547970653D22537472696E67222056616C75653D22323922202F3E0D0A202020203C53756E53797374656D7356657273696F6E20547970653D22537472696E67222056616C75653D2222202F3E0D0A202020203C4461746520547970653D22537472696E67222056616C75653D22323030383037323422202F3E0D0A202020203C54696D6520547970653D22537472696E67222056616C75653D2231363539353322202F3E0D0A202020203C44414720547970653D22537472696E67222056616C75653D2222202F3E0D0A202020203C43686B494420547970653D22537472696E67222056616C75653D2222202F3E0D0A202020203C466F726D5479706520547970653D22537472696E67222056616C75653D223122202F3E0D0A202020203C444220547970653D22537472696E67222056616C75653D22416C6C427573696E657373556E69747322202F3E0D0A202020203C46756E63494420547970653D22537472696E67222056616C75653D22534F4522202F3E0D0A202020203C53746174757320547970653D22537472696E67222056616C75653D2222202F3E0D0A202020203C46696C655479706520547970653D22537472696E67222056616C75653D2253464C22202F3E0D0A202020203C4465736372697074696F6E733E0D0A2020202020203C44656661756C7420547970653D22537472696E67222056616C75653D2253616C6573204F7264657220456E74727922202F3E0D0A2020202020203C4C303120547970653D22537472696E67222056616C75653D2253616C6573204F7264657220456E74727922202F3E0D0A2020202020203C4C333320547970653D22537472696E67222056616C75653D2253616973696520636F6D6D616E646520636C69656E7422202F3E0D0A2020202020203C4C333420547970653D22537472696E67222056616C75653D22456E747261646120646520C3B37264656E65732064652076656E746122202F3E0D0A2020202020203C4C333920547970653D22537472696E67222056616C75653D22496E736572696D656E746F206F7264696E652064692076656E6469746122202F3E0D0A2020202020203C4C343920547970653D22537472696E67222056616C75653D224175667472C3A4676520657266617373656E22202F3E0D0A2020202020203C4C353520547970653D22537472696E67222056616C75653D22456E74726164612064652070656469646F2064652076656E646122202F3E0D0A2020202020203C4C383120547970653D22537472696E67222056616C75653D22E58F97E6B3A8E382AAE383BCE38380E383BCE585A5E58A9B22202F3E0D0A2020202020203C4C383620547970653D22537472696E67222056616C75653D22E99480E594AEE8AEA2E58D95E5BD95E585A522202F3E0D0A2020202020203C4C383720547970653D22537472696E67222056616C75653D22E98AB7E594AEE8A882E596AEE98C84E585A522202F3E0D0A202020203C2F4465736372697074696F6E733E0D0A20203C2F4865616465723E0D0A20203C466F726D3E0D0A202020203C4372656174696F6E4C616E6720547970653D22537472696E67222056616C75653D223031222053464C4F6E6C793D223122202F3E0D0A202020203C416374696F6E733E0D0A2020202020203C5065726D697373696F6E73202F3E0D0A202020203C2F416374696F6E733E0D0A202020203C48656C70202F3E0D0A202020203C466F6E743E0D0A2020202020203C446566466F6E7453697A6520547970653D22496E7465676572222056616C75653D2238222053464C4F6E6C793D223122202F3E0D0A2020202020203C466F6E743E0D0A20202020202020203C4C616E677561676520547970653D22537472696E67222056616C75653D2244656661756C7422202F3E0D0A20202020202020203C466F6E744E616D6520547970653D22537472696E67222056616C75653D224D532053616E7320536572696622202F3E0D0A2020202020203C2F466F6E743E0D0A2020202020203C466F6E743E0D0A20202020202020203C4C616E677561676520547970653D22537472696E67222056616C75653D22383122202F3E0D0A20202020202020203C466F6E744E616D6520547970653D22537472696E67222056616C75653D224D5320554920476F7468696322202F3E0D0A2020202020203C2F466F6E743E0D0A202020203C2F466F6E743E0D0A202020203C436F6E74726F6C733E0D0A2020202020203C436F6E74726F6C3E0D0A20202020202020203C436F6E74726F6C5479706520547970653D22496E746567657222204644496E743D2231222056616C75653D223122202F3E0D0A20202020202020203C446973706C61795479706520547970653D22537472696E6722204644496E743D2230222056616C75653D22466F726D2057696E646F77222053464C4F6E6C793D223122202F3E0D0A20202020202020203C43617074696F6E20547970653D22537472696E6722204644496E743D2230222056616C75653D2253597C3F7C55547C3F7C3F3F3F3F3F3F22202F3E0DThe XML I posted so far is actually truncated as the full XML is quite big but I showed the beginning of it as this is the section I believe that is not being handled properly. Furthermore I am able to write the BLOB out to a file successfully without any errors using DBMS_LOB & UTL_FILE.PUT_RAW and this seems to handle the BOM without any issues but what I really need to do is read a single node in the XML and update it directly preferably using XMLTYPE directly with the BLOB.
    I would welcome your suggestions on how best to read a single node and update it when the XML is contained in a BLOB.
    Regards,
    Mohinder

  • Unable to use ref cursor as a input parameter at the time of inserting reco

    Hi
    i am unable to use ref cursor when inserting the data to oracle 11g from visual studio 2008. please help me as early as possible my code is bellows
    using System;
    using System.Collections;
    using System.Configuration;
    using System.Data;
    using System.Linq;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Xml.Linq;
    using System.Web.Configuration;
    using Oracle.DataAccess.Client;
    using Oracle.DataAccess.Types;
    public partial class App_frmTest : System.Web.UI.Page
    protected void Page_Load(object sender, EventArgs e)
    protected void btnClick_Click(object sender, EventArgs e)
    OracleCommand cmd=new OracleCommand();
    Data objdata = new Data();
    int i = 0;
    string constr = "Data Source=Cwc;User Id=scott; Password=tiger;";// enlist=false; pooling=false;
    OracleConnection con = new OracleConnection(constr);
    /*Connection Open*/
    con.Open();
    cmd.Connection = con;
    /*Connection Open End*/
    /*Select Through Ref Cursor*/
    cmd.CommandText = "scott.TEST_USER.getUSER";
    cmd.CommandType = CommandType.StoredProcedure;
    OracleParameter p_rc = cmd.Parameters.Add("p_rc", OracleDbType.RefCursor, DBNull.Value, ParameterDirection.Output);
    OracleParameter p_rc1;
    if (TextBox1.Text == "")
    p_rc1 = cmd.Parameters.Add("p_rc", OracleDbType.Int16, DBNull.Value, ParameterDirection.Input);
    else
    p_rc1 = cmd.Parameters.Add("p_rc", OracleDbType.Int16, Convert.ToInt16(TextBox1.Text), ParameterDirection.Input);
    // OracleParameter p_rc1 = cmd.Parameters.Add("p_rc", OracleDbType.Int16, 2, ParameterDirection.Input);
    OracleDataReader reader = cmd.ExecuteReader();
    DataSet ds = new DataSet();
    DataTable dt1 = new DataTable();
    dt1.Load(reader);
    ds.Tables.Add(dt1);
    GridView1.DataSource = ds;
    GridView1.DataBind();
    cmd.Parameters.Clear();
    con.Close();
    con.Dispose();
    OracleCommand cmd1 = new OracleCommand();
    OracleConnection con1 = new OracleConnection(constr);
    con1.Open();
    cmd1.Connection = con1;
    cmd1.CommandText = "scott.TEST_USER.ADDUSER";
    cmd1.CommandType = CommandType.StoredProcedure;
    OracleParameter P_ADDUSER = cmd1.Parameters.Add("P_ADDUSER", OracleDbType.RefCursor, DBNull.Value, ParameterDirection.Input);
    cmd1.ExecuteNonQuery(); // i am getting error when executing this line
    Server Error in '/CWC' Application.
    Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
    Exception Details: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
    Source Error: 
    Line 77: OracleParameter P_ADDUSER = cmd1.Parameters.Add("P_ADDUSER", OracleDbType.RefCursor, DBNull.Value, ParameterDirection.Input);
    Line 78: //OracleParameter P_MSG = cmd.Parameters.Add("P_MSG", OracleDbType.Varchar2, DBNull.Value, ParameterDirection.Output);
    Line 79: cmd1.ExecuteNonQuery();
    Line 80:
    Line 81: DataTable dt = new DataTable();
    Source File: d:\CWC\App\frmTest.aspx.cs    Line: 79 
    Stack Trace: 
    [AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.]
    Oracle.DataAccess.Client.OpsSql.ExecuteNonQuery(IntPtr opsConCtx, IntPtr& opsErrCtx, IntPtr& opsSqlCtx, IntPtr& opsDacCtx, IntPtr opsSubscrCtx, Int32& isSubscrRegistered, Int32 bchgNTFNExcludeRowidInfo, Int32 bQueryBasedNTFNRegistration, Int64& query_id, OpoSqlValCtx*& pOpoSqlValCtx, String pCommandText, IntPtr& pUTF8CommandText, IntPtr[] pOpoPrmValCtx, String[] ppOpoPrmRefCtx, OpoMetValCtx*& pOpoMetValCtx, Int32 prmCnt, Int32 bFromPool) +0
    Oracle.DataAccess.Client.OracleCommand.ExecuteNonQuery() +4731
    App_frmTest.btnClick_Click(Object sender, EventArgs e) in d:\CWC\App\frmTest.aspx.cs:79
    System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
    System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
    System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

    Hi;
    Its better to ask it at visual studio forum site:http://social.msdn.microsoft.com/Forums/en-US/category/visualstudio
    Regard
    Helios

  • Multiple record insert problem in Oracle Procedure that uses a cursor

    Dear X-pert guies,
    I have a oracle procedure that use a cursor, I repeatedly make query on 1st table using cursor value and insert that queried value(of 1st table) to 2nd table
    y_summary. y_summary has composite  primary key :PK_Y_SUM (BILL_DATE, TRUNK_MGR, IDD_FLAG, PK_FLAG, PREFIX).*
    when i run the procedure explicit2('201001'); the it gives me the error:::: begin explicit2('201001'); end;_
    ORA-00001: unique constraint (PRM.PK_Y_SUM) violated_
    ORA-06512: at "PRM.EXPLICIT2", line 413_
    ORA-06512: at line 1_
    but when i remove the composite primary key from y_summary table then, the procedure runs ok and make so many duplicate entries in y_summary.
    but i want the single record  to be inserted for single time in y_summary ,so You guies are honorly requested to make the required help .
    the structure of y_summary Table and Procdure code is given below.
    Table:
    -- Create table
    create table Y_SUMMARY
    BILL_DATE VARCHAR2(10) not null,
    TRUNK_MGR VARCHAR2(20) not null,
    IDD_FLAG VARCHAR2(10) not null,
    PK_FLAG NUMBER(2) not null,
    OUTCALLS NUMBER(20,2),
    OUTDUR NUMBER(20,2),
    PREFIX VARCHAR2(10) not null
    tablespace TBS_PRM_D01
    pctfree 10
    pctused 40
    initrans 1
    maxtrans 255
    storage
    initial 64K
    minextents 1
    maxextents unlimited
    -- Create/Recreate primary, unique and foreign key constraints
    alter table Y_SUMMARY
    add constraint PK_Y_SUM primary key (BILL_DATE, TRUNK_MGR, IDD_FLAG, PK_FLAG, PREFIX)
    using index
    tablespace TBS_PRM_D01
    pctfree 10
    initrans 2
    maxtrans 255
    storage
    initial 64K
    minextents 1
    maxextents unlimited
    Procedure:
    create or replace procedure explicit2( month_val in varchar2) is
    cursor explicit_cur is select dest_code from y_table where dest_code like '44%' order by dest_code desc;
    dummy varchar2(100);
    lv_length Number(9);
    sqlstr varchar2(2500);
    rec_count1 number;
    rec_count2 number;
    rec_count3 number;
    begin
    open explicit_cur;
    LOOP
    fetch explicit_cur into dummy;
    EXIT WHEN explicit_cur%NOTFOUND;
    rec_count1 :=0;
    rec_count2 :=0;
    rec_count3 :=0;
    lv_length := length(dummy);
    sqlstr := 'select count(*) from y_table_data1 t where t.fee_dur_1_1 <> 0
    and t.out_trunk in (''MHISRM'', ''GEISRM'', ''GEIMRP'', ''MHIMRP'', ''13'', ''ITAX1B'', ''ITAX3B'',''ITAX5B'', ''ITAX6B'', ''ITAX7B'', ''BTIMRP'', ''BTI5RP'', ''BTI6RP'', ''BTI7RP'')
    and t.service_code = ''00'' and substr(t.orig_called_num,1,'||lv_length||')='||''''||dummy||'''';
    execute immediate sqlstr into rec_count1;
    sqlstr := 'select count(*) from y_table_data1 t where t.fee_dur_1_2 <> 0
    and t.out_trunk in (''MHISRM'', ''GEISRM'', ''GEIMRP'', ''MHIMRP'', ''13'',
    ''ITAX1B'',''ITAX3B'',''ITAX5B'', ''ITAX6B'', ''ITAX7B'', ''BTIMRP'', ''BTI5RP'', ''BTI6RP'', ''BTI7RP'')
    and t.service_code = ''00'' and substr(t.orig_called_num,1,'||lv_length||')='||''''||dummy||'''';
    execute immediate sqlstr into rec_count2;
    sqlstr := 'select count(*) from y_table_data1 t where t.fee_dur_1_1 <> 0
    and t.out_trunk in (''MHISRM'', ''GEISRM'', ''GEIMRP'', ''MHIMRP'', ''13'',
    ''ITAX1B'', ''ITAX3B'',''ITAX5B'', ''ITAX6B'', ''ITAX7B'', ''BTIMRP'', ''BTI5RP'', ''BTI6RP'', ''BTI7RP'')
    and t.service_code = ''012'' and substr(t.orig_called_num,1,'||lv_length||')='||''''||dummy||'''';
    execute immediate sqlstr into rec_count3;
    if(rec_count1>0) then
    sqlstr := 'insert into y_summary(BILL_DATE ,PREFIX, TRUNK_MGR,OUTCALLS , OUTDUR , IDD_FLAG , PK_FLAG )
    select '|| month_val||' ,substr(t.orig_called_num,1,'||lv_length||'),t.trunkout_operator ,count(*) , round(sum(ceil(t.duration / 15) * 15) / 60, 0),''00'',''1'' from y_table_data1 t where t.fee_dur_1_1 <> 0
    and t.out_trunk in (''MHISRM'', ''GEISRM'', ''GEIMRP'', ''MHIMRP'', ''13'', ''ITAX1B'', ''ITAX3B'',''ITAX5B'', ''ITAX6B'', ''ITAX7B'', ''BTIMRP'', ''BTI5RP'', ''BTI6RP'', ''BTI7RP'')
    and t.service_code = ''00'' and substr(t.orig_called_num,1,'||lv_length||')='||''''||dummy||''''|| ' group by t.trunkout_operator,substr(t.orig_called_num,1,'||lv_length||')';
    execute immediate sqlstr;
    commit;
    sqlstr :='DELETE from y_table_data1 t where t.fee_dur_1_1 <> 0
    and t.out_trunk in (''MHISRM'', ''GEISRM'', ''GEIMRP'', ''MHIMRP'', ''13'', ''ITAX1B'', ''ITAX3B'',''ITAX5B'', ''ITAX6B'', ''ITAX7B'', ''BTIMRP'', ''BTI5RP'', ''BTI6RP'', ''BTI7RP'')
    and t.service_code = ''00'' and substr(t.orig_called_num,1,'||lv_length||')='||''''||dummy||'''';
    execute immediate sqlstr;
    commit;
    end if ;
    if(rec_count2>0) then
    sqlstr :='insert into y_summary(BILL_DATE ,PREFIX, TRUNK_MGR,OUTCALLS , OUTDUR , IDD_FLAG , PK_FLAG )
    select '|| month_val||' ,substr(t.orig_called_num,1,'||lv_length||'),t.trunkout_operator ,count(*) , round(sum(ceil(t.duration / 15) * 15) / 60, 0),''00'',''0'' from y_table_data1 t where t.fee_dur_1_2 <> 0
    and t.out_trunk in (''MHISRM'', ''GEISRM'', ''GEIMRP'', ''MHIMRP'', ''13'', ''ITAX1B'', ''ITAX3B'',''ITAX5B'', ''ITAX6B'', ''ITAX7B'', ''BTIMRP'', ''BTI5RP'', ''BTI6RP'', ''BTI7RP'')
    and t.service_code = ''00'' group by t.trunkout_operator,substr(t.orig_called_num,1,'||lv_length||')';
    execute immediate sqlstr;
    commit;
    sqlstr :='DELETE from y_table_data1 t where t.fee_dur_1_2 <> 0
    and t.out_trunk in (''MHISRM'', ''GEISRM'', ''GEIMRP'', ''MHIMRP'', ''13'', ''ITAX1B'', ''ITAX3B'',''ITAX5B'', ''ITAX6B'', ''ITAX7B'', ''BTIMRP'', ''BTI5RP'', ''BTI6RP'', ''BTI7RP'')
    and t.service_code = ''00'' and substr(t.orig_called_num,1,'||lv_length||')='||''''||dummy||'''';
    execute immediate sqlstr;
    commit;
    end if;
    if(rec_count3>0) then
    sqlstr :='insert into y_summary(BILL_DATE ,PREFIX, TRUNK_MGR,OUTCALLS , OUTDUR , IDD_FLAG , PK_FLAG )
    select '|| month_val||',substr(t.orig_called_num,1,'||lv_length||'),t.trunkout_operator ,count(*) , round(sum(ceil(t.duration / 15) * 15) / 60, 0),''012'',''0'' from y_table_data1 t where t.fee_dur_1_1 <> 0
    and t.out_trunk in (''MHISRM'', ''GEISRM'', ''GEIMRP'', ''MHIMRP'', ''13'', ''ITAX1B'', ''ITAX3B'',''ITAX5B'', ''ITAX6B'', ''ITAX7B'', ''BTIMRP'', ''BTI5RP'', ''BTI6RP'', ''BTI7RP'')
    and t.service_code = ''012'' group by t.trunkout_operator,substr(t.orig_called_num,1,'||lv_length||')';
    execute immediate sqlstr;
    commit;
    sqlstr :='DELETE from y_table_data1 t where t.fee_dur_1_1 <> 0
    and t.out_trunk in (''MHISRM'', ''GEISRM'', ''GEIMRP'', ''MHIMRP'', ''13'', ''ITAX1B'', ''ITAX3B'',''ITAX5B'', ''ITAX6B'', ''ITAX7B'', ''BTIMRP'', ''BTI5RP'', ''BTI6RP'', ''BTI7RP'')
    and t.service_code = ''012'' and substr(t.orig_called_num,1,'||lv_length||')='||''''||dummy||'''';
    execute immediate sqlstr;
    commit;
    end if;
    end loop;
    close explicit_cur;
    end explicit2;
    Edited by: user10951541 on 25.4.2010 12.08

    Dear concern
    Really sorry not to make format listing because i am amature to this blog.
    my anwser to your way .
    1. I have Tested my SQL statements manually in SQL*Plus. this runs ok
    2. "Cursor loops, such as the one you have coded here, have been obsolete in Oracle since version 8i 12+ years ago.
    Look up BULK COLLECT and FORALL in the docs and use them instead."
    I am trying to make use of the BULK COLLECT and FORALL statement in proper location.
    3. "Your procedure never performs a commit so no work actually takes place" i need to get the anwser why........................?
    4. "On what basis was the decision made to use the default PCTFREE and PCTUSED values of 10 and 40?"
    is there any problem if default is used..? if any suggestion........pls
    5." You did not format your listing using the CODE tags as explained in the FAQ making your listing unreadable ... so I've not read it.
    Please read the FAQ and use the proper way to post code so we can understand it. Then perhaps we can help you further. " really sorry not to make understandable to you..? but i will try from next post..
    I really will try to be synced..
    My aim is to make query to Table A using the cursor value like( '4422','442','4411','441','44') and get some data in accordance of these values.Then i put the data into another Table B. same time i need to delete the record from Table A containing the prefix value in accordance for example- i compute value for '4422' from Table A and put the computed value to Table B .Then i delete the record from Table A where prefix is '4422' .so that computed value for the next prefix '442' should contain the computed value for 442[0-1] and 442[3-9] .Same way it will be happened for ('4411','441','44'....bla...bla).
    Thanks in advance..

  • Re-Use of cursor pointer in the Cursor loop

    Is it possible to re-use a Cursor pointer as a cursor pointer within the main cursor loop. We have a scenario like
    FOR c1 IN cursor1 LOOP
         FOR c1 IN cursor2 LOOP
         END LOOP;
    END LOOP;
    The code seems to work and gives correct result 75% of times and giving wrong result 25% times, even though we are using the same data every time.

    This is an existing piece of code, and we are actually trying to investigate why the program is giving incorrect results only sometimes and not always, even when we use the same set of data. This appeared to be the only logical error we could find.
    We are using the variable of the first loop inside the second one, which I understand the code shouldn't be doing. But then, I would expect the result to be consistently wrong, which they are not and this is what surprises me. Could it be that the Oracle is not able to handle this properly?

  • Errors using add_user_to_list

    All,
    i seem to have come across an error using the portal30.wwsec_api.add_user_to_list function. I believe the error could be with my code....the error i get :-
    Step : 11 - ORA-01086: savepoint 'ADDUSERTOLIST_SAVEPOINT' never established
    ORA-06512: at "PORTAL30.WWSEC_API", line 1915
    ORA-06510: PL/SQL: unhandled user-defined exception
    ORA-06512: at "PORTAL30.WWCTX_SSO", line 849
    ORA-06510: PL/SQL: unhandled user-defined exception
    ORA-06512: at "PORTAL30.WWCTX_SSO", line 669
    ORA-06502: PL/SQL: numeric or value error
    The piece of code i have running through a CURSOR FOR LOOP is as follows..
    FOR assign_users_to_group IN cur_assign_group LOOP
    -- Maintain the portal account
    portal30.wwsec_api.add_user_to_list
    ( p_person_id => assign_users_to_group.person_id,
    p_to_group_id => assign_users_to_group.group_id,
    p_is_owner => 0
    END LOOP;
    The CURSOR FOR LOOP selects out the correct person_id and group_id for which the new user is to be assigned. I then attempt to add the user to the (already created) group. Has anybody had this type of error before??
    Thanks for any help,
    Matt.
    null

    Just to keep you all up to date with the situation. i have now progressed onto DELETE_USER_FROM_LIST, and quite unsuccessfully too.....
    This time i have this piece of code....
    -- Maintain the portal account
    portal30.wwsec_api.delete_user_from_list
    ( p_group_id => revoke_users_from_groups.group_id,
    p_member_person_id => revoke_users_from_groups.person_id
    I run this piece of code as PORTAL30, just like the ADD_USER_TO_LIST function. Except this time I get another error
    declare
    ERROR at line 1:
    ORA-06510: PL/SQL: unhandled user-defined exception
    ORA-06512: at "PORTAL30.WWSEC_API", line 2465
    ORA-06512: at line 5
    Needle in a haystack, or does somebody out there have an idea??
    Thanks, Matt.
    null

  • Error Returning REF CURSOR

    I'm trying to return a REF CURSOR from a function and get the following error:
    ORA-00932: inconsistent datatypes: expected CURSER got NUMBER
    ORA-06512: at "CERTS.JIMMY", line 17
    ORA-06512: at line 10
    Here is my function:
    CREATE OR REPLACE PACKAGE jimmy
    AS
    TYPE refc IS REF CURSOR
    RETURN equipment%rowtype;
    FUNCTION getresults(p_ssan_in IN equipment.ssan%TYPE,
                             p_type_in IN equipment.equip_type%TYPE)
         RETURN refc;
    END jimmy;
    CREATE OR REPLACE PACKAGE BODY jimmy
    AS
    FUNCTION getresults( p_ssan_in IN equipment.ssan%TYPE,
                                  p_type_in IN equipment.equip_type%TYPE)
    RETURN refc
    IS
    l_cursor refc;
    isretired equipment.retired%TYPE := 'N';
    qry varchar2(100) := 'SELECT * ' ||
                                  'FROM equipment ' ||
                                  'WHERE ssan = :b1 ' ||
                                  'AND equip_type = :b2 ' ||
                                  'AND retired = :b3';
    BEGIN
    EXECUTE IMMEDIATE qry
         INTO l_cursor
         USING p_ssan_in, p_type_in, isretired;
    RETURN l_cursor;
    END getresults;
    END jimmy;
    The data types for the parameters are all varchar2. I don't know why it says it is returning a number.

    I tried your suggestion:
    BEGIN
    OPEN l_cursor
         FOR qry
         USING p_ssan_in, p_type_in, isretired;
    RETURN l_cursor;
    END getresults;
    But I get an error:
    PLS-00455: cursor 'L_CURSOR' cannot be used in dynamic SQL OPEN statement

  • Using ref cursor in after parameter form in reports

    hi everyone,
    I have problem in usage of ref cursor in after parameter form. My actual requirement is I have user parameter :p_minval, :p_maxval. The values into these user parameters will be coming dynamically using sql_statement as shown below
    select min(empid),max(empid) into :p_minval, :p_maxval from emp where empid in (:p_emp);
    I will be writing this query in the after parameter form
    :p_emp is a lexical parameter as per me but the after parameter form is taking it as a bind variable. so I decided to define a ref cursor and then use it for retrieve. But when I use ref cursor it is returning pl/sql error 591 saying that this is not supported by client side can anyone help me plz..
    The following is the code i tried to use in after parameter form
    function afterPform return boolean is
    type rc is ref cursor;
    l_rc rc;
    sqlstmt varchar2(512);
    begin
    sqlstmt:='select min(empid),max(empid) from emp where empid in ('||:p_emp||')';
    open l_rc for
    select max(empid) from emp where empid in ('||:p_emp||')';
    fetch l_rc into :p_maxval;
    close l_rc;
    return(true);
    end;
    thanks & regards
    venkat

    I ran into the same problem. any body knows why?

  • Problem in using ref cursor

    I have a procedure which is using one ref cursor as OUT paramater. Now when I call this procedure, it gives me the following error:
    ORA-00932: inconsistent datatypes: expected CURSER got NUMBER
    ORA-06512: at "APPS.ORDER_RETURN1", line 8
    ORA-06512: at "APPS.ORDER_RETURN2", line 4
    ORA-06512: at line 1
    Below is my code
    PROCEDURE ORDER_RETURN1(p_order OUT sys_refcursor) IS
    TYPE OE_ORDER_rcur IS REF CURSOR;
    rcur OE_ORDER_rcur;
    BEGIN
    OPEN rcur FOR
    SELECT ORDER_NUMBER FROM OE_ORDER_HEADERS_ALL WHERE ROWNUM < 4;
    FETCH rcur INTO p_order;
    CLOSE rcur;
    END ORDER_RETURN1;
    PROCEDURE ORDER_RETURN2 IS
    OE_ORDER_rcur11 sys_refcursor;
    BEGIN
    ORDER_RETURN1(OE_ORDER_rcur11);
    end;
    I tried to call proc ORDER_RETURN1 with the help of proc ORDER_RETURN2, but no change, it gives me same error if i call the first proc ORDER_RETURN1 or i call ORDER_RETURN2.
    I am stuck with this problem, I had used ref cursor in procedure but not able to call the procedure which uses ref cursor as OUT parameter.
    Please help me to resolve this.
    Thanks
    Nidhi..

    Check out this
    SQL>VARIABLE X REFCURSOR
    SQL>CREATE OR REPLACE PROCEDURE ORDER_RETURN1(p_order OUT sys_refcursor) IS
      2  BEGIN
      3  OPEN p_order FOR
      4  SELECT OBJECT_ID FROM ALL_OBJECTS WHERE ROWNUM < 4;
      5  END ORDER_RETURN1;
      6  /
    Procedure created.
    SQL>EXEC ORDER_RETURN1(:X)
    PL/SQL procedure successfully completed.
    SQL>PRINT X
    OBJECT_ID
             4
            39
            30
    SQL>Regards
    Arun

  • Procedure to fetch table records using ref cursor

    Hi
    i need to fetch all the records in the table using ref cursor.we need to pass table
    name and the out paramater should be ref cursor.
    CREATE OR REPLACE PROCEDURE gettable(p_table_name IN VARCHAR2,
    p_ref_cursor OUT dept_pack.ref_cursor1)
    IS
    BEGIN
    OPEN p_ref_cursor FOR SELECT * FROM p_table_name;
    END gettable;
    is that a start ? then after this i have to execute this procedure to fetch the data from table. i am getting error that table doesnot exist but my idea was to pass p_table_name as IN parameter.
    Thnks in Advance

    here is the example
    SQL> CREATE OR REPLACE PROCEDURE TEST( t_name IN VARCHAR2
      2                                  , p_cursor OUT SYS_REFCURSOR)
      3  IS
      4  BEGIN
      5    OPEN p_cursor FOR
      6    'SELECT * FROM '|| t_name ;
      7  END TEST;
      8  /
    Procedure created.
    Elapsed: 00:00:00.02
    SQL>  var o refcursor;
    SQL> var tname varchar2(10);
    SQL> execute test('EMP',:o);
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.00
    SQL> print :o;
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM        DNO
          7369 SMITH      CLERK           7902 17-DEC-80      800.2                    20
          7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30
          7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30
          7566 JONES      MANAGER         7839 02-APR-81       2975                    20
          7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30
          7698 BLAKE      MANAGER         7839 01-MAY-81       2850                    30
          7782 CLARK      MANAGER         7839 09-JUN-81       2450                    10
          7788 SCOTT      ANALYST         7566 19-APR-87       3000                    20
          7839 KING       PRESIDENT            17-NOV-81       5000                    10
          7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30
          7876 ADAMS      CLERK           7788 23-MAY-87       1100                    20
          7900 JAMES      CLERK           7698 03-DEC-81        950                    30
          7902 FORD       ANALYST         7566 03-DEC-81       3000                    20
          7934 MILLER     CLERK           7782 23-JAN-82       1300                    10
    14 rows selected.
    Elapsed: 00:00:00.01
    SQL>  execute test('DEPT',:o);
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.02
    SQL>  print :o;
        DEPTNO DNAME          LOC
            90 LOGISTIC
            10 ACCOUNTING     NEW YORK
            20 RESEARCH       DALLAS
            30 SALES          CHICAGO
            40 OPERATIONS     BOSTON
    Elapsed: 00:00:00.01

Maybe you are looking for

  • Change PC / How to sincronize

    Ciao to all... I've this problem.... I've changed my PC to install on WINDOWS 7 ultimate N 64bit... After the iTunes installation for 64bit version... I'can't see my iPhone... The problem is that there isn't drive... But when I Open iTunes I can see

  • File permissions problem

    I'm trying to organise permissions on my server. I have a bunch of .iso files which I mount over nfs but it seems as though no matter what I do, the owner and group permissions are ignored. Obviously I'm mounting as root. The files are owned by root

  • SAP TechEd 2011- Data Integration and Quality Managment Sessions

    Looking for answers on "Data Integration and Quality Management," check out the related educational sessions at SAP TechEd 2011 ([Las Vegas|http://bit.ly/qE0dZs], [Bangalore|http://bit.ly/oVdGsM], [Madrid|http://bit.ly/rnSNOT]). [Register today|http:

  • NMCOL Report material price

    First at all, Happy new year! Please, my question is about the report NMCOL, it seems that the material price showed is correct for every material consumption, but divided by 100. For example, in mm03 (acounting view) the variable price is 60 for a m

  • No configuration menu for transaction management

    I'm using SAP 4.7, in BTE application indicator, I already select EA-FIN, IHC, RM, TR-TM, but in SPRO, I can use search function to find the configuration path, for example "assign flow type to update type", when I double click, it shows nothing. und