Stored Proc running twice using DBMS_Scheduler

Hello all,
I have a vb front end that calls a main stored proc which submits scheduler jobs to execute several stored procs asynchronously. Everything is working, except the part that the several stored procs are running twice. In the troubleshooting, I have eliminated the front end from being the culprit and the stored procs themselves. Essentially, when I call the stored proc using dbms_scheduler.create_job, it runs twice, even manually. I am about at wits end trying to figure out why: Using Oracle 11gR2
I started off setting up the programs
begin
--create program
dbms_scheduler.create_program
( program_name => 'prog_name'
,program_type => 'STORED_PROCEDURE'
,program_action => 'usp_sub_proc_1'
,number_of_arguments => 8
,enabled => FALSE
dbms_scheduler.DEFINE_PROGRAM_ARGUMENT
( program_name=> 'prog_name'
,argument_position=>1
,argument_name => 'name'
,argument_type=>'VARCHAR2'
/*the remaining 7 arguments are in code but not display for space reasons*/
dbms_scheduler.enable('prog_name');
end;Then the main stored proc executes this code:
declare v_job_name varchar2(100);
    v_1 varchar(50) := 'All';
    v_2 varchar(50) := 'All';
    v_3 varchar(50) := 'All';
    v_4 varchar(50) := 'All';
    v_5 varchar(50) := 'TEST';
    i_6 integer := 1;
    v_7 varchar(50) := 'TEST_NE';
    ts_8 timestamp := current_timestamp;
begin
    v_job_name := 'uj_dmo_1';
dbms_scheduler.create_job (v_job_name
                                        ,program_name => 'prog_name'
                                        ,job_class => 'UCLASS_1'
                                        ,auto_drop => TRUE
--set parameters
dbms_scheduler.set_job_argument_value(v_job_name,1, v_1);
dbms_scheduler.set_job_argument_value(v_job_name,2, v_2);
dbms_scheduler.set_job_argument_value(v_job_name,3, v_3);
dbms_scheduler.set_job_argument_value(v_job_name,4, v_4);
dbms_scheduler.set_job_argument_value(v_job_name,5, v_5);
dbms_scheduler.set_job_argument_value(v_job_name,6, to_char(i_6));
dbms_scheduler.set_job_argument_value(v_job_name,7, v_7);
dbms_scheduler.set_job_argument_value(v_job_name ,8, to_char(ts_8));
--enable job
dbms_scheduler.enable(v_job_name);
--execute job
dbms_scheduler.run_job(job_name => v_job_name , use_current_session => FALSE);
end;
...And this is where I get the double execution of the job, but I am just not seeing it in my syntax, dba_scheduler_jobs, logging, etc. Any help is greatly appreciated, thanks!!

Well apparently I will not win any Captain Obvious awards;
With 34MCA2K2's response with "what doesn't work" for some reason turned the light on. After some more testing here is what I found.
This code works as expected :
Exhibit A
begin
dbms_scheduler.create_job (job_name =>'TESTER'
                               ,job_type => 'PLSQL_BLOCK'
                               ,job_action => 'declare test1 integer := 1; begin test1 := test1 + 5; end;'
                               ,auto_drop => True
   /*dbms_scheduler.enable('TESTER');   */
   dbms_scheduler.run_job(job_name => 'TESTER', use_current_session =>FALSE);   
end;As does this:
Exhibit B
begin
dbms_scheduler.create_job (job_name =>'TESTER'
                               ,job_type => 'PLSQL_BLOCK'
                               ,job_action => 'declare test1 integer := 1; begin test1 := test1 + 5; end;'
                               ,auto_drop => True
   dbms_scheduler.enable('TESTER');  
  /*dbms_scheduler.run_job(job_name => 'TESTER', use_current_session =>FALSE);    */
end;Exhibit A will create the job and is visible in the schedulerjobs view, and the RUN_JOB will execute it even when not enabled, but the pl/sql will not drop the job.
Exhibit B will create the job and once enabled, executes the job and then drops from schedulerjobs view.
Therefore, my desired results for running the jobs once asynchronously and dropping immediately is....
begin
    v_job_name := 'uj_dmo_1';
dbms_scheduler.create_job (v_job_name
                                        ,program_name => 'prog_name'
                                        ,job_class => 'UCLASS_1'
                                        ,auto_drop => TRUE
--set parameters
dbms_scheduler.set_job_argument_value(v_job_name,1, v_1);
dbms_scheduler.set_job_argument_value(v_job_name,2, v_2);
dbms_scheduler.set_job_argument_value(v_job_name,3, v_3);
dbms_scheduler.set_job_argument_value(v_job_name,4, v_4);
dbms_scheduler.set_job_argument_value(v_job_name,5, v_5);
dbms_scheduler.set_job_argument_value(v_job_name,6, to_char(i_6));
dbms_scheduler.set_job_argument_value(v_job_name,7, v_7);
dbms_scheduler.set_job_argument_value(v_job_name ,8, to_char(ts_8));
/*enable job*/
dbms_scheduler.enable(v_job_name);
/*execute job (Do not execute the code below, it will lead to multiple executions)
dbms_scheduler.run_job(job_name => v_job_name , use_current_session => FALSE); */
end;

Similar Messages

  • Multiple stored procs execution parallelly using single DBMS_SCHEDULER

    Hi All,
    I have to run 10 tasks - a few simultaneously, and a few periodically using DBMS_SCHEDULER.
    But instead of creating 10 different Schedulers, is there a way in Oracle to create a single scheduler and invoke the tasks base on respective times?
    I have been going thru SCHEDULERS documentation but i am unable to make much progress.
    Thanks,
    Chaitanya

    Hi,
    You can run the multiple process under the same scheduler to set the appropriate priority.
    DBMS_SCHEDULER.create_job (
    job_name => 'test_priority_job',
    job_type => 'PLSQL_BLOCK',
    job_action => 'BEGIN DBMS_LOCK.sleep(10); END;',
    start_date => SYSTIMESTAMP,
    repeat_interval => 'freq=minutely;',
    end_date => SYSTIMESTAMP + 1/48,
    enabled => FALSE,
    comments => 'Job used to test priorities.');
    DBMS_SCHEDULER.set_attribute (
    name => 'test_priority_job',
    attribute => 'job_priority',
    value => 1);
    DBMS_SCHEDULER.set_attribute (
    name => 'test_priority_job1',
    attribute => 'job_priority',
    value => 1);
    Like the above code.
    ~Kushal

  • Calling stored proc from java using ref cursor

    Hi All,
    We have a requirement to display all the records from a table on a JAVA screen. Due to some constraints, we have to write the query in the stored proc. We are trying to return a result set from the stored proc to the java code by using a ref cursor. Please refer to the code below.
    Following is the PL/SQL proc �
    procedure sp_user_course2(v1 OUT ref_cursor, persid in varchar2) as
    begin
    open v1 for
    SELECT lrn_exp_id, crs_name FROM emp_crs
    WHERE personid = persid;
    end;
    Here ref_cursor is of TYPE REF CURSOR declared in the package specification.
    The java code is �
    Callable stmt = conn.prepareCall("call sp_user_course2(?,?)");
    stmt.registerOutParameter(1,OracleTypes.CURSOR);
    stmt.setString(2,emplId);
    stmt.execute();
    OracleCallableStatement tstmt = (OracleCallableStatement) stmt;
    ResultSet rs = tstmt.getCursor (1);
    When I run the program, I get the following error (at stmt.execute()):
    [Oracle][ODBC][Ora]ORA-06553: PLS-306: wrong number or types of arguments in call to 'SP_USER_COURSE2' 6553
    Can anyone tell me what could be the problem with this code? I have read somewhere that REF CURSOR feature is available from Oracle 9i onwards. If so, then, is there any workaround for mapping REF CURSOR to Resultsets in Oracle 8i?

    These may help
    http://www.google.co.uk/search?q=jdbc+OracleTypes.CURSOR+tutorial

  • Report with stored proc running multiple stored procedures with insert statement

    Hi,
    I wonder if this is possible in SSRS ... I use the 2012 version (Data Tools).
    I have a report that triggers a stored procedure. See below.
    Within this SP there are 2 insert statements getting data from 2 other SP's.
    When I make a dataset referring to the main SP below, SSRS does not show me any fields at all.
    Is this because it's a SP with insert statements and nested SP's?
    At the end of the SP I make a select so it should see all the fields.
    The parameters @month and @costcenter are multivalue params. I use a special function to convert the multivalues, selected in the report, into a string to pass it correctly to the query (comma separated).
    USE [TestDB]
    GO
    /****** Object:  StoredProcedure [dbo].[_Pink_SP_StandingsRegisterDataset]    Script Date: 15-4-2014 13:31:30 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    ALTER PROCEDURE [dbo].[_Pink_SP_StandingsRegisterDataset]
    @year INT,
    @month NVARCHAR(50),
    @costcenter NVARCHAR(500),
    @GLaccount NVARCHAR(9)
    AS
    BEGIN
    /* Remove existing content*/
    DELETE FROM _Pink_TB_StandingsRegister
    /* Add records part 1 */
    INSERT INTO _Pink_TB_StandingsRegister
    EXEC _Pink_SP_StandingsRegister @year, @month, @costcenter, @GLaccount
    /* Add records part 2 */
    INSERT INTO _Pink_TB_StandingsRegister
    Type,
    Row,
    Year,
    Month,
    YearDatetable,
    MonthDatetable
    EXEC _Pink_SP_StandingsRegisterDatetable @year
    /* Select all records */
    SELECT *
    FROM _Pink_TB_StandingsRegister
    END
    GO

    Hi bijntjede2e,
    After testing a similar scenario in my own environment, it works well in Reporting Services. In my test, the stored procedure returns all the fields from _Pink_TB_StandingsRegister table in the dataset. Then I select some values from year, month, costcenter
    and Glaccount parameters, it inserts some values in the _Pink_TB_StandingsRegister table. So we can use this stored procedure as the dataset in the report.
    In order to solve the problem more efficiently, I need to clarify some information.
    Are you pass multiple values parameter to one stored procedure correctly? We can refer to the following thread:
    http://social.technet.microsoft.com/Forums/en-US/dbdfa101-cccc-4e9f-aa50-566dc5ebcc27/ssrs-2008-r2-report-dataset-call-a-stored-procedure?forum=sqlrep
    What results are you get when executing the stored procedure in SQL Server Management Studio? Is it works well? We should double those stored procedures.
    If there are any misunderstanding, please elaborate the issue for further investigation.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Use 'default' keyword in call string while calling stored proc?

    I am calling following sql server stored procedure from java code using my jdbc driver for sql server: CREATE PROCEDURE test_findTbInfo (
    @paramIn_Str varchar(10),
    @paramOut_Int int OUT,
    @paramIn_Int int = 20
    AS
    begin
    set @paramOut_Int = @paramIn_Int * 100
    end
    If I make a call like this:
    CallableStatement cs = conn.prepareCall(" { call test_findTbInfo(? , , ? ) }");
    cs.setString(1, "test_tab");
    cs.setInt(2, 4);
    cs.execute();
    It works without any error. But this is not a right behavior. !! The second parameter as you see is passed like an optional parameter. But in stored proc it is NOT an optional param and so if the value not passed it should fail...
    Now if I change the code to
    CallableStatement cs = conn.prepareCall(" { call test_findTbInfo(? , default, ? ) }");
    it works correctly. Gives error that "Procedure 'test_findTbInfo' expects parameter '@paramOut_Int', which was not supplied." which is correct.
    So is it a normal practice to use 'default' keyword while calling sql server stored procedures having optional parameters in jdbc ????
    Anyone knows ??? As far as I know "call test_findTbInfo(? , , ? )" works fine except in some cases and also it forces users to put all optional parameters at the end of parameter list in stored proc.
    Please let me know whether I should go with 'default' throuout for sql server stored proc while calling using my jdbc driver.
    Amit

    {?= call <procedure-name>[<arg1>,<arg2>, ...]}The question mark in the above is the result parameter
    that must be registered.
    That is not the same as an OUT argument.Yes that is true. The result value and OUT parameters are different but they both MUST be registered as per jdbc API
    "The type of all OUT parameters must be registered prior to executing the stored procedure; their values are retrieved after execution via the get methods provided here."
    Anyway, my original question still stays as it was. If there are some optional IN parameters in stored procedure
    e.g.
    PROCEDURE test_findTbInfo (
    @paramIn_Int int = 20,
    @paramOut_Int int OUT
    how do you call this?
    CallableStatement cs = conn.prepareCall(" { call test_findTbInfo( , ? ) }");
    cs.registerOutParameter(1, Types.INTEGER);
    cs.execute();
    or
    CallableStatement cs = conn.prepareCall(" { call test_findTbInfo(default, ? ) }");
    Also note that I am intending to use ONLY sql server driver for this.
    The first as well second seem to work. Except that second way is seems reliable. I just wanted a second opinion on that...
    Amit

  • Best place in VOimpl java code to call a stored proc to populate results

    Hello all,
    Using JDev 11g, ADF BC and Trinidad.
    I am building an application that is primarily used for searching large amounts of data. We already have stored procedures on the database that perform the searches and dump the results into a holding table (together with a "search id"). I have easilly built a prototype of this application: my view object is simply "select a, b, c from results where search_id = :bv" - I have a service method in the AM that runs the stored procedure, obtains the search ID, binds it to the :bv in the VO and executes the VO's query - it's all working really nicely. Range paging is effective, the VO itself performs well, and I am able to control how long the stored proc runs via setting a timeout value.
    Now, I'd like to generalize this. My thinking is this:
    1). I'll add a custom property to my VO that is the SQL statement needed to call the stored procedure.
    2). I'll add some bind variables to the VO to represent all the query parameters that can be passed to the stored proc. I'll also use custom properties to indicate these are "fake" bvs, and not in the SQL query itself.
    3). The VO's SQL will remain simply "select a, b, c from results where search_id = :bv"
    4). I will (have already tested) override bindParametersForCollection so that the "fake" bind variables aren't bound into the SQL.
    Now, the question: I want to override some method in the VO's java code to call the stored procedure. The stored proc needs to be called before the actual query for the VO is run, and also before the method getQueryHitCount is called (so that the count is correct). What is the method that would be the "best" place to do this? My current thinking is that I would put the call in an over-ridden executeQueryForCollection call. As far as my analysis has gone, it seems to be always called before getQueryHitCount, but I have no way of knowing if this is completely safe.
    Any thoughts from the BC experts out there?
    Best regards,
    John

    John,
    from your description I understand that you essentially program the VO yourself. So I suggest that you read chapter 35.9 of the 'Fusion Developer’s Guide for Oracle Application Development Framework' (I guess you know where to find it). Since you still call the actual SQL not all of the chapter apply, but you get the idea how it works.
    And yes you analyzed the behavior correct. executeQueryForCollection() is allways called bevore getQueryHitCount().
    Timo

  • Crystal Report using Stored Proc in JSP problem

    Hello,
    I am running a simple report using a stored proc(oracle). It runs fine when I run the report through Crystal. But when I tried running it using JSP it gives me this exception -
    com.crystaldecisions.report.web.viewer.CrystalRepo rtViewer
    Error formatting page : Unexpected Query Engine error
    Can some one pls advise why I am not able to run this report through JSP?
    My other reports with simple sql runs fine in my JSP.
    Here is my stored proc --
    PACKAGE BODY MY_TEST
    AS
    PROCEDURE getrecordset
    p_cursor OUT cursor_type
    IS
    BEGIN
    OPEN p_cursor FOR
    SELECT
    FROM
    DSR_CLASS_SET;
    END;
    END MY_TEST;

    Thanks for your comments.
    If I run the same query, report runs fine. So I guess it should also able to run this stored proc.
    Here is the detailed error ---
    Category:     com.crystaldecisions.reports.reportengineinterface
    Message:          failed to process getPage request
    Location:     
    Thrown:
    com.crystaldecisions.reports.reportengineinterface.EngineException: Error formatting page : Unexpected Query Engine error
         at com.crystaldecisions.reports.reportengineinterface.Engine.getPage(Unknown Source)
         at com.crystaldecisions.reports.reportengineinterface.JPEReportSource.getPage(Unknown Source)
         at com.crystaldecisions.report.web.viewer.ReportAgent.a(Unknown Source)
         at com.crystaldecisions.report.web.viewer.CrystalReportViewer.goto(Unknown Source)
         at com.crystaldecisions.report.web.ServerControl.a(Unknown Source)
         at com.crystaldecisions.report.web.ServerControl.processHttpRequest(Unknown Source)
         at jsp_servlet._crystal.__test._jspService(__test.java:225)
         at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:402)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:446)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6350)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3635)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    Caused by: com.crystaldecisions.reports.formatter.formatter.c: Unexpected Query Engine error
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.bf.<init>(Unknown Source)
         at com.crystaldecisions.reports.formatter.formatter.objectformatter.bf.a(Unknown Source)
         at com.crystaldecisions.reports.formatter.formatter.d.j.<init>(Unknown Source)
         at com.crystaldecisions.reports.formatter.formatter.d.j.if(Unknown Source)
         ... 19 more
    Caused by: com.crystaldecisions.reports.dataengine.k: Unexpected Query Engine error
         at com.crystaldecisions.reports.dataengine.ap.case(Unknown Source)
         at com.crystaldecisions.reports.dataengine.ap.jO(Unknown Source)
         at com.crystaldecisions.reports.dataengine.ap.aC(Unknown Source)
         at com.crystaldecisions.reports.dataengine.ap.aD(Unknown Source)
         at com.crystaldecisions.reports.dataengine.ap.case(Unknown Source)
         at com.crystaldecisions.reports.dataengine.au.a(Unknown Source)
         at com.crystaldecisions.reports.dataengine.a0.a(Unknown Source)
         at com.crystaldecisions.reports.dataengine.a0.aa(Unknown Source)
         at com.crystaldecisions.reports.dataengine.a0.<init>(Unknown Source)
         at com.crystaldecisions.reports.dataengine.a0.<init>(Unknown Source)
         at com.crystaldecisions.reports.dataengine.a0.a(Unknown Source)
         ... 23 more
    Caused by: com.crystaldecisions.reports.reportdefinition.datainterface.d: Unexpected Query Engine error
         at com.crystaldecisions.reports.reportdefinition.datainterface.b.a(Unknown Source)
         ... 34 more
    Caused by: com.crystaldecisions.reports.queryengine.al: Unexpected Query Engine error
         at com.crystaldecisions.reports.queryengine.driver.l.if(Unknown Source)
         at com.crystaldecisions.reports.queryengine.ao.dZ(Unknown Source)
         at com.crystaldecisions.reports.queryengine.ao.f(Unknown Source)
         at com.crystaldecisions.reports.queryengine.ao.dK(Unknown Source)
         at com.crystaldecisions.reports.queryengine.b0.dB(Unknown Source)
         at com.crystaldecisions.reports.queryengine.bz.a6(Unknown Source)
         ... 35 more
    Any guess why I get this?

  • Using an existing connection in a Java Stored Proc

    Hi,
    I have to invoke a Java stored procedure from a PL/SQL stored proc. In the Java stored proc I open a database connection & execute some SQLs. To do this can I use the same connection that is used to invoke the PL/SQL stored proc. In other words can we use the existing PL/SQL connection within a Java stored proc that is being called by the former PL/SQL instead of creating a new connection?
    Thanks in advance.
    Sunitha

    Ok I understood how to get the default connection from http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.htm#05_01
    Connection conn = DriverManager.getConnection("jdbc:default:connection");However, I find that the Java stored proc is running slower in Oracle VM than invoking it from a command line Java program using thick driver from a remote machine.
    Thanks anyway.
    Sunitha.

  • Can we run a stored proc script from Unix console?

    Hello all:
    One of my colleagues insists that she used to run a stored proc file, say, abc.proc from a Unix console, with some command. I suspect the "command" is actually a script that invokes sqlplus commands. I never knew a stored proc script can be ran by any built-in Unix command, other than that in sql*plus console.
    Anyone can prove me wrong?
    Thanks,
    Johnny

    Hi Johnny,
    Unix shell doesn't have any means of compiling and/or executing PL/SQL code. You need a client (a driver) to make database calls, like sqlplus. So I think your assumption is correct.
    Best regards,
    Nikolay

  • ** How to use TO_DATE function in Stored Proc. for JDBC in ABAP-XSL mapping

    Hi friends,
    I use ABAP-XSL mapping to insert records in Oracle table. My Sender is File and receiver is JDBC. We use Oracle 10g database. All fields in table are VARCHAR2 except one field; this is having type 'DATE'.
    I use Stored procedure to update the records in table. I have converted my string into date using the Oracle TO_DATE function. But, when I use this format, it throws an error in the Receiver CC. (But, the message is processed successfully in SXMB_MONI).
    The input format I formed like below:
    <X_EMP_START_DT hasQuot="No" isInput="1" type="DATE">
    Value in Payload is like below.
    <X_EMP_START_DT hasQuot="No" isInput="1" type="DATE">TO_DATE('18-11-1991','DD-MM-YYYY')</X_EMP_START_DT>
    Error in CC comes as below:
    Error processing request in sax parser: Error when executing statement for table/stored proc. 'SP_EMP_DETAILS' (structure 'STATEMENT'): java.lang.NumberFormatException: For input string: "TO_DATE('18"
    Friends, I have tried, but unable to find the correct solution to insert.
    Kindly help me to solve this issue.
    Kind Regards,
    Jegathees P.
    (But, the same is working fine if we use direct method in ABAP-XSL ie. not thru Stored Procedure)

    Hi Sinha,
    Thanks for your reply.
    I used the syntax
    <xsl:call-template name="date:format-date">
       <xsl:with-param name="date-time" select="string" />
       <xsl:with-param name="pattern" select="string" />
    </xsl:call-template>
    in my Abap XSL.  But, its not working correctly. The problem is 'href' function to import "date.xsl" in my XSLT is not able to do that. The system throws an error. Moreover, it is not able to write the command 'extension-element-prefixes' in my <xsl:stylesheet namespace>
    May be I am not able to understand how to use this.
    Anyway, I solved this problem by handling date conversion inside Oracle Stored Procedure. Now, its working fine.
    Thank you.

  • Error creating Crystal Report using Stored Proc Universe

    Hi,
    I have created a stored procedure Universe, using the new feature available in XI R3.
    This connects to an Oracle database, executing a PL/SQL procedure returning ref cursor.
    I have created a WebI report using this Universe, which works fine and functions as expected.
    So there are no problems with either my Oracle stored proc or the Universe.
    However, I would like to create a Crystal report (2008) using the same Universe.
    I can create the report ok - using the SP Universe.
    When I attempt to refresh the data I get an error:
    Failed to retrieve data from the database.
    Details: ORA-06550: line 1, column 7:
    PLS-00103: Encountered the symbol "." when expecting one of the following:
    begin case declare etc etc
    .................................My Procedure ...................
    CREATE OR REPLACE PROCEDURE BIADM.Bo_Test_Report_R
    (Deposit_Cursor IN OUT SYS_REFCURSOR)
    IS
    BEGIN
    OPEN Deposit_Cursor FOR
    SELECT DISTINCT foracid "A/C"
    , acct_name "A/C Name", acct_opn_date "OP/Date", schm_code "SchmCode"
    FROM gam@finrpt
    WHERE acct_cls_flg ='N'
    AND foracid ='2252020145001';
    --AND cust_id ='CB2020145'
    END Bo_Test_Report_R;
    Please Give me solution as early as possible.
    Masud Iqubal

    Moved to Universe Design forum.

  • Unable to pass the values to stored proc using presentation variable in OBI

    Hi All,
    Need your help regarding in resolving an issue in OBIEE 10.1.3.4.1
    There is an OBIEE requirement whereby two prompts need to be defined.
    1.     Textbox prompt
    2.     Drop-down prompt
    The dropdown values should be populated using textbox prompt. So, we have used presentation variable in textbox prompt and passing the same to select query of drop-down.
    Until this step, the report works just fine.
    Now, the value in both textbox and drop-down needs to be passed to stored proc.
    While trying to pass the values by using the presentation variable, the following error comes-up saying
    Session variable has no value definition.
    Note:Although the corresponding session variable has been set to default value,still the error appears.
    Please advise.
    Regards,
    Prasad

    "Session variable has no value definition" I'm assuming typo error and it should be presentation variable.
    Set default value for presentation variable that may work

  • Using Statement rather than CallableStatement for stored proc execution

    Cleary, if you need to extract output parameters from a stored procedure, then you must use a CallableStatement to execute it. However, if your stored procedure just returns a basic ResultSet, or performs a database update, is there any penalty to using a regular Statement to execute the stored procedure?
    For example -
    String sql = "exec testprocedure 'param1' 'param2'";
    Statement stmt = conn.createStatement();
    ResultSet rs = stmt.executeQuery( sql );
    vs.
    CallableStatement cs = conn.prepareCall( "{call testprocedure(?,?)}" );
    cs.setString( 1, "param1" );
    cs.setString( 2, "param2" );
    ResultSet rs = cs.executeQuery();
    Any thoughts?

    Any thoughts?You would have to look at the actual driver code for a sure answer.
    But for any real database (which a stored proc suggests) I doubt there would be any difference at all. It would resolve to the same call.

  • Different ways to return results using a stored proc to calling application

    Hi, Can someone please suggest me different ways of returning results( set of rows and columns) from a stored procedure to calling application.
    Currently I am using sys_refcursor to return results to front end. Stored proc is executed fast, but cursor access and retrieval of results has some overhead.
    So can you suggest the ways which will be faster than this approach.
    Thanks.

    Currently the procedure executes quickly but the results from the ref cursor are returned slowly, this is because the query is slow, for whatever reason.
    Collecting in all the rows in the stored procedure first before returning them will
    a) Make the stored procedure slower taking the same amount of time to execute as current query takes to complete.
    b) Use more memory.
    c) Put more stress on the network as all rows will be transferred at once instead of using the arraysize/fetchsize to to fetch the rows in smaller packets.

  • BPEL process to Insert XML into DB using pl/sql stored proc

    Hi,
    We have created a BPEL process in which we are taking input request and store it into Oracle Database using PL/SQL proc.
    We have been unsuccessful in doing so because the data stored in table has root element missing.
    Has any body done this (insert xml into DB using pl/sql stored proc) successfully ?
    We can so this successfully if we do not use stored procedure and store data directly in table.
    Regards

    I have done this, stored it as a CLOB.
    Also I received the payload as an opaque schema, so I had to convert the message from binary into string.
    This way the root element doesn't get removed.
    cheers
    James

Maybe you are looking for

  • Product allocation is not working after setting all required config!

    Hello SD gurus,  Would you please help me to resolve this issue? I followed and configured all the required steps for product allocation  in ECC 6.0 Version still  the product allocation is not working as expected. Here are the steps performed 1. Cre

  • Write è to file

    Hello, I'm trying to write country specific characters such as è to a file, but it doesn't seem to work. I am using FileWriter.write(String), but the written character is è. This happens with other characters as well. I tried to manually write è to

  • Passing accumulation data from dll

    Hi Sir/Madam, I have tried to search the NI forum, but could not find something that can solve my queries. I have to interface a sensors that provide with a dll. There's no problem with interfacing most of the function, but only this particular one(s

  • Screen ratio on nano?

    Is the screen on the nano 4x3 or 5x5? I have cropped a few photos and I get thin black lines top and bottom on those pics cropped without a ratio such as 4x3?

  • Instant Client Installation help

    Hello I'm relatively beginner. I'm having a win2k machine which i want to setup as a client to oracle 9i server which i'm able to telnet and work. What should i do??. I have downloaded (instant client basic + odbc) and set the path...install from the