Funtion calling a procedure (getting errors)

HI,
I am calling a procedure inside a function(see code below).
Please see my second post for the code:
Message was edited by:
SeshuGiri

Ok here's a working example, though it doesn't use your data:
set echo on
drop table data1
drop table data1 succeeded.
create table data1 (id number,
                    sel number,
                    col1 varchar2(15),
                    col2 varchar2(15),
                    col3 varchar2(15))
create table succeeded.
insert into data1
select 1, 1, 'one-1','two-1','three-1' from dual union all
select 1, 1, 'one-2','two-2','three-2' from dual union all
select 1, 1, 'one-3','two-3','three-3' from dual union all
select 2, 2, 'one-4','two-4','three-4' from dual union all
select 2, 2, 'one-5','two-5','three-5' from dual union all
select 3, 1, 'one-6','two-6','three-6' from dual
6 rows inserted
drop type temp_data_tt
drop type temp_data_tt succeeded.
create or replace type temp_data as object (
  id number,
  col1 varchar2(15),
  col2 varchar2(15),
  col3 varchar2(15));
type temp_data Compiled.
create type temp_data_tt as table of temp_data;
type temp_data_tt Compiled.
create or replace procedure get_recs(criteria number, recs out sys_refcursor) is
begin
  open recs for select id, col1, col2, col3 from data1 where id=criteria;
end;
procedure get_recs(criteria Compiled.
create or replace function get_data(criteria number) return temp_data_tt pipelined is
  l_id number;
  col1 varchar2(15);
  col2 varchar2(15);
  col3 varchar2(15);
  rs sys_refcursor;
begin
  for drv in (select distinct id from data1 where sel=criteria) loop
    get_recs(drv.id, rs);
    loop
      fetch rs into l_id, col1, col2, col3;
      exit when rs%notfound;
      pipe row(temp_data(l_id, col1,col2,col3));
    end loop;
    close rs;
  end loop;
  return;
end;
function get_data(criteria Compiled.
select * from table(get_data(1))
ID                     COL1            COL2            COL3           
1                      one-1           two-1           three-1        
1                      one-2           two-2           three-2        
1                      one-3           two-3           three-3        
3                      one-6           two-6           three-6        
4 rows selected
select * from table(get_data(2))
ID                     COL1            COL2            COL3           
2                      one-4           two-4           three-4        
2                      one-5           two-5           three-5        
2 rows selected
select * from data1
ID                     SEL                    COL1            COL2            COL3           
1                      1                      one-1           two-1           three-1        
1                      1                      one-2           two-2           three-2        
1                      1                      one-3           two-3           three-3        
2                      2                      one-4           two-4           three-4        
2                      2                      one-5           two-5           three-5        
3                      1                      one-6           two-6           three-6        
6 rows selected

Similar Messages

  • Calling stored procedure - mysterious error

    Hi all,
    I have a problem with one stored procedure.
    The procedure looks like this simplified sample:
    create or replace procedure sp_sample (
    p_input1 in char,
    p_input2 in number,
    p_input10 in char,
    p_in_out in out number
    as
    l_in_out number(38) := p_in_out;
    begin
    select count(t1.id_t1)
    into l_in_out
    from table1 t1
    where
    (field1 = p_input1) and
    (field2 = p_input2) and
    (field10 like p_input10);
    p_in_out := l_in_out;
    end;
    And now the problem:
    When I call the procedure in some PL/SQL block like this:
    declare
    l_cnt number(38);
    begin
    sp_sample(
    p_input1 => 'ABC',
    p_input2 => 2,
    p_input10 => '%',
    p_in_out => l_cnt
    dbms_output.put_line(l_cnt);
    end;
    -> I receive the error message ORA-01722 in the first line of the select ("select count(t1.id_t1) ...").
    But if I call the procedure in similar PL/SQL block like this:
    declare
    l_cnt number(38);
    l_char char(10 char);
    begin
    l_char := '%';
    sp_sample(
    p_input1 => 'ABC',
    p_input2 => 2,
    p_input10 => l_char,
    p_in_out => l_cnt
    dbms_output.put_line(l_cnt);
    end;
    -> I receive a correct result.
    The only difference is in the using of a local variable instead of a string literal!
    When I simplified the conditions in the where clause in the select, the calling of the procedure passed always.
    It seems the error is caused by complicated condition in the select and some mystery concerning of passing parameters into a procedure or binding variables.
    Has anybody any experience like this?
    Jiri

    The old invalid number problem.
    Its one of the following:
    1) you are using implicit conversions
    2) you have a misunderstanding of how the oracle optimizer works.
    Probably 2, as the query works with the hardcoded literal but not the variable.
    Basically, you are getting two separate query plans, ie oracle is using a different way of getting the result depending on whether it is using a literal or a variable.
    Basically in one scenario, you are encountering a non-numeric character and an attempt is being made to convert this to a number.
    In the other, you never encounter the non-numeric character

  • While executing the Procedure Getting Error

    Hi I am New to ODI.
    I create one new Procedure just to delete the Target table.
    delete from <%=snpRef.getTable("L","T_CUSTOMER","D")%>. T_Customer is my target table.Technology:Oracle(Both Source and Target)
    I selected the correct Context ,Schema and Technology.
    While executing the procedure i am getting following error
    java.lang.Exception: Internal error: object ConnectConnection
    ColConnectId:null
    ColContextCode:DEV
    ColConName:null
    ColIndCommit:null
    ColIsolLevel:null
    ColLschemaName:null
    ColPlanComp:null
    ColTechIntName:null
    DefConnectId:null
    DefContextCode:DEV
    DefConName:null
    DefIndCommit:null
    DefIsolLevel:null
    DefLschemaName:FCS
    DefPlanComp:null
    DefTechIntName:ORACLE
    ExeChannel:J
    IndErr:1
    IndLogMethod:null
    IndLogNb:null
    LogLevDet:3
    Nno:1
    OrdTrt:0
    ScenTaskNo:1
    SessNo:61001
    TaskName1:Procedure
    TaskName2:Delete
    TaskName3:Delete
    TaskType:S
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execSrcOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlS.treatTaskTrt(SnpSessTaskSqlS.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.g.y(g.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Unknown Source)
    Thanks in advance.

    i Used the below syntax and checked its working fine.
    delete from <%=snpRef.getObjectName("L","T_CUSTOMER","D")%>

  • Insertin Data useing SQL Procedure Getting Error ORA-00942 and ORA-06512

    I have two Schemas ISYS and ISYSTWO
    I had created a Stored Procedure RECINC2 in Schema ISYS
    as
    procedure recinc2(cName IN CHAR,cWhere IN CHAR,cTable in CHAR)
    AS
    cQry VARCHAR2(1000);
    BEGIN
    cQry := 'INSERT INTO '||cName||'.'||cTable||' SELECT * FROM '||cTable|| ' WHERE ||cWhere;
    dbms_output.put_line(cqry);
    EXECUTE IMMEDIATE cQry;
    end;
    NOW WHEN in Run it gives error
    SQL> begin
    2 recinc2('ISYSTWO','CODE=4','AGENTS');
    3 end;
    4 /
    INSERT INTO ISYSTWO.AGENTS SELECT * FROM AGENTS WHERE CODE=4
    begin
    ERROR at line 1:
    ORA-00942: table or view does not exist
    ORA-06512: at "ISYS.RECINC2", line 8
    ORA-06512: at line 2
    BUT IF I EXECUTE
    the DBMS output
    INSERT INTO ISYSTWO.AGENTS SELECT * FROM AGENTS WHERE CODE=4
    it executes and gives fine result
    Please help
    Thanks
    Chaand kackria

    SQL> conn ISYSTWO/ISYSTWO
    Connected.
    SQL> grant all on agents to isys;
    Grant succeeded.
    SQL> conn isys/isys
    Connected.
    SQL> exec recinc2('ISYSTWO','CODE=4','AGENTS');
    INSERT INTO ISYSTWO.AGENTS SELECT * FROM AGENTS WHERE CODE=4
    PL/SQL procedure successfully completed.

  • OBPM 10g while calling web service getting error

    Hi all,
    I am facing problem while calling webservice from oracleBPM 10G , this is webservice method name
    zwsticketinginService.zwsCreateTicket( attachement : "X", callbackinf : "phone", callbackmeth : "mailid",
    category : "Problem", chdate : "2011-10-12", chtime : "11:12:22",
    comments : "desktop", crdate : "2011-10-12", crtime : "11:12:22",
    firstname : "krishna", incident : "TEXT", lastname : "moorthi",
    location : "canade", pbonr : "P56714", persnr : "8050456",
    priority : "High", problem : "others", relrequest : "norequ",
    service : "Workplace Problems",user : "krishna",
    out errornr : errno,
    out errortxt : err, out ticketnr : tkt);
    Introspecting also fine , for same web service working fine in SOAPUI , with out any error message , response also got.
    following error I am facing in OBPM 10G :
    trace : [fuego.xmlruntime.XMLValue.convertTo(XMLValue.java:398), fuego.xmlruntime.XMLValue.convertTo(XMLValue.java:245), fuego.soaptype.SoapCall.fixInputArguments(SoapCall.java:584),
    fuego.soaptype.SoapCall.invoke(SoapCall.java:230),
    fuego.soaptype.SoapObject.invoke(SoapObject.java:309),
    fuego.lang.Invokeable.invokeImpl(Invokeable.java:234)
    , fuego.lang.Invokeable.invokeDynamic(Invokeable.java:188), Test.Process.Default_1_0.Instance.CIL_automatic(Instance.xcdl:17), Test.Process.Default_1_0.Instance.CIL_automatic(Instance.xcdl), sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method), sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source), sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source),
    java.lang.reflect.Method.invoke(Unknown Source), fuego.component.ExecutionThreadContext.invokeMethod(ExecutionThreadContext.java:512), fuego.component.ExecutionThreadContext.invokeMethod(ExecutionThreadContext.java:273), fuego.fengine.FEEngineExecutionContext.invokeMethodAsCil(FEEngineExecutionContext.java:219), fuego.server.execution.EngineExecutionContext.runCil(EngineExecutionContext.java:1284), fuego.server.execution.microactivity.ComponentExecutionMicroActivity.runCil(ComponentExecutionMicroActivity.java:126),
    please help to solve this issue .
    thanks                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Problem , solved .
    don use date and time in webservice , OBPM not able to parse Date and Time values with SAP System.
    SOAP UI simulating in a different way to treat date and time.

  • HT4993 I tried to make a call bit kept getting "error message 16"  Why?

    I have a replacement iphone.  I tried to make a call from it and I got "error message 16"  Why?

    Ask your phone carrier why

  • CSCtq10477 - Callmanager 9.1 can't make outbound calls, Route List gets error 41 - All devices busy

    Hi all
    I seem to have run into bug CSCtq10477 and maybe CSCul71689 and CSCum85086, where calls can be received from an MGCP gateway, but fail outbound with Callmanager logs showing
    03095771.002 |17:34:14.103 |AppInfo  |RouteListCdrc::null0_CcSetupReq - Terminating a call after the RouteListCdrc cannot find any more device.
    03095771.003 |17:34:14.103 |AppInfo  |RouteListCdrc::terminateCall - No more Routes in RouteListName = RL_OUTBOUND.  Rejecting the call
    03095771.004 |17:34:14.103 |AppInfo  |RouteListCdrc::terminateCall - Sending CcRejInd, with the cause code (41), to RouteListControl because all devices are busy/stopped.
    03095771.005 |17:34:14.103 |AppInfo  |GenAlarm: AlarmName = RouteListExhausted, subFac = CALLMANAGERKeyParam = , severity = 4, AlarmMsg = RouteListName : RL_OUTBOUND, Reason=41, RouteGroups(RG_OUTBOUND)
    and a Route List exhausted alarm appearing in RTMT.
    Resetting the MGCP gateway in Callmanager, bouncing the serial interface, E1 controller and No MGCP/MGCP has no impact.  I could also see the circuit was not full.
    We have got round this by removing the gateway from the Route Group and pointing the Route Patterns directly at the gateway and this works.  I can see two of the bugs above are fixed in the latest 9.1.2SU3 code (9.1.2.13900-10), but I don't see CSCtq10477.  This bug document shows some 9.1 code is OK, but not this one.
    9.1(1.21020.1) - Not listed for download, is this an ES?
    9.1(2.10000.11) - Not listed for download, is this an ES?
    9.1(2.10000.28) - 9.1(2) - but not shown in the release notes for 9.1(2) either.
    Does anyone know if the Release notes just missed this out, or does the bug document need the Fixed versions to be updated?
    Thanks

    Hi,
    9.1(1.21020.1)  is an ES.
    9.1(2.10000.28) is the base version of 9.1(2) so this bug will be fixed in this version or any higher version of 9.1(2).
    Upgrading to the latest ES or 9.1(1) or 9.1(2)SU3 would take care of this bug.
    HTH
    Manish

  • Getting error calling a package/procedure from DB

    I'm on 11.1.1.6 and I'm trying to execute a procedure in a package in the DB my ADF application is connected to.  I get the following error  "Could not find saved view state for token".  If I comment out the execution of the method that is calling the procedure the error goes away.  The error shows up under the log for the application on the EM console.  The procedure does not get executed.  Can anyone tell me what it could be?  I am using the tool Oracle provided to gain access to the EBS database without using the apps password.  I wonder if that may be causing the issue?  Can it be related to a security or grant issue of some kind?  The package procedure is under the apps schema.

    Hi,
    I don't think that on this forum we know enough about EBS to be helpful with security privileges. But if you read this here ADF &amp;amp; Weblogic How To: TROUBLESHOOTING: Could not find saved view state for token ...
    then it seems that there are some sort of access problem
    Frank

  • Getting error while calling procedure from remote database

    When I am trying to call child procedure from remote database I am getting below error:
    ORA-02064: distributed operation not supported
    ORA-06512: at "NMUSER.NEW_CUST_UPLOAD", line 740
    (P.S. on line no 740 I issued "commit;" )
    I checked rights,synonym on all the objects they are fine.

    Oracle Error: ORA-02064
    Error Description:
    Distributed operation
    not supported
    Error Cause:
    One of the following
    unsupported operations was attempted:
    1. array execute of a remote update with a subquery that references a dblink,
    or
    2. an update of a long column with bind variable and an update of a second
    column with a subquery that both references a dblink and a bind variable, or
    3. a commit is issued in a coordinated session from an RPC procedure call
    with OUT parameters or function call.
    Cheers,
    Manik.

  • Getting error code 1 when calling SSIS package from a stored procedure (SQL Server 2008 R2)

    Hello,
    I am trying to execute a SSIS package from SQL Server 2008 R2 stored procedure but getting error code 1 (as per my knowledge, error code description is as below:
    0 The package executed successfully.
    1 The package failed.
    3 The package was canceled by the user.
    4 The utility was unable to locate the requested package. The package could not be found.
    5 The utility was unable to load the requested package. The package could not be loaded.
    6 The utility encountered an internal error of syntactic or semantic errors in the command line.
    Details:
    I have a stored procedure named "Execute_SSIS_Package" (see below sp) which executes 'Import_EMS_Response' SSIS package (when I execute this package directly from SQL Server BID it works fine it means package itself is correct) and calling
    it from SQL as:- EXEC Execute_SSIS_Package 'Import_EMS_Response'.
    Here I receives error code 1.
    Can anyone help me to resolve this issue please?
    Thanks in advance!
    CREATE PROCEDURE [dbo].[Execute_SSIS_Package]
     @strPackage nvarchar(100)
    AS
    BEGIN
     -- SET NOCOUNT ON added to prevent extra result sets from
     -- interfering with SELECT statements.
     SET NOCOUNT ON;
     DECLARE @cmd VARCHAR(8000)
     DECLARE @Result int
     DECLARE @Environment VARCHAR(100)
        SELECT @Environment = Waarde
     FROM  Sys_Settings
     WHERE Optie = 'Omgeving'
     --print @Environment
     SET @strPackage = '"\W2250_NGSQLSERVER\BVT\' + @Environment + '\' + @strPackage + '"'
     SET @cmd = 'dtexec /SQL ' + @strPackage +  ' /SERVER "w2250\NGSQLSERVER"  /Decrypt "BVT_SSIS" /CHECKPOINTING OFF /REPORTING E'
     --print @cmd
     EXECUTE @Result = master..xp_cmdshell @cmd, NO_OUTPUT
     --print @Result
    END

    It has something to do with the security.
    E.g. cmdshell is not enabled or the caller has not rights over the package.
    There could be a syntax error, too.
    I suggest you make the package runnable off a SQL Agent job then trigger the job from the stored proc with
    sp_start_job <job name>
    Arthur
    MyBlog
    Twitter

  • Getting ora-00900 error when calling the procedure with the dynamic sql.

    create or replace procedure dyn_update(tab in varchar2,col in VARCHAR2) as
    BEGIN
    execute IMMEDIATE 'update'||tab||'set'||col||'= 0 where order_id=2458';
    end;
    and when i call this procedure in sql developer or sql* plus using
    begin
    dyn_update('Orders',Order_status');
    end;
    I am getting the oracle 0ra 00900 error.
    can any one please help me

    just a tip:
    Create your dynamic string in a local variable, so you can easily see why it is giving an exception
    create or replace procedure dyn_update(tab in varchar2,col in VARCHAR2) as
       str varchar2(32767);
    BEGIN
       str := 'update '||tab||' set'||col||'= 0 where order_id=2458';
       dbms_output.put_line (str);
      execute IMMEDIATE str;
    end;

  • Getting Error message when execute Netezza Stored Procedure calling in ODI

    Hi,
    I need help to resolve this issue,
    I'm trying to execute a Netezza stored procedure passing three parameters and It getting error message .
    code:import java.sql as sql
    import java.lang as lang
    import java.sql.Types as types
    MyCon = snpRef.getJDBCConnection("SRC")
    def CALL_NZ_SP():
         try: p_log_id = 22
    p_step_number = 2
              p_drive_id= 3455
    myStmt = MyCon.prepareStatement("CALL SP_NAME(?,?,?)");
              myStmt.setInt(1, p_log_id);
              myStmt.setInt(2, p_step_number);
              myStmt.setInt(3, p_drive_id);
              resultSet=myStmt.executeQuery();
              resultSet.next();
              sp_return=resultSet.getInt(1);
              if sp_return !=0:
              raise 'fail';
         finally:
              pass
    Please let me know is this the right code or need any code updatation.
    I appreciate ur help in this regard
    Thanks
    brk

    Hi Gowsiya,
    Maybe the WCF forum would be better for this issue, you know that this forum is to discuss the VS IDE.
    WCF forum link:
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=wcf
    Thanks for your understanding.
    Best Regards,
    Jack
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Error while calling a procedure from ESB

    Hi,
    I am calling a procedure from ESB using DB adapter. and in the routing rules i am mapping the i/p values for schema to procedure input variables using mappings(transformation) but the values are going as null to the procedure call.
    Please help me out.
    The exception follows...
    An unhandled exception has been thrown in the ESB system. The exception reported is: "org.collaxa.thirdparty.apache.wsif.WSIFException: esb:///ESB_Projects/ESB-Issues_issue3/db3.wsdl [ db3_ptt::db3(InputParameters,OutputParameters) ] - WSIF JCA Execute of operation 'db3' failed due to: Error while trying to prepare and execute an API.
    An error occurred while preparing and executing the SYSTEM.INSERT_ISSUE_PROC API. Cause: java.sql.SQLException: ORA-01400: cannot insert NULL into ("SYSTEM"."ISSUES"."ISSUE_NAME")
    ORA-06512: at "SYSTEM.INSERT_ISSUE_PROC", line 16
    ORA-06512: at line 1
    [Caused by: ORA-01400: cannot insert NULL into ("SYSTEM"."ISSUES"."ISSUE_NAME")
    ORA-06512: at "SYSTEM.INSERT_ISSUE_PROC", line 16                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    This is likely being caused by a problem that we've seen a number of times. You'll have namespace issues and problems with NULLs if your JDev is 10.1.3.1 and SOA is 10.1.3.3 (or vice-versa). You MUST synchronize JDev 10.1.3.3 (or higher) with SOA 10.1.3.3 (or higher). It doesn't matter if you mix 10.1.3.3 and 10.1.3.4. You just need to get away from 10.1.3.1.

  • Error in calling collection procedure.

    Hi Experts,
    In a package I have one procedure "setscores_ram_bulk" with collection varaiavles.
    And other two procedures are "UpdateRelatedOrders" and "SetGeoFraudScore" with out collections.
    I am calling collection procedure "setscores_ram_bulk" in non collection procedures "UpdateRelatedOrders" and "SetGeoFraudScore".
    I am getting the below error.
    PLS-00306:wrong number or types of arguments in call to 'SETSCORES_RAM_BULK' .
    I am sending my code.
    CREATE OR REPLACE PACKAGE GAFT_PROG_DIT.INTERNAL_SCORING_setscore_Bulk
    IS
    TYPE rec_setscores IS RECORD
    pBUID     score.buid%TYPE,
    OrderNum   score.order_num%TYPE,
    ScoreType  VARCHAR2(100),
    p_Score       score.velocity_score%TYPE
    type pp_rec_setscores is table of rec_setscores index by pls_integer;
    PROCEDURE UpdateRelatedOrders (pBUID IN NUMBER, OrderNum IN VARCHAR2);
    PROCEDURE SetGeoFraudScore (pBUID         IN     NUMBER,
                                   OrderNum      IN     VARCHAR2,
                                   ZipCode       IN     VARCHAR2,
                                   CountryCode   IN     VARCHAR2,
                                   score         OUT NUMBER);
    PROCEDURE setscores_ram_bulk (p_rec_setscores  pp_rec_setscores);                              
    END;
    CREATE OR REPLACE PACKAGE BODY GAFT_PROG_DIT.INTERNAL_SCORING_setscore_Bulk
    IS
       PROCEDURE UpdateRelatedOrders (pBUID IN NUMBER, OrderNum IN VARCHAR2)
       IS
          tScoreID    STAGING_ORDER_DATA.SCORING_ID%TYPE;
          tVelocity   SCORE.VELOCITY_SCORE%TYPE;
          tNegative   SCORE.NEGATIVE_SCORE%TYPE;
          tTrend      SCORE.TREND_SCORE%TYPE;
          CURSOR scoreCursor (
             scoreID    NUMBER,
             OrdNum     VARCHAR2)
          IS
             SELECT ORDER_NUM
               FROM STAGING_ORDER_DATA
              WHERE     SCORING_ID = scoreID
                    AND ADDRESS_TYPE = 'S'
                    AND ORDER_NUM != OrdNum;
       BEGIN
          SELECT SCORING_ID
            INTO tScoreID
            FROM STAGING_ORDER_DATA
           WHERE BUID = pBUID AND ORDER_NUM = OrderNum AND ADDRESS_TYPE = 'S';
          IF tScoreID IS NOT NULL
          THEN
             SELECT VELOCITY_SCORE, NEGATIVE_SCORE, TREND_SCORE
               INTO tVelocity, tNegative, tTrend
               FROM SCORE
              WHERE BUID = pBUID AND ORDER_NUM = OrderNum;
             FOR ord_rec IN scoreCursor (tScoreID, OrderNum)
             LOOP
                setscores_ram_bulk (pBUID,ord_rec.ORDER_NUM,'V',tVelocity);
                setscores_ram_bulk (pBUID,ord_rec.ORDER_NUM,'N',tNegative);
                setscores_ram_bulk (pBUID,ord_rec.ORDER_NUM,'T',tTrend);
             END LOOP;
             IF scoreCursor%ISOPEN
             THEN
                CLOSE scoreCursor;
             END IF;
          END IF;
       END UpdateRelatedOrders;
        PROCEDURE SetGeoFraudScore (pBUID         IN     NUMBER,
                                   OrderNum      IN     VARCHAR2,
                                   ZipCode       IN     VARCHAR2,
                                   CountryCode   IN     VARCHAR2,
                                   score            OUT NUMBER)
       IS
          tZipCodeExist   NUMBER;
          tScore          NUMBER;
       BEGIN
          SELECT COUNT (Score)
            INTO tZipCodeExist
            FROM MASTER_GEO_FRAUD
           WHERE REPLACE (UPPER (ZIP_CODE), ' ', '') =
                    REPLACE (UPPER (ZipCode), ' ', '')
                 AND COUNTRY_CODE = CountryCode;
          IF tZipCodeExist > 0
          THEN
             SELECT Score
               INTO tScore
               FROM MASTER_GEO_FRAUD
              WHERE REPLACE (UPPER (ZIP_CODE), ' ', '') =
                       REPLACE (UPPER (ZipCode), ' ', '')
                    AND COUNTRY_CODE = CountryCode;
          ELSE
             tScore := 1000;
          END IF;
    setscores_ram_bulk (pBUID,OrderNum,'XS',tScore);
          COMMIT;
          score := tScore;
       END SetGeoFraudScore;
       PROCEDURE setscores_ram_bulk (p_rec_setscores pp_rec_setscores)
       IS
       BEGIN
          FORALL i IN 1 .. p_rec_setscores.COUNT
             MERGE INTO   score s
                  USING   (SELECT   p_rec_setscores (i).pBUID buid,
                                    p_rec_setscores (i).OrderNum order_num,
                                    p_rec_setscores (i).p_score score
                             FROM   DUAL) p
                     ON   (s.buid = p.buid AND s.order_num = p.order_num)
             WHEN MATCHED
             THEN
                UPDATE SET
                   velocity_score =DECODE (p_rec_setscores (i).ScoreType,'V', p.score,velocity_score),
                   negative_score =DECODE (p_rec_setscores (i).ScoreType,'N', p.score,negative_score),
                   trend_score =DECODE (p_rec_setscores (i).ScoreType,'T', ROUND (p.score),trend_score),
                   vendor_combined_score =DECODE (p_rec_setscores (i).ScoreType,'X', p.score,vendor_combined_score),
                   vendor_bt_score =DECODE (p_rec_setscores (i).ScoreType,'XB', p.score,vendor_bt_score),
                   vendor_st_score =DECODE (p_rec_setscores (i).ScoreType,'XS', p.score,vendor_st_score)
             WHEN NOT MATCHED
             THEN
                INSERT  (buid, order_num, received_date_time)
                    VALUES  (p.buid, p.order_num, SYSDATE);
          FORALL i IN 1 .. p_rec_setscores.COUNT
             MERGE INTO   score_filter_apply s
                  USING   (SELECT   p_rec_setscores (i).pBUID buid,
                                    p_rec_setscores (i).OrderNum order_num,
                                    p_rec_setscores (i).p_score score
                             FROM   DUAL) p
                     ON   (s.buid = p.buid AND s.order_num = p.order_num)
             WHEN MATCHED
             THEN
                UPDATE SET
                   velocity_score =DECODE (p_rec_setscores (i).ScoreType,'V', p.score,velocity_score),
                   negative_score =DECODE (p_rec_setscores (i).ScoreType,'N', p.score,negative_score),
                   trend_score =DECODE (p_rec_setscores (i).ScoreType,'T', ROUND (p.score),trend_score),
                   vendor_combined_score =DECODE (p_rec_setscores (i).ScoreType,'X', p.score,vendor_combined_score),
                   vendor_bt_score =DECODE (p_rec_setscores (i).ScoreType,'XB', p.score,vendor_bt_score),
                   vendor_st_score =DECODE (p_rec_setscores (i).ScoreType,'XS', p.score,vendor_st_score)
             WHEN NOT MATCHED
             THEN
                INSERT (buid, order_num, received_date_time)
                    VALUES   (p.buid, p.order_num, SYSDATE);
       END setscores_ram_bulk; 
       END;
       /Please help me.
    Thanks in advance.

    BluShadow wrote:
    Paul  Horth wrote:
    You haven't taken any notice of what Alberto posted in {message:id=11026562} I see.
    Why should anyone bother helping you if you never think we have answered your questions?Indeed, that must be a new record:
    >
    Total Posts: 336
    Total Questions: 160 (160 unresolved)
    >
    Out of 160 questions... none of them have been resolved.
    That's either down to poor answers (very unlikely with the amount of experts around) or poor questions (quote likely) or sheer laziness on feeding back on answers and marking questions as answered when they have been (most likely).Indeed, your own post just after Alberto's seems to sum it up :-)

  • Getting error while executing a procedure and assign the output in BPEL

    Hi
    I am getting the Following error while deploying BPEL in 10.1.3.1. I have invoked Database Adapter and called a procedure and that procedure returns a output. I have assigned that output to a variable.
    empty variable/expression result.
    xpath variable/expression expression "/ns2:OutputParameters/ns2:GREETING" is empty at line 98, when attempting reading/copying it.
    Please make sure the variable/expression result "/ns2:OutputParameters/ns2:GREETING" is not empty.
    Please reply me with Solutions

    Hi,
    Are you getting this error while deploying or testing ?
    Normally this will happen due to namespace mismatch issue. But if you have auto-created the variables then JDev will take care of it so it should not be a problem
    Also, please check if this also happens if the code is deployed to 10.1.3.3 ?
    Regards,
    ketan

Maybe you are looking for