Error with stored procedure block datasource

Hi all,
I tried to base a datablock on a stored procedure in order to get better runtime performance. I work with Forms Builder 6i with patch 17 , and our database is oracle 8.1.7.1.4
But when compiling I got errors.
Here are what I did :
create or replace type TSourceObject as object(name varchar2(30), propname varchar2(200));
create or replace type TSourceTable is table of TSourceObject;
create or replace procedure p_query_ntwk_chnl_mirror(p_tab IN OUT NOCOPY TSourceTable, p_action varchar2, p_lien number)
is
begin
if p_action = 'VISU' then
select TSourceObject(B.bdw_name, P.prop_bdw_name)
bulk collect into p_tab
from T_NETWORK_CHANNEL N, t_bdw_mw B, t_prop_bdw_mw P
where B.comp_bdw = P.comp_bdw and P.comp_prop_bdw = N.comp_prop_bdw
and EXISTS (SELECT 1
FROM t_channel_element C
WHERE N.comp_network_channel = C.comp_network_channel and comp_lien = p_lien);
else
select TSourceObject(B.bdw_name, P.prop_bdw_name)
bulk collect into p_tab
from T_NETWORK_CHANNEL N, t_bdw_mw B, t_prop_bdw_mw P
where B.comp_bdw = P.comp_bdw and P.comp_prop_bdw = N.comp_prop_bdw;
end if;
end;
Then I created the datablock with the wizard , I entered correctly the value of the arguments for the table type name, the argument p_action and the argument p_lien.
And when compiling there was this alert error :
Compiling QUERY-PROCEDURE trigger on NETWORK_CHANNEL_MIRROR data block...
Compilation error on QUERY-PROCEDURE trigger on NETWORK_CHANNEL_MIRROR data block:
PL/SQL ERROR 960 at line 5, column 9
RPCs cannot use variables with schema level user-defined types in this release
PL/SQL ERROR 0 at line 5, column 9
Item ignored
PL/SQL ERROR 320 at line 7, column 26
the declaration of the type of this expression is incomplete or malformed
PL/SQL ERROR 0 at line 7, column 1
Statement ignored
PL/SQL ERROR 320 at line 8, column 28
the declaration of the type of this expression is incomplete or malformed
PL/SQL ERROR 0 at line 8, column 1
Statement ignored
Compilation errors have occurred.
So what should I do ?
Thank you very much indeed.

I create the package , and when creating the body then there was an error.
Here is the package :
create or replace package pkg_query_ntwrk_chnl_mirror
is
type TSourceObject is record(name varchar2(30), propname varchar2(200));
type TSourceTable is table of TSourceObject index by binary_integer;
procedure p_query_ntwk_chnl_mirror(p_tab IN OUT NOCOPY pkg_query_ntwrk_chnl_mirror.TSourceTable, p_action varchar2, p_lien number);
end;
create or replace package body pkg_query_ntwrk_chnl_mirror
is
procedure p_query_ntwk_chnl_mirror(p_tab IN OUT NOCOPY pkg_query_ntwrk_chnl_mirror.TSourceTable, p_action varchar2, p_lien number)
is
begin
if p_action = 'VISU' then
     select B.bdw_name, P.prop_bdw_name
     bulk collect into p_tab
     from T_NETWORK_CHANNEL N, t_bdw_mw B, t_prop_bdw_mw P
     where B.comp_bdw = P.comp_bdw and P.comp_prop_bdw = N.comp_prop_bdw
     and EXISTS (SELECT 1
     FROM t_channel_element C
     WHERE N.comp_network_channel = C.comp_network_channel and comp_lien = p_lien);
else
     select B.bdw_name, P.prop_bdw_name
     bulk collect into p_tab
     from T_NETWORK_CHANNEL N, t_bdw_mw B, t_prop_bdw_mw P
     where B.comp_bdw = P.comp_bdw and P.comp_prop_bdw = N.comp_prop_bdw;
end if;
end;
end;
And here is the error :
7/2 PL/SQL: SQL Statement ignored
8/20 PLS-00597: expression 'P_TAB' in the INTO list is of wrong type
15/2 PL/SQL: SQL Statement ignored
16/20 PLS-00597: expression 'P_TAB' in the INTO list is of wrong type
And what is the problem here ? I think it is right!

Similar Messages

  • Error with PL/SQL block

    Hi
    If I run PL/SQL block
    DECLARE
    CURSOR C1 is SELECT CLM_CASE_NO FROM CLAIM_OBJECT.CLM_INVLVD_PRTY_T where CLM_CASE_NO=XXXX;
    BEGIN
    FOR X in C1 loop
    INSERT INTO POSTL_ADDRS_ARCHIVE P (SELECT A.* FROM CLAIM_OBJECT.POSTL_ADDRS A, CLAIM_OBJECT.CLM_INVLVD_PRTY_T C WHERE
    C.CLNT_NO = A.CLNT_NO AND C.CURR_ROW_IND='A' AND C.CLM_CASE_NO =X.CLM_CASE_NO );
    end loop;
    end;
    there is no error with the above block
    If I remove where clause in cursor and run block
    DECLARE
    CURSOR C1 is SELECT CLM_CASE_NO FROM CLAIM_OBJECT.CLM_INVLVD_PRTY_T;
    BEGIN
    FOR X in C1 loop
    INSERT INTO POSTL_ADDRS_ARCHIVE P (SELECT A.* FROM CLAIM_OBJECT.POSTL_ADDRS A, CLAIM_OBJECT.CLM_INVLVD_PRTY_T C WHERE
    C.CLNT_NO = A.CLNT_NO AND C.CURR_ROW_IND='A' AND C.CLM_CASE_NO =X.CLM_CASE_NO );
    end loop;
    end;
    ERROR at line 1:
    ORA-01013: user requested cancel of current operation
    ORA-06512: at line 12
    I searched for ORA-06512
    Cause:
         This error message indicates the line number in the PLSQL code that the error resulted.
    SELECT CLM_CASE_NO FROM CLAIM_OBJECT.CLM_INVLVD_PRTY_T has over 800,672 records.
    SELECT CLM_CASE_NO FROM CLAIM_OBJECT.CLM_INVLVD_PRTY_T where CLM_CASE_NO=XXXX; has 2 records.
    I am not not understanding why block 2 is throwing error (with no where clause in cursor)
    Any help will be greatly appreciated
    Thanks in advance

    As the error message indicates clearly the process was cancelled as you pressed CTRL+C. And yes you can’t see any data you insert in one session from other session until it gets committed. And as others have mentioned row by row operation is very expensive think about revising your approach.
    Instead of having a cursor why don’t you join it directly in you select in the insert statement and try?
    Thanks,
    Karthick.
    Message was edited by:
    karthick_arp

  • Problem With Stored Procedure

    Post Author: Ranjith.403
    CA Forum: General
    Hi,
    Am new to crystal reports with stored procedures
    am created a report using a stored procedure in oracle. In that Stored Procedure am Using a temporary table.
    After inserting values into the table am assigning to ref cursor.
    Refcursor having fields like item,onhandstock,purchase rate
    This report working fine in oracle version 9.2.0.1.0 where comes to oracle version 9.2.0.8.0 it's giving the varchar values correctly.
    The Number values are showing as 0.
    Help me to solve it.
    Thanks in Advance,
    Ranjith

    Try modularising this large procedure into smaller procedures and functions, and determine which part is causing you trouble.

  • Executing a report with stored procedure causes error

    Hello,
    I've got a .NET application where a report gets generated from an .rpt template using Crystal Reports. A template has been created using the fields from stored procedure. While creating the template, I've been working with my DEV environment DB server, and with that server the .rpt has been saved. Within the Designer, I can preview the report, all working fine.
    Using the template with my application, if I set in the code for crystal connection to use the same DB server as has been saved with the .rpt, the report runs and I do get the result in my application as expected. But if I move my code to other environment, using another DB server (but not changing anything in the .rpt), while running the report in the application I get the following error:
    Exception: CrystalDecisions.CrystalReports.Engine.InternalException
    Message: Failed to open a rowset.
    Details: ADO Error Code: 0x
    Source: Microsoft OLE DB Provider for SQL Server
    Description: Could not find stored procedure 'BreachOfAgg'.
    SQL State: 42000
    Native Error:
    Failed to open a rowset.
    Error in File C:\Windows\TEMP\Breach of Aggregate Stop Loss {196B84E5-7DAE-465E-A12D-5C70DDC04CE5}.rpt:
    Failed to open a rowset.
    Source: CrystalDecisions.ReportAppServer.DataSetConversion
       at CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e)
       at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)
       at CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext)
       at CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToStream(ExportOptions options)
       at CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToHttpResponse(ExportOptions options, HttpResponse response, Boolean asAttachment, String attachmentName)
       at CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToHttpResponse(ExportFormatType formatType, HttpResponse response, Boolean asAttachment, String attachmentName)
       at IFG.ReportsModule.Reporter.CrystalReporter.Export(OutputType outputType, HttpResponse response, String reportName, Boolean asAttachment)
       at IFG.ReportsModule.Reporter.CrystalReporter.Export(OutputType outputType, HttpResponse response, String reportName)
       at IFG.ReportsModule.Proxies.CrystalReporterProxy.ShowResult(OutputType outputType, HttpContext context, CrystalReporter cr)
       at IFG.ReportsModule.Proxies.CrystalReporterProxy.ExecuteReport(ParametersValues parameters, OutputType outputType, HttpContext context)
       at IFG.Web.GetReport.GenerateReport(Int64 reportID) in d:\Jure\PSL\iFish\IFISHRSF\IFISHRSF0100\Root\5. Development\IFISH Portal\SDRMA New\Portal\web\admin\RSF\GetReport.aspx.cs:line 82
       at IFG.Web.GetReport.Page_Load(Object sender, EventArgs e) in d:\Jure\PSL\iFish\IFISHRSF\IFISHRSF0100\Root\5. Development\IFISH Portal\SDRMA New\Portal\web\admin\RSF\GetReport.aspx.cs:line 48
    Nested Exception
    Exception: System.Runtime.InteropServices.COMException
    Message: Failed to open a rowset.
    Details: ADO Error Code: 0x
    Source: Microsoft OLE DB Provider for SQL Server
    Description: Could not find stored procedure 'BreachOfAgg'.
    SQL State: 42000
    Native Error:
    Failed to open a rowset.
    Error in File C:\Windows\TEMP\Breach of Aggregate Stop Loss {196B84E5-7DAE-465E-A12D-5C70DDC04CE5}.rpt:
    Failed to open a rowset.
       at CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export(ExportOptions pExportOptions, RequestContext pRequestContext)
       at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)
    If I open in the Crystal Designer the rpt and change the DB to my new server, and then run the report in the application using that same new server, the report runs ok and I do get the results. As well, I don't have this problem using tables or views in the report. Independent of what server has been used while created the .rpt in the Designer, I get the report ran and presented according to the server that I point to within my code.
    I hope someone can help me out with thi.
    Thank you.
    Jure

    Hi Jure,
    All I can suggest now is you try this [app|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333533353333333933323331%7D.do]:
    It will get the connection if you need.
    If that doesn't work the purchase a support and Rep can connect to your PC to see what is going on...
    Thanks
    Don

  • Receive java.lang.NullPointerException (JCA-12563) on SCA with Stored Procedure dbAdapter (SOA Suite 12.1.3)

    Hi,
    I'm new to the Oracle SOA Suite and have been creating very simple SCA WebServices (async and sync) prototypes to INSERT, UPDATE and Poll Oracle 9i and 11g databases. So far, everything works and passes the tests from EM.
    I cannot get the Stored Procedure WebService to test successfully as I receive the error message below regardless of JNDI configuration for XA, non-XA, Last Logging Resource, Support Global Transactions,PlatformClassName, etc...  The Outbound Connection Pool is setup correctly as the other DML tests have worked fine.
    BINDING.JCA-12563
    Exception occurred when binding was invoked.
    Exception occurred during invocation of JCA binding: "JCA Binding execute of Reference operation 'dbReference' failed due to: Interaction processing error.
    Error while processing the execution of the IFSAPP.TEST_SOA_API API interaction.
    An error occurred while processing the interaction for invoking the IFSAPP.TEST_SOA_API API. Cause: java.lang.NullPointerException
    Check to ensure that the XML containing parameter data matches the parameter definitions in the XSD.  This exception is considered not retriable, likely due to a modelling mistake.
    The invoked JCA adapter raised a resource exception.
    Please examine the above error message carefully to determine a resolution.
    Caused by: BINDING.JCA-12563
    Exception occurred when binding was invoked.
    Exception occurred during invocation of JCA binding: "JCA Binding execute of Reference operation 'callAPI' failed due to: Interaction processing error.
    Error while processing the execution of the IFSAPP.TEST_SOA_API API interaction.
    An error occurred while processing the interaction for invoking the IFSAPP.TEST_SOA_API API. Cause: java.lang.NullPointerException
    Check to ensure that the XML containing parameter data matches the parameter definitions in the XSD.  This exception is considered not retriable, likely due to a modelling mistake.
    The invoked JCA adapter raised a resource exception.
    Please examine the above error message carefully to determine a resolution.
       at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAInteractionInvoker.executeJcaInteraction(JCAInteractionInvoker.java:569)
        at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAInteractionInvoker.invokeJcaReference(JCAInteractionInvoker.java:724)
        at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAInteractionInvoker.invokeAsyncJcaReference(JCAInteractionInvoker.java:689)
        at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAEndpointInteraction.performAsynchronousInteraction(JCAEndpointInteraction.java:628)
        at oracle.integration.platform.blocks.adapter.AdapterReference.post(AdapterReference.java:325)
        ... 84 more
    Caused by: BINDING.JCA-11812
    Interaction processing error.
    Error while processing the execution of the IFSAPP.TEST_SOA_API API interaction.
    An error occurred while processing the interaction for invoking the IFSAPP.TEST_SOA_API API. Cause: java.lang.NullPointerException
    Check to ensure that the XML containing parameter data matches the parameter definitions in the XSD.  This exception is considered not retriable, likely due to a modelling mistake.
        at oracle.tip.adapter.db.exceptions.DBResourceException.createNonRetriableException(DBResourceException.java:690)
        at oracle.tip.adapter.db.exceptions.DBResourceException.createEISException(DBResourceException.java:656)
        at oracle.tip.adapter.db.sp.SPUtil.createResourceException(SPUtil.java:180)
        at oracle.tip.adapter.db.sp.SPInteraction.executeStoredProcedure(SPInteraction.java:183)
        at oracle.tip.adapter.db.DBInteraction.executeStoredProcedure(DBInteraction.java:1302)
        at oracle.tip.adapter.db.DBInteraction.execute(DBInteraction.java:307)
        at oracle.integration.platform.blocks.adapter.fw.jca.cci.JCAInteractionInvoker.executeJcaInteraction(JCAInteractionInvoker.java:415)
    Caused by: java.lang.NullPointerException
        at oracle.tip.adapter.db.sp.SPInteraction.executeStoredProcedure(SPInteraction.java:162)
        ... 91 more
    The SP SCA is the simplest possible application I can think of...  The WebService accepts a single INT, calls BPEL>Receive>Assign>Invoke>dbAdapter(Stored Procedure) that accepts a single IN INTEGER parameter in an Oracle 11g database.
    Steps I've used to create the SP SCA. (Create Empty SOA Application)
    1.) Create Database Adapter in External References swim lane.
    2.) Set JNDI and Connection.
    3.) Browse to Oracle Procedure...click through Wizard and accept all defaults.
       CREATE OR REPLACE PROCEDURE TEST_SOA_API (
         wo_order_no_ IN INTEGER)
       IS
       BEGIN
         INSERT INTO TEST_TMP VALUES (wo_order_no_);
       END;
    4.) WSDL, XSD, JCA are automatically generated. 
    5.) Create BPEL Process Component and select Template "Base on a WSDL".  I choose the WSDL created from the Database Adapter wizard.
    6.) The "Exposed Service" is automatically created and everything is wired.
    7.) I deploy to my CompactDomain (running on a local Oracle12 db).  No errors.
    8.) I login to EM and Test the WebService..and ALWAYS receive the error message above.
    I've tried BPEL Process and Mediator as components to simply pass the single incoming INT parameter to the SP DbAdapter and tried every combination I can think of with DataSource/DbAdapter Deployment through the Admin console.  I used the same exact steps above for INSERT, UPDATE, Polling and have had no issues so I cannot figure out why I'm not receiving java.NullPointer exception or why I'm receiving the XML/XSD malformation error.
    Stuck now...anyone have an idea what I'm doing wrong or simply tell me I'm an idiot and shouldn't do SP's this way?
    FYI.  I've turned on logging for the oracle.soa.adapter.db class to TRACE: 32(FINEST).  Not much help to me
    [2015-04-02T09:03:55.706-05:00] [AdminServer] [WARNING] [ADF_FACES-00007] [oracle.adf.view.rich.render.RichRenderer] [tid: 118] [userId: weblogic] [ecid: 852497f1-b648-4cac-9cee-05e7972ce68e-00000788,0] [APP: em] [DSID: 0000KluHqzk0NuGayxyWMG1L7K52000003] Attempt to synchronized unknown key: viewportSize.
    [2015-04-02T09:05:23.971-05:00] [AdminServer] [TRACE] [] [oracle.soa.adapter.db.outbound] [tid: 115] [userId: <anonymous>] [ecid: 852497f1-b648-4cac-9cee-05e7972ce68e-000007db,1:17474] [APP: soa-infra] [oracle.soa.tracking.FlowId: 250004] [oracle.soa.tracking.InstanceId: 1270014] [oracle.soa.tracking.SCAEntityId: 90004] [composite_name: OraclePLSQL2!1.0] [FlowId: 0000KluSpyP0NuGayxyWMG1L7K52000007] [SRC_CLASS: oracle.tip.adapter.db.sp.AbstractStoredProcedure] [SRC_METHOD: execute]  [composite_version: 1.0] [reference_name: dbReference] BEGIN IFSAPP.TEST_SOA_API(WO_ORDER_NO_=>?); END;
    [2015-04-02T09:05:23.972-05:00] [AdminServer] [TRACE] [] [oracle.soa.adapter.db.outbound] [tid: 115] [userId: <anonymous>] [ecid: 852497f1-b648-4cac-9cee-05e7972ce68e-000007db,1:17474] [APP: soa-infra] [oracle.soa.tracking.FlowId: 250004] [oracle.soa.tracking.InstanceId: 1270014] [oracle.soa.tracking.SCAEntityId: 90004] [composite_name: OraclePLSQL2!1.0] [FlowId: 0000KluSpyP0NuGayxyWMG1L7K52000007] [SRC_CLASS: oracle.tip.adapter.db.sp.AbstractStoredProcedure] [SRC_METHOD: execute]  [composite_version: 1.0] [reference_name: dbReference] Bindings [WO_ORDER_NO_=>INTEGER(2343)]
    WSDL
    <wsdl:definitions
         name="dbReference"
         targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/db/OraclePLSQL2/OraclePLSQL2/dbReference"
         xmlns:tns="http://xmlns.oracle.com/pcbpel/adapter/db/OraclePLSQL2/OraclePLSQL2/dbReference"
         xmlns:jca="http://xmlns.oracle.com/pcbpel/wsdl/jca/"
         xmlns:plt="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
         xmlns:db="http://xmlns.oracle.com/pcbpel/adapter/db/sp/dbReference"
         xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
        >
      <plt:partnerLinkType name="dbReference_plt" >
        <plt:role name="dbReference_role" >
          <plt:portType name="tns:dbReference_ptt" />
        </plt:role>
      </plt:partnerLinkType>
        <wsdl:types>
         <schema xmlns="http://www.w3.org/2001/XMLSchema">
           <import namespace="http://xmlns.oracle.com/pcbpel/adapter/db/sp/dbReference"
                   schemaLocation="../Schemas/dbReference_sp.xsd" />
         </schema>
        </wsdl:types>
        <wsdl:message name="args_in_msg">
            <wsdl:part name="InputParameters" element="db:InputParameters"/>
        </wsdl:message>
        <wsdl:portType name="dbReference_ptt">
            <wsdl:operation name="dbReference">
                <wsdl:input message="tns:args_in_msg"/>
            </wsdl:operation>
        </wsdl:portType>
    </wsdl:definitions>
    XSD
    <schema targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/db/sp/dbReference" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:db="http://xmlns.oracle.com/pcbpel/adapter/db/sp/dbReference" elementFormDefault="qualified">
       <element name="InputParameters">
          <complexType>
             <sequence>
                <element name="WO_ORDER_NO_" type="int" db:index="1" db:type="INTEGER" minOccurs="0" nillable="true"/>
             </sequence>
          </complexType>
       </element>
    </schema>
    Payload XML
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
            <soap:Body>
                    <ns1:InputParameters xmlns:ns1="http://xmlns.oracle.com/pcbpel/adapter/db/sp/dbReference">
                            <ns1:WO_ORDER_NO_>667</ns1:WO_ORDER_NO_>
            </ns1:InputParameters>
        </soap:Body>
    </soap:Envelope>

    An even simpler request:
    Can someone create an SCA that simply accepts a single INT parameter and calls a Stored Procedure (Oracle) that inserts this INT into a table?  Maybe upload the project folder structure in a zip? 
    Seems someone with experience on this platform could execute this task in 10-15 minutes.
    CREATE TABLE TEST_TMP (WO_ORDER_NO INT);
       CREATE OR REPLACE PROCEDURE TEST_SOA_API (
         wo_order_no_ IN INTEGER)
       IS
       BEGIN
         INSERT INTO TEST_TMP VALUES (wo_order_no_);
       END;

  • Switching Data Source for a report with stored procedure

    Post Author: ysbn
    CA Forum: Data Connectivity and SQL
    I've created a report and deployed it on a Crystal Server. The report is based on a certain stored procedure which also exists on other DB machines in my environment (Oracle machines). When I try to switch my report object to work with other machines (not the one originally used when the report was designed) the activation of the report fails. The error I see in the preview window is:
    Error in File <my rpt file name>: Failed to retrieve data from the database. Details: &#91;Database Vendor Code: 6550 &#93;
    When I try the same thing with a report which is based on a view and not a stored procedure the switching of Data Source works perfectly.
    Is there a problem switching between data sources from the server when the report is based on stored procedure? Are there any configurations I need to do in order to support this scenario?
    Thanks!

    Hi everyone~
    i am now facing the same problem
    i am using CR2008 and Visual Studio 2008 c# to write a window program
    because we have 2 db environment (one is production , the other one is development) so i have set a prarameter to switch db connection in c# code.
    the database is Oracle, and the the report will connect to Oracle procedure (which it is stored in package) this procedure will return reference cursor, so the report will loop up this cursor to generate report.
    at first time, it work fine when i open the report in CR2008 designer and point to dev database (ie datasource point to oracle procedure) . but when i want to deploy this win application to client and point to prod database, it show (vendor error 6550)
    i found that i cannot change the datasource during runtime in c# code...
    am i miss something in code? here attached a part of this code...
    private void setDBLogonForReport(ConnectionInfo info, ReportDocument doc)
                Tables myTables = doc.Database.Tables;
                foreach (Table myTable in myTables)
                    TableLogOnInfo logOnInfo = myTable.LogOnInfo;
                    logOnInfo.ConnectionInfo = info;
                    logOnInfo.TableName = myTable.Name;
                    myTable.ApplyLogOnInfo(logOnInfo);
                    //myTable.Location = info.UserID + "." + "pkg_crystal_report." + myTable.Name;
                    //someone suggest i have to set the 'Location' for change the datasource, but i am not sure how to construct a 
                    //string for point to oracle prcedure
    i will check it freq ... hope any expert can give me some advice ~
    thank you very much!!!

  • GRPO Stored Procedure Block for Cost Discrepancy

    Dear Experts,
    I am in the process of writing a stored procedure to block a GRPO from posting if one of the items' prices has a 30% discrepancy on item cost.
    I couldn't use AvgPrice as the value in the table considers the transaction being processed. What I am trying to do is compare the price with the previous GRPO's price done for this item.
    Any other suggestions would be great.
    Now this works fine until I add a second item on the document or even the same item twice. It will only apply block to item on first row.
    SP will only block first row in example below:
    #1 Item A 50.00
    #2 Item B 100.00
    #3 Item A 10.00
    I was wondering how the block can look at the individual lines, alternatively has anyone done something similar that can help me.
    Query:
    --Block Goods Receipt PO with 30% Price Discrepancy
    declare @item nvarchar(255)
    select @item = NULL
    IF @TRANSACTION_TYPE = 'A' AND @OBJECT_TYPE = '20'
    BEGIN
    Select @item = A.ItemCode
    From
                   (SELECT 'itemcode' =
                        CASE --greater than
                             When (((T1.Price -
                                       --fetch prev price
                                       (SELECT max(b.price)
                                       from opdn a inner join pdn1 b on a.DocEntry = b.docentry
                                       where b.ItemCode = T1.itemcode AND
                                       a.DocNum =
                                       (SELECT MAX(a1.Docnum) from OPDN a1 inner join PDN1 b1 on a1.DocEntry = b1.DocEntry
                                       WHERE b1.ItemCode = b.ItemCode
                                       AND a1.docnum <
                                                 (SELECT MAX(a2.Docnum) from OPDN a2 inner join PDN1 b2 on a2.DocEntry = b2.DocEntry
                                                 WHERE b2.ItemCode = b1.ItemCode)
                                       --##fetch prev price     
                                       --fetch prev price
                                       (SELECT max(b.price)
                                       from opdn a inner join pdn1 b on a.DocEntry = b.docentry
                                       where b.ItemCode = T1.Itemcode AND
                                       a.DocNum =
                                            (SELECT MAX(a1.Docnum) from OPDN a1 inner join PDN1 b1 on a1.DocEntry = b1.DocEntry
                                            WHERE b1.ItemCode = b.ItemCode
                                            AND a1.DocNum < (
                                            (SELECT MAX(a2.Docnum) from OPDN a2 inner join PDN1 b2 on a2.DocEntry = b2.DocEntry
                                                 WHERE b2.ItemCode = b1.ItemCode)
                                       --##fetch prev price     
                                       ) * 100) >= 30
                                  Then T1.ItemCode
                                  --smaller than
                                  When (((T1.Price -
                                       --fetch prev price
                                       (SELECT max(b.price)
                                       from opdn a inner join pdn1 b on a.DocEntry = b.docentry
                                       where b.ItemCode = T1.itemcode AND
                                       a.DocNum =
                                       (SELECT MAX(a1.Docnum) from OPDN a1 inner join PDN1 b1 on a1.DocEntry = b1.DocEntry
                                       WHERE b1.ItemCode = b.ItemCode
                                       AND a1.docnum <
                                                 (SELECT MAX(a2.Docnum) from OPDN a2 inner join PDN1 b2 on a2.DocEntry = b2.DocEntry
                                                 WHERE b2.ItemCode = b1.ItemCode)
                                       --##fetch prev price     
                                       --fetch prev price
                                       (SELECT max(b.price)
                                       from opdn a inner join pdn1 b on a.DocEntry = b.docentry
                                       where b.ItemCode = T1.Itemcode AND
                                       a.DocNum =
                                            (SELECT MAX(a1.Docnum) from OPDN a1 inner join PDN1 b1 on a1.DocEntry = b1.DocEntry
                                            WHERE b1.ItemCode = b.ItemCode
                                            AND a1.DocNum < (
                                            (SELECT MAX(a2.Docnum) from OPDN a2 inner join PDN1 b2 on a2.DocEntry = b2.DocEntry
                                                 WHERE b2.ItemCode = b1.ItemCode)
                                       --##fetch prev price     
                                       ) * 100) <= -30
                                  Then T1.ItemCode
                                  end
                        FROM [DBO].[OPDN] T0 INNER JOIN [DBO].[PDN1] T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OITM T2 on T1.ItemCode = T2.Itemcode     
                        --AND NOT T0.UserSign = 1 --Manager
                        AND T1.DOCENTRY = @LIST_OF_COLS_VAL_TAB_DEL) A
    IF EXISTS
    (Select @item where @item is not NULL)
         BEGIN
              SELECT @ERROR = 2, @ERROR_MESSAGE = 'Price Discrepancy too large. Please check item:' + ' ' + @item
         END
    END
    Thanks,
    Adriaan

    That's a really tough form to create.
    Here's a couple of dynamic forms you can try out:
    By Francois Degrelle:   "DYNAMIC_FORM.fmb".
    And my old dynamic matrix Form is here:   QA: Quick Access  An Oracle Forms dynamic utility form

  • Error in stored procedure while using dbms_datapump for transportable

    Hi,
    I'm facing following issue:
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    CORE 10.2.0.4.0 Production
    TNS for Solaris: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    ====================================================================================
    I'm trying to do transportable tablespace through stored procedure with help of DBMS_DATAPUMP, Following is the code :
    ==================================================================================
    create or replace
    procedure sp_tts_export(v_tbs_name varchar2) as
    idx NUMBER; -- Loop index
    JobHandle NUMBER; -- Data Pump job handle
    PctComplete NUMBER; -- Percentage of job complete
    JobState VARCHAR2(30); -- To keep track of job state
    LogEntry ku$_LogEntry; -- For WIP and error messages
    JobStatus ku$_JobStatus; -- The job status from get_status
    Status ku$_Status; -- The status object returned by get_status
         dts           varchar2(140):=to_char(sysdate,'YYYYMMDDHH24MISS');
         exp_dump_file varchar2(500):=v_tbs_name||'_tts_export_'||dts||'.dmp';
         exp_log_file varchar2(500):=v_tbs_name||'_tts_export_'||dts||'.log';
         exp_job_name varchar2(500):=v_tbs_name||'_tts_export_'||dts;
         dp_dir varchar2(500):='DATA_PUMP_DIR';
         log_file UTL_FILE.FILE_TYPE;
         log_filename varchar2(500):=exp_job_name||'_main'||'.log';
         err_log_file UTL_FILE.FILE_TYPE;
         v_db_name varchar2(1000);
         v_username varchar2(30);
         t_dir_name VARCHAR2(4000);
    t_file_name VARCHAR2(4000);
    t_sep_pos NUMBER;
         t_dir varchar2(30):='temp_0123456789';
         v_sqlerrm varchar2(4000);
    stmt varchar2(4000);
         FUNCTION get_file(filename VARCHAR2, dir VARCHAR2 := 'TEMP')
    RETURN VARCHAR2 IS
    contents VARCHAR2(32767);
    file BFILE := BFILENAME(dir, filename);
    BEGIN
              DBMS_LOB.FILEOPEN(file, DBMS_LOB.FILE_READONLY);
              contents := UTL_RAW.CAST_TO_VARCHAR2(
    DBMS_LOB.SUBSTR(file));
              DBMS_LOB.CLOSE(file);
              RETURN contents;
         END;
    begin
    --execute immediate ('drop tablespace test including contents and datafiles');
    --execute immediate ('create tablespace test datafile ''/home/smishr02/test.dbf'' size 10m');
    --execute immediate ('create table prestg.test_table (a number) tablespace test');
    --execute immediate ('insert into prestg.test_table values (1)');
    --commit;
    --execute immediate ('alter tablespace test read only');
    --dbms_output.put_line('11111111111111111111');
    dbms_output.put_line(log_filename||'>>>>>>>>>>>>>>>>>>>>>>>>>>>'|| dp_dir);
    log_file:=UTL_FILE.FOPEN (dp_dir, log_filename, 'w');
    UTL_FILE.PUT_LINE(log_file,'#####################################################################');
    UTL_FILE.PUT_LINE(log_file,'REPORT: GENERATED ON ' || SYSDATE);
    UTL_FILE.PUT_LINE(log_file,'#####################################################################');
    select global_name,user into v_db_name,v_username from global_name;
    UTL_FILE.PUT_LINE(log_file,'Database:'||v_db_name);
    UTL_FILE.PUT_LINE(log_file,'user running the job:'||v_username);
    UTL_FILE.PUT_LINE(log_file,'for tablespace:'||v_tbs_name);
    UTL_FILE.NEW_LINE (log_file);
    stmt:='ALTER TABLESPACE '||v_tbs_name || ' read only';
    dbms_output.put_line('11111111111111111111'||stmt);
    execute immediate (stmt);
    UTL_FILE.PUT_LINE(log_file,' '||v_tbs_name || ' altered to read only mode.');
    UTL_FILE.NEW_LINE (log_file);
    UTL_FILE.PUT_LINE(log_file,'#####################################################################');
    UTL_FILE.NEW_LINE (log_file);
    UTL_FILE.PUT_LINE(log_file,' Initiating the Datapump engine for TTS export..............');
    UTL_FILE.NEW_LINE (log_file);
    dbms_output.put_line('11111111111111111111');
    JobHandle :=
    DBMS_DATAPUMP.OPEN(
    operation => 'EXPORT'
    *,job_mode => 'TRANSPORTABLE'*
    *,remote_link => NULL*
    *,job_name => NULL*
    --,job_name => exp_job_name
    --        ,version => 'LATEST'
    UTL_FILE.PUT_LINE(log_file,'Done');
    UTL_FILE.NEW_LINE (log_file);
    UTL_FILE.PUT_LINE(log_file,' Allocating dumpfile................');
    DBMS_DATAPUMP.ADD_FILE(
    handle => JobHandle
    ,filename => exp_dump_file
    ,directory => dp_dir
    ,filetype => DBMS_DATAPUMP.KU$_FILE_TYPE_DUMP_FILE
    -- ,filesize => '100M'
    UTL_FILE.PUT_LINE(log_file,'Done');
    UTL_FILE.NEW_LINE (log_file);
    UTL_FILE.PUT_LINE(log_file,' Allocating logfile................');
    DBMS_DATAPUMP.ADD_FILE(
    handle => JobHandle
    ,filename => exp_log_file
    ,directory => dp_dir
    ,filetype => DBMS_DATAPUMP.KU$_FILE_TYPE_LOG_FILE
    UTL_FILE.PUT_LINE(log_file,'Done');
    UTL_FILE.NEW_LINE (log_file);
    UTL_FILE.PUT_LINE(log_file,' Setting attributes................');
    DBMS_DATAPUMP.set_parameter(handle => JobHandle,
    name=>'TTS_FULL_CHECK',
    value=>1);
    DBMS_DATAPUMP.METADATA_FILTER(
    handle => JobHandle
    ,NAME => 'TABLESPACE_EXPR'
    ,VALUE => 'IN ('''||v_tbs_name||''')'
    -- ,object_type => 'TABLE'
    UTL_FILE.PUT_LINE(log_file,'Done');
    UTL_FILE.NEW_LINE (log_file);
    UTL_FILE.PUT_LINE(log_file,' Now starting datapump job................');
    DBMS_DATAPUMP.START_JOB(JobHandle);
    UTL_FILE.PUT_LINE(log_file,'Done');
    UTL_FILE.NEW_LINE (log_file);
    UTL_FILE.PUT_LINE(log_file,' Monitoring the job................');
    --------------Monitor the job
    PctComplete := 0;
    JobState := 'UNDEFINED';
    WHILE(JobState != 'COMPLETED') and (JobState != 'STOPPED')
    LOOP
    DBMS_DATAPUMP.GET_STATUS(
    handle => JobHandle
    ,mask => 15 -- DBMS_DATAPUMP.ku$_status_job_error + DBMS_DATAPUMP.ku$_status_job_status + DBMS_DATAPUMP.ku$_status_wip
    ,timeout => NULL
    ,job_state => JobState
    ,status => Status
    JobStatus := Status.job_status;
    -- Whenever the PctComplete value has changed, display it
    IF JobStatus.percent_done != PctComplete THEN
    DBMS_OUTPUT.PUT_LINE('*** Job percent done = ' || TO_CHAR(JobStatus.percent_done));
    PctComplete := JobStatus.percent_done;
    END IF;
    -- Whenever a work-in progress message or error message arises, display it
    IF (BITAND(Status.mask,DBMS_DATAPUMP.ku$_status_wip) != 0) THEN
    LogEntry := Status.wip;
    ELSE
    IF (BITAND(Status.mask,DBMS_DATAPUMP.ku$_status_job_error) != 0) THEN
    LogEntry := Status.error;
    ELSE
    LogEntry := NULL;
    END IF;
    END IF;
    IF LogEntry IS NOT NULL THEN
    idx := LogEntry.FIRST;
    WHILE idx IS NOT NULL
    LOOP
    DBMS_OUTPUT.PUT_LINE(LogEntry(idx).LogText);
    idx := LogEntry.NEXT(idx);
    END LOOP;
    END IF;
    END LOOP;
         --copy the datafiles to data dump dir     
         UTL_FILE.PUT_LINE(log_file,'Done');
    UTL_FILE.NEW_LINE (log_file);
    UTL_FILE.PUT_LINE(log_file,' Copying datafiles to dump directory................');
    -- grant select on dba_directories to prestg;
    declare
    cnt number;
    begin
    select count(*) into cnt from dba_directories
    where directory_name=upper(t_dir);
    if cnt=1 then
    execute immediate('DROP DIRECTORY '||t_dir);
    end if;
    end;
         FOR rec in (select file_name from sys.dba_data_files where tablespace_name=v_tbs_name)
         LOOP
         t_sep_pos:=instr(rec.file_name,'/',-1);
    t_dir_name:=substr(rec.file_name,1,t_sep_pos-1);
    t_file_name:=substr(rec.file_name,t_sep_pos+1,length(rec.file_name));
    dbms_output.put_line(t_dir_name|| ' ' || t_dir);
    dbms_output.put_line(t_file_name);
         execute immediate('CREATE DIRECTORY '||t_dir||' AS '''||t_dir_name||'''');
         UTL_FILE.PUT_LINE(log_file,' Copying '||rec.file_name||'................');
         utl_file.fcopy(t_dir, t_file_name, dp_dir, t_file_name);
         UTL_FILE.PUT(log_file,'Done');
         execute immediate('DROP DIRECTORY '||t_dir);
         END LOOP;
    UTL_FILE.NEW_LINE (log_file);
    UTL_FILE.PUT_LINE(log_file,' Altering tablespace to read write................');
         execute immediate ('ALTER TABLESPACE '||v_tbs_name || ' read write');
    UTL_FILE.PUT(log_file,' Done');
         err_log_file:=utl_file.fopen(dp_dir, exp_log_file, 'r');
         UTL_FILE.NEW_LINE (log_file);
    UTL_FILE.PUT_LINE(log_file,' content of export logfile................');
         loop
    begin
         utl_file.get_line(err_log_file,v_sqlerrm);
         if v_sqlerrm is null then
         exit;
         end if;
         UTL_FILE.PUT_LINE(log_file,v_sqlerrm);
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    EXIT;
    END;
         end loop;
              utl_file.fclose(err_log_file);
    utl_file.fclose(log_file);
    END;
    I'm getting following error when DBMS_DATAPUMP.OPEN is called in procedure:
    SQL> exec sp_tts_export('TEST');
    BEGIN sp_tts_export('TEST'); END;
    ERROR at line 1:
    ORA-31626: job does not exist
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 79
    ORA-06512: at "SYS.DBMS_DATAPUMP", line 938
    ORA-06512: at "SYS.DBMS_DATAPUMP", line 4566
    ORA-06512: at "PRESTG.SP_TTS_EXPORT", line 78
    ORA-06512: at line 1
    ==============================================================================================
    This procedure is part of user ABC. I'm getting the above when I'm running this under ABC schema. However I have tested the same procedure under sys schema. When I'm creating same procedure in SYS schema it is running fine. I am clueless on this. Pls help
    Thanks
    Shailesh
    Edited by: shaileshM on Jul 28, 2010 11:15 AM

    Privileges acquired via ROLE do NOT apply within named PL/SQL procedures.
    Explicit GRANT is required to resolve this issue.

  • Error executing Stored Procedure that returns a recordset in Visual Basic 6

    Hello, i tried to use the example in the link posted as a response to my question in a previous thread, and in Visual Basic 6, when i execute the Stored procedure it gives me the following error:
    This is the package created as indicated in the example FAQ you posted.
    package types
    as
    type cursorType is ref cursor;
    end;
    This is the procedure created as indicated in the example FAQ you posted.
    PROCEDURE SP_TITUVALO(T_BR IN VARCHAR2,
    P_Cursor OUT TYPES.cursorType )
    AS
    BEGIN
    OPEN P_Cursor FOR
    SELECT * FROM TASAS WHERE BR=T_BR AND TASA > 0;
    END;
    This is the code used to execute the Stored Procedure in VB6:
    Dim objConn As New ADODB.Connection
    Dim connString
    Dim cmdStoredProc As New ADODB.Command
    Dim param1 As New ADODB.Parameter
    Dim RS As ADODB.Recordset
    Set param1 = cmdStoredProc.CreateParameter("T_BR", adVarChar, adParamInput, 255, "97")
    cmdStoredProc.Parameters.Append param1
    objConn.Open strconex
    Set cmdStoredProc.ActiveConnection = objConn
    cmdStoredProc.CommandText = "SP_TITUVALO"
    cmdStoredProc.CommandType = adCmdStoredProc
    Set RS = cmdStoredProc.Execute
    This is the error returned:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'SP_TITUVALO'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    ****************************************************************

    Juan,
    Not sure about FAQ you are referring to, but it seems that you need to set PLSQLRSet property of ADODB.Command to TRUE. Because if you fail to do so - errors with refcursors are likely to happen.
    Consider:
    Set objConn = CreateObject("ADODB.Connection")
    objConn.ConnectionString = "Provider=OraOLEDB.Oracle;Persist Security Info=False;Data Source=test9ora;User ID=max;Password=blabla"
    objConn.Open
    'Dim cmdStoredProc
    Set cmdStoredProc = CreateObject("ADODB.Command")
    Dim param1
    Set param1 = cmdStoredProc.CreateParameter("T_BR", adVarChar, adParamInput, 255, "97")
    param1.Value = "X"
    cmdStoredProc.Parameters.Append param1
    'Dim RS
    Set cmdStoredProc.ActiveConnection = objConn
    'The following line was missed out
    cmdStoredProc.Properties("PLSQLRSet") = True
    cmdStoredProc.CommandText = "SP_TITUVALO"
    cmdStoredProc.CommandType = adCmdStoredProc
    Set RS = cmdStoredProc.ExecuteThis works fine, at least for me.
    Cheers.

  • Report with stored procedures is unable to run in infoview.

    I developed report for my current employer using stored procedures and saved it to Enterprise environment. When running this report I am getting following Error in Infoview:
    Error in File ~tmp26285c856bf1180.rpt: Failed to retrieve data from the database. Details: [Database Vendor Code: -674 ]
    I can run my same report in Crystal Reports. Previous developer was using data source tables instead of stored procedures and report with tables were running successfully in infoview. What should I need to do in order to recognise my stored procedures in Infoview.
    We use informix databases.
    Regards,
    Rashid Khan

    The above issue have been resolved the issue. The problem was our BO administrator changed the Database server on CMC and my report in infoview was failing because of my stored procedure was not found on new database.

  • Sender JDBC with Stored Procedure or Function

    Hi.
    I have a problem to update a row that I obtain from sender JDBC (using SELECT or calling to a FUNCTION).
    As the consultation is so complex and the table has fed up transactions, often it takes the registry “A” and updates register “B”.
    Try to use the level of transaction “Serializable” (/people/yining.mao/blog/2006/09/13/tips-and-tutorial-for-sender-jdbc-adapter) but it throws the following error to me:
    "The JDBC driver returned the following error message: 'java.sql.SQLException: ORA-08177: can't serialize access for this transaction '. For details, contact your database server vendor."
    Try to invoke to a function (/people/jegathees.waran/blog/2007/03/02/oracle-table-functions-and-jdbc-sender-adapter) but when placing a sentence of UPDATE within the function throws an error, I reviewed to me and calling to a function from a SELECT, Oracle it does not allow to modify registries of the database.
    Some other suggestion?

    Hi,
    See this link,
    Here is an example of mapping for synch JDBC.
    /people/siva.maranani/blog/2005/09/16/xi-how-to-on-jdbc-receiver-response
    /people/siva.maranani/blog/2005/05/21/jdbc-stored-procedures
    Also go thru these links:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
    /people/alessandro.berta/blog/2005/10/04/save-time-with-generalized-jdbc-datatypes
    http://help.sap.com/saphelp_nw2004s/helpdata/en/4d/8c103e05df2e4b95cbcc68fed61705/frameset.htm
    Regards,
    Akshay Jamgaonkar.
    Reward points if find useful.

  • Error creating stored procedure using Apex

    Hello,
    I have worked with Access, SQL Server, and Firebird before, but am new to Oracle. I am trying to create a stored procedure to return the count of multiple hash values in a table. I want to know the number of rows that contain hash values that are duplicates somewhere else in the table. So if my table has 10 rows containing hash values: a, b, a, b, c, d, e, a, b, a, my return value should be 7. Here is my create procedure statement:
    CREATE OR REPLACE PROCEDURE CommonHashValuesCount (dupThreshold in number, totalCount out number)
    IS
    BEGIN
    totalCount := 0;
    FOR h IN
    (SELECT DISTINCT xf.MD5_HASH, COUNT(xf.MD5_HASH) as "HashCount"
    FROM XFILE xf
    GROUP BY xf.MD5_HASH)
    LOOP
    IF h.HashCount > dupThreshold THEN
    totalCount := totalCount + h.HashCount;
    END IF;
    END LOOP;
    END;
    I get the following error when I try and run it:
    ERROR at line 12: PL/SQL: Statement ignored
    1. CREATE OR REPLACE PROCEDURE CommonHashValuesCount (dupThreshold in number, totalCount out number)
    2. IS
    3. BEGIN
    Can anyone tell me what is wrong with my create statement? Or if anyone knows how to accomplish what I want in a single sql statement, I'd love to hear it!
    TIA,
    Theresa

    Why not do it in a SQL statement so you can test it in the APEX SQL command window?
    SELECT Sum(HashCount)
      FROM (SELECT DISTINCT xf.MD5_HASH
                 , COUNT(xf.MD5_HASH) HashCount
              FROM XFILE xf
             GROUP BY xf.MD5_HASH
    WHERE HashCount > <testvalue>
    not tested
    and then simply put that into your stored procedure/package:
    SELECT Sum(HashCount)
      INTO totalCount
      FROM (SELECT DISTINCT xf.MD5_HASH
                 , COUNT(xf.MD5_HASH) HashCount
              FROM XFILE xf
             GROUP BY xf.MD5_HASH
    WHERE HashCount > dubThreshold
    also not tested
    C.

  • MultiSelect Parameter with Stored Procedure not working

    I am using Crystal Reports 2008 and SQL Server 2008. I am using a stored procedure which works with a multiselect in SQL side. I am using a string to table utility function in the where clause with the In statment like below:
    WHERE FORMULARY_ID in
    --(@FORMULARY_ID)
      (SELECT Extractedtext
       FROM ClarityTST.[rpt].[LHfn_StringToTable]( @FORMULARY_ID, ',') ) 
    When I try to use the stored procedure I get an error message:
    "The stored procedure cannot accept multiple values. Please ensure that the multiple value is set to False:"
    I would like to use it with multiple parameters.

    Crystal uses arrays to handle multiple values.  As far as I'm aware, there is no way to get a multi-valued report parameter into SQL (command or SP) directly.  In the past, I have used a "shell" main report that gets the parameters, used Join() to concatenate the selected values into a single string, then pass that to the "main" subreport, and into its SQL or SP.  The SQL than would need to find the database field in the string.  If you make the string passed to the subreport valid SQL for an IN clause, you could do it that way, too.
    HTH,
    Carl

  • Error with a procedure in Forms 6i

    Hello,
    hope someone can help:
    I’m running Forms6i client /server and have a problem with a procedure. What I wish to do is to fill some text_item in a block with values from a query like this:
    Procedure test is
    BEGIN
    select distinct ( pc.d_id), pc.min_value, pc.max_value, pc.def_value, pc.act_value
    into :blk_multi.c_id,:blk_multi.txt_multi_min,:blk_multi.txt_multi_max, :blk_multi.txt_multi_def, :blk_multi.txt_multi_old_value
    from par_car pc, c_list cl
    where pc.par_id = 21 and pc.d_id IN (select cg.ce_id from cel_group cg where cg.gr_id like 'TEST') and
    pc.d_id = cl.c_id
    order by pc.d_id desc;
    end;
    In my form I have a button and in trigger WHEN-BUTTON-PRESSED I call this procedure. It returns error message FRM-40735 WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA-06502. What causes this error message?
    Regards
    Roar

    Roar,
    2 comments:
    1. Query into PLSQL variables and not forms fileds. After a successful query, set the value in teh variables to teh forms fields
    2. another problem with your implementation is that it breaks when many rows are retruned. You should use a cursor that loops trhough the query result sets. This way you are save.
    Frank

  • Error - remote stored procedure includes in a function

    Hi,
    I have a stored procedure, it runs properly
    ecos.GetCustTier@BSCSDEV in PL/SQL
    But after included into function F_GETCUSTTIER, it comes error.
    SQL> select f_getcusttier(585510,'20020808') from dual
    ORA-06571: Function F_GETCUSTTIER does not guarantee not to update database
    [Function F_GETCUSTTIER]
    create or replace FUNCTION f_getcusttier(
    Begin
    ecos.GetCustTier@BSCSDEV(i_customer_id, i_at_date, o_seqno, o_custcode, o_tier_id, o_tier_des, o_join_date, o_join_reason,
    o_renewal_date, o_next_review_date, o_last_review_amt_no, o_exit_date, o_exit_reason,
    o_input_by, o_input_date, o_update_by, o_update_date, o_expiry_date, o_next_job_review_date,
    o_status_id, o_return_code);
    RETURN o_tier_id;
    I also try to create a package for this function
    CREATE OR REPLACE PACKAGE abc AS
    FUNCTION f_getcusttier(i_customer_id number, i_at_date varchar2) RETURN NUMBER;
    PRAGMA RESTRICT_REFERENCES(f_getcusttier, WNDS);
    END abc;
    CREATE OR REPLACE PACKAGE BODY bwan AS
    FUNCTION f_getcusttier(
    i_customer_id in number,
    i_at_date in varchar2
    Begin
    ecos.GetCustTier@BSCSDEV(i_customer_id, i_at_date, o_seqno, o_custcode, o_tier_id, o_tier_des, o_join_date, o_join_reason,
    o_renewal_date, o_next_review_date, o_last_review_amt_no, o_exit_date, o_exit_reason,
    o_input_by, o_input_date, o_update_by, o_update_date, o_expiry_date, o_next_job_review_date,
    o_status_id, o_return_code);
    RETURN o_tier_id;
    But with Warning: Package Body created with compilation errors.
    2/1 PLS-00452: Subprogram 'F_GETCUSTTIER' violates its associated
    pragma
    How can I fixed it? Can function pack with remote stored procedure?
    DB version: 8.0.4.4.0
    I know that this problem is resolved in Release 8.1, is it no solution for release 8.0.4.4.0?

    First of all, please do not post three separate threads for the one problem. It simply clutters up the forum for the rest of us.
    Prior to 8i you need to explicitly guarantee that your function does not write to the database. You do this with the RESTRICT_REFERENCES pragma:
    CREATE PACKAGE yr_package AS  -- package specification
       FUNCTION whatever
             (pn IN NUMBER) RETURN NUMBER;
       PRAGMA RESTRICT_REFERENCES (whatever, WNDS);
    END yr_package;The following link goes to a page of helpful stuff assembeled by some of use regulars:Re: How to attach a java bean in forms6i
    It includes jumps to the Oracle online documentation. You may find the Application Developer's Guide - Fundamentals an instructive read.
    Regards, APC

Maybe you are looking for

  • Time Machine won't back up incrementally

    Hi there, Here's my situation.  Using a Mac Pro, Snow Leopard 10.6.8.  (still SL because I have a solid FCP7 set up and don't want to mess with it at the moment). I've used Time machine successfully with one large 6TB backup external hard drive. But

  • Mucic Manager Problems

    Nokia Music Manager 1.0 that is integrated with Nokia PC Suite is totally useless. I cannot believe that Nokia would publish software this awful. I am trying to use it with an N91 - it's all very well that the phone has 4GB of storage space, but usel

  • Syclo Work Manager 6.1 + SAP Connection Issue

    Hello, I have been trying to setup Syclo Work Manger 6.1 and testing the connection between Work Manager and SAP ERP System. I have updated the connectTest.bat with the ERP login details uder test_user, I get an "caught exception null" and the test i

  • Maintain Item Category OMH4

    Hi, Currently i have create an item category 'B' to limit the amount created for PO. When creating PO using this item category, i was prompted to enter the Asset Number. But after saving PO, i am not able to change the Asset Number. When i check the

  • Exporting to video

    I have a Flash CS4 file that when I export out to an uncompressed AVI, it is viewable in Winamp and in WIndows Media Player.  However, when I try to load it into a video editor, I get a couple of different results.  In Magix Movie Edit Prop ver 15, i