Stored proc as cron job

I have a stored procedure that does updates. Is is possible to call this procedure at a specific time everyday like cron jobs are done? If so how can we set this up.
Thanks
srividya

Yes, use Oracle's internal job scheduler.
look into the dbms_job package.

Similar Messages

  • Error while Compiling Stored proc

    I am having problem while compiling stored proc.It gives the following error
    "Error while trying to retrieve text for error - ORA-03113"
    I have my SQL file in which i am adding the input parameters (aroung 100 parameters). Till 53 parameters i added it created the procedure now after that i am adding the parameteres one by one but its giving the same error.
    null

    Hi Minish,
    Whatever you wrote in crontab is fine. But we can call a stored procedure from Shell Script provide the shell script must have a sql file which contain the procedure to be excuted.
    Follow the things...
    Assume that,
    1. you have file called load.sql
    it contains...
    load_data;
    2. your shell script must have this code
    . /home/nimish/.profile
    sqlplus scott/tiger@orcl_bk load.sql
    *** make sure that sql file should have executable permissions
    Good Luck
    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Nimish Buch:
    I want to run a stored procedure as an end of day process. I wrote a small unix shell script to run the procedure from a sql session, similar to following.
    . /home/nimish/.profile
    sqlplus scott/tiger@orcl_bk < execute load_data;
    If I run this script manually, it runs fine. I get the following errors when I attempt to run it as a cron job.
    Message file sp1.msb not found
    I have checked sp1us.msb does exist in ORACLE_HOME/sqlplus/mesg directory. I even tried giving it's path in PATH variable.
    Any help with this will be appreciated.
    Thanks a lot.
    Nimish<HR></BLOCKQUOTE>
    null

  • Stored Procs problems

    Hi EveryBody,
    I might sound silly with my problems but please reply me with best possible solutions.
    Let me clear the scenario first
    I am having Oracle 8.1.7.2 on sunsparc solaris machines as production system and oracle 8.1.7.5 on intel server with windows as testing machine.
    I have written some stored procs that get executed very finely on my testing machine but they take ten times more time on my production server even after we bring down the application and only database is kept up.
    We looked up for few things here and there and these are our findings
    1) A lot number of sessions are created with the user(that is having all tables we are firing our procs upon) . I want to know can a stored proc also create different sessions (bcoz 1 stored proc is callling two or more procs)
    2)There are a few cron jobs executing that are used for analyze of the tables that we fire our procs upon. Could this also hamper performance of stored procs.
    3) In the v$session_longops we found that there are few Table Scan and Index Scan processes that were showing time remaining of more than 20 hrs. the sid for these longops did not belong to usernames with which any app. or any user logs into oracle.
    4) One of my procs does not responds for a no. of hrs but as soon as we kill the session using (alter system kill session) it starts populating the table and generating results. And the session gets marked for killed but never gets killed.
    Please help me for these issues

    hi kamal
    data volume on both servers is same as first i took backup of production server by exporting it to dmp and then imported it to test server.
    the scripts of procs are same for both infact scripts were first developed on test server and after testing there only we put those scripts in production
    i dont have any idea about tkproof (completely new term for me or if u r using it as an abbreviation)
    moreover the tables have been analyaed on both servers.

  • 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;

  • Business Objects XI R2 - Oracle Stored Proc - Deski report failing

    Business Objects XI R2
    Hi All,
    I have a stored proc created in Oracle 10 - see bottom for code
    I run a deski report on iit - using it as a datasource. This works fine in Desktop Intelligence until I schedule the report from infoview - then I get the following error...
    "Object failed to run due to an error while processing on the Job Server"
    My other deski reports based on Universes are ok.
    create or replace procedure test_PROC1
    (Test_Rpt_Cur OUT SYS_REFCURSOR)
    is
    begin
    open Test_Rpt_Cur FOR
    SELECT ID, FIRSTNAME, LASTNAME
    FROM test_table;
    end test_proc1;

    Hi,
    Cause of this issue :
    Once the Job Server recieves the scheduled job and spawns a new child process, the child process is unable to complete the job. The child process constantly is waiting to load the job. Looking further into the log and specifically the startup script, the -port option was incorrectly used (-restart-port) and didn't allow the child process to bind to the correct port using the correct DNS name. 
    In Order to resolve this issue follow the steps given below..
    1.Open CCM
    2. Stop Server
    3. Right Click Server and go to Properties
    4. insert -port option in to command line, example below
    ex. "
    win2k3\C$\ProgramFiles\Business Objects\BusinessObjects Enterprise 11.5\win32_x86\JobServerFullClient.exe" -service -name win2k3.Desktop_IntelligenceJobServer  -ns win2k3 -objectType CrystalEnterprise.FullClient -lib pp_procFC  -jsTypeDescription "Desktop Intelligence Job Server" -maxDesktops 0 -restart -port win2k3.it.bo.example
    5. Save setting and restart server.
    Hope it helps.
    Regards,
    Sandeep Singh

  • Oracle Data Pump (expdp) credentials via cron job

    I have Oracle 10.2 on Linux Red Hat Server. In additions to performing appropriate backups of my database I also have a cron job I use to performa full logical export using expdp every night to export user objects in the event that a singleobjects needs recovered. This is an extra safeguard for object recovery.
    Currently I do my export (expdp) via a cron job run as the oracle software owner as a db user with db credentials specified. I would however like to change this script to essentially run as sys by doing something like "expdp / as sysdba... " However it appears doing so actually requires the password to be supplied and to run expdp as "expdp sys/password as sysdba".
    does anyone have experience performng an expdp as sys without specifying the password... essentially being able to do "/ as sysdba"?
    Hope that makes sense.
    Thanks for any suggestions.

    I appreciate all comments. At the expense of being long winded I did not get into all the details. But to be more clear I want to say
    1. I am using a parfile as to hide the password from the ps command.
    2. I also understand that doing it as sysdba is not recommended but i thought if I did so I could eliminate need for storing clear text password.
    3. This system is on a seperate "air-gapped" (a.k.a "sneaker-net") from the outside world and is a better protected than if sitting somewhere near the internet.
    4. Historically we have not been permitted to use OP$ accounts. This may be a legacy issue,and will (re-)investigate this as an option.
    5. Just to be clear, I really do not want to do a full export as sysdba. In fact currently I am doing it as a user with EXP_FULL_DATABASE role. However, that requires password to be stored in file (parfile). The file has it in clear text which is still not optimal because System Admins could gain access to this password (Yes I know system admins could do larger damage, but we still need to protect the passwords).
    I am going to look at calling the API directly, and OP$ if needed.
    Thanks for the suggestions.

  • If statement in stored proc

    hi
    i have stored proc like this
    ALTER PROCEDURE [dbo].[p_member]
    @MemberID INT = NULL,
    @ID INT = NULL,
    @Type varchar(20) = NULL
    AS
    IF NOT EXISTS (SELECT Memberid FROM Member mcd  JOIN Pro p WITH(NOLOCK)
                   on mcd.ProgramID = p.ProgramID WHERE ((mcd.MemberID = @MemberID) OR (mcd.ID = @ID and p.CD = @Type)))
    BEGIN
               select 'CAN''T BE FOUND'
    END
    i am not sure what i am doing in if statement, its not working.my logic should be like 
    check if atleast on or the other is available ..ie memberid or id+type, if nto i need to print  message.
    thanks

    What do you get for the following:
    DECLARE @MemberID INT = 444,
    @ID INT = NULL,
    @Type varchar(20) = NULL;
    IF NOT EXISTS (SELECT Memberid FROM Member mcd JOIN Pro p WITH(NOLOCK)
    on mcd.ProgramID = p.ProgramID WHERE ((mcd.MemberID = @MemberID) OR (mcd.ID = @ID and p.CD = @Type)))
    BEGIN
    select 'CAN''T BE FOUND'
    END
    ELSE SELECT 'FOUND'
    Kalman Toth Database & OLAP Architect
    Free T-SQL Scripts
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • ** 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.

  • Replacing null values in optional prompts and passing to stored proc

    Hi,
    I want to create a stored procedure with OPTIONAL prompts. When user does not pass a value for that parameter, I want to set the value for that parameter by selecting from a column in table then I WANT to use that paramvalue in sql within cursor of stored proc. How do I do that?
    In short, I want to do the following Here is the psuedocode:
    Create or replace procedure test (param IN varchar2 DEFAULT NULL)
    As
    var_param varchar(20);
    select param into var_param from dual;
    If param is null then select custid from table1 else var_param
    OPen ref_cursor for
    Select xyz from table2
    where fyy = var_para
    Can someone let me know the syntax on how to do this in stored proc?
    Regards,
    hena
    Edited by: 904385 on Dec 25, 2011 7:04 AM

    Hi,
    Merry Christmas, and welcome to the forum!
    Here's one way to do what you requested:
    CREATE OR REPLACE PROCEDURE     test
    (    param     IN     VARCHAR2     DEFAULT     NULL
    AS
        ref_cursor     SYS_REFCURSOR;
        var_param     VARCHAR2 (20)     := param;
    BEGIN
        IF  var_param  IS NULL
        THEN
         SELECT     custid
         INTO     var_param
         FROM     table1
    --     WHERE     ...     -- Unless table1 has only 1 row
        END IF;
        OPEN  ref_cursor
        FOR   SELECT  xyz
           FROM       table2
           WHERE       fyy     = var_param;
    END     test;Whatever you're trying to do, this is probably niot the simplest or most efficient way to do it.

  • Cron job not running - script uses rsync, ssh (with id_rsa)

    Does anyone know how to get cron to run a rsync/ssh script which uses id_rsa for passwordless logins?
    I have a backup script I have slaved for months over that works wonderfully when running it from the command line.
    It uses rsync and connects with SSH (passwordless using ssh keys). I have setup id_rsa and id_rsa.pub for passwordless logins (this is my user account, and connects using root@ to the server)
    As stated all works find when run from the command line. But when I setup a cron job to run this file (exact same line I run from the command line) it does not execute. Actually, it does run, as I have an email notifiction which sends to me. It is just the rsync/ssh part that does not run.
    I have spent days and days trying to figure it out. No error messages occur, nothing.  Took me a while to find out cron is emailing the user account on Lion the messages (not to a proper email address).
    The error shows a permission denied, which I believe to be the cron user cannot use the id_rsa/ssh connection.
    Cron is running the script as my user, the same I use on the command line. I even tried copying the id_rsa to the root user .ssh folder in case cron is running as root but that does not work either.
    So does anyone know how to get cron to run this rsync/ssh script which used id_rsa for passwordless logins?
    Thanks a lot

    YES! Got it working, finally!
    So the issue is indeed cron/launchd not being able to access the ssh-agent which holds the key.
    So this is the solution...
    Download keychain for Mac:
    http://www.funtoo.org/wiki/Keychain
    Then once its installed and configured, the script to run needs this added to the top:
    eval `keychain --noask --eval id_rsa` || exit 1
    Note I am using id_rsa whereas keychains instructions refer to id_dsa so I just changed it and it works OK.
    When the script runs the first time it asks for the key password. Then it works from then on.
    What I do not know yet is will I need to re-enter the password when I logoff/logon again. That will cause an issue as I auto restart the Mac every day which means if I am off for a few days backup will stop (can you see the madness in this issue!).

  • How to generate a report in pdf from a stored proc

    Hi, i need guidance on how to generate a report in pdf from an oracle stored proc.
    The environment is oracle 10gas + 10gdb.
    On a specific event, a PL/SQL stored procedure is called to do some processing and at the end of the processing to generate report which has to be sent to the printer (and optionally previewed by the user).
    Can anyone assist me with this?

    Hi ,
    One 'simple' way is by using the DBMS_SCHEDULER db package and the procedure CREATE_JOB(....) using as job_type the value 'EXECUTABLE'...
    Read for further info in 'PL/SQL Packages and Types Reference'.
    If you have access to OEM ... you can configure this there using wizard.....
    Other way is to use the External Procedure call capabiblity of Oracle DB Server...:
    http://www.oracle.com/pls/db102/ranked?word=external+procedure+call&remark=federated_search
    My greetings,
    Sim

  • 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?

  • 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.

  • Stored Proc and dates

    Hi All,
    Fairly new at this, and a little confused with dates and date formats.
    I run the following:
    alter session set nls_date_format = 'dd/mm/yyyy'
    If I select sysdate from dual:
    02/11/2008 --> so this is correct.
    Now what I can't figure out is why I get different results if I use an sql statement VS a stored proc.
    If I run this sql update statement:
    UPDATE MAPPER.CONV_CNSTNTS
    SET CN_VALUE = TO_DATE('12/05/2007','MM/DD/YYYY')
    WHERE CN_TYPE = 'CONV'
    AND CN_REFRNCE = 'CONVDATE';
    When I select this data it shows: 12/05/2007
    This works perfect.
    Now if I take the exact same statement and put it in a stored proc i get a different result:
    create or replace procedure proc_test_date as
    begin
    UPDATE MAPPER.CONV_CNSTNTS
    SET CN_VALUE = TO_DATE('12/05/2007','MM/DD/YYYY')
    WHERE CN_TYPE = 'CONV'
    AND CN_REFRNCE = 'CONVDATE';
    COMMIT;
    end;
    When I select this data it shows: 05-DEC-07
    Why is there a difference here? Is there a difference in the NLS settings that are used when you run an sql statement vs a stored proc?
    Thanks for your help in advance.

    Thank you for the quick response.
    Glad I am on the right track ... NLS settings are painful :)
    So I ran: alter session set nls_date_format = 'Month DD, YYYY';
    Ran my proc and then the select.
    Still the date shows up as: 05-DEC-07
    I looked at the nls_parameters
    select * from v$nls_parameters
    NLS_CALENDAR     GREGORIAN
    NLS_DATE_FORMAT     Month DD, YYYY
    NLS_DATE_LANGUAGE ENGLISH
    I am using Oracle SQL Developer. I made sure these were set as well:
    Tool >> Preferences >> Database >> NLS Parameters
    Date Format --> MM/DD/YYYY
    Seems that I am missing something ...

  • Session id and Stored Proc

    How to store session id in a variable and use that in a stored proc as input param.
    I have a Stored proc in oracle which uses one input param, i want to pass session id to this proc..
    I have created a procedure from odi, and called SP from it..placed this ODI proc in a package...bt dnt knw how to pass session id as input param..

    Hi Andy,
    You can create a varaible using substitution API for this,
    select <%=odiRef.getSession("SESS_NO")%> from dual
    And in the successive call SP pass the variable like #VAR_NAME
    Thanks,
    G

Maybe you are looking for

  • Deleting an object in the background

    Looking on the internet it seems I should use a tool called content aware to remove this object; however, I am unable to find that tool in Photoshop Elements 10. How do I remove an object from a picture in this program?

  • Everything Disappeared in Passbook

    I have used the Passbook app on my iPhone 5c and a previous iPhone without issue since iOS 6 rolled out. Today, however, I was talking to my daughter about some MLB tickets that I had purchased and when I opened Passbook to check the dates, I found t

  • How to delete background ?

    I would like to use just the part saying "top reasons you're not making gains" when i save the file as PNG to use in another appliation, the whole picture shows us with no background as part of it how can i remove it alltogether? [img]http://i.imgur.

  • Does Western Digital make quality internal hard drives?

    I'm looking to buy a larger hard drive for my MacBook (1.83GHz). This Western Digital drive popped out to me for its price: http://www.newegg.com/Product/Product.aspx?Item=N82E16822136071 How do Western Digital hard drives compare in quality to Seaga

  • About Third Party Sale

    Dear Gurus, Kindly help me with configure the below process. Unlike a third pary item ,which is delivered to the customer directly by the vendor, I want to add a material in the sales order which is procured and placed in stock, schedule lines allowe