DBMS_SCHEDULER.create_job parameter for repeat_interval

how to specify the DBMS_SCHEDULER.create_job repeat_interval parameter for 15 mintues?

You probably want an interval like this:
FREQ=MONTHLY;BYMONTHDAY=2;BYHOUR=20;BYMINUTE=0;BYSECOND=0;You can use the DBMS_SCHEDULER.EVALUATE_CALENDAR_STRING function to test it, like so:
SQL > DECLARE
  2  start_date        TIMESTAMP;
  3  return_date_after TIMESTAMP;
  4  next_run_date     TIMESTAMP;
  5  BEGIN
  6  start_date :=
  7    to_timestamp_tz('01-JAN-2003 10:00:00','DD-MON-YYYY HH24:MI:SS');
  8  return_date_after := start_date;
  9  FOR i IN 1..5 LOOP
10    DBMS_SCHEDULER.EVALUATE_CALENDAR_STRING(
11      'FREQ=MONTHLY;BYMONTHDAY=2;BYHOUR=20;BYMINUTE=0;BYSECOND=0;',
12      start_date, return_date_after, next_run_date);
13  DBMS_OUTPUT.PUT_LINE('next_run_date: ' || next_run_date);
14  return_date_after := next_run_date;
15  END LOOP;
16  END;
17  /
next_run_date: 01/02/2003 08:00:00.000000 PM
next_run_date: 02/02/2003 08:00:00.000000 PM
next_run_date: 03/02/2003 08:00:00.000000 PM
next_run_date: 04/02/2003 08:00:00.000000 PM
next_run_date: 05/02/2003 08:00:00.000000 PM

Similar Messages

  • Maximum size of dbms_scheduler.create_job job_action parameter

    i'm running into a problem with the size limit for the dbms_job.submit what parameter... time to move to the dbms_scheduler.create_job package?
    can anyone tell me what the maximum size is for the dbms_scheduler.create_job job_action parameter?
    appreciate any information that can be provided.

    Herald ten Dam wrote:
    But how doy come in trouble with this length, normally a call to a procedure (in a package) and do there the job. Don't program the whole pl/sql (C/Java) in the call. With dbms_scheduler you can make also dependencies between jobs, so it is possible to split the functionality.Yes, I completely agree. The only times that I've put PL/SQL anonymous blocks in scheduler actions is when I want to guarantee the fewest dependencies for jobs (or chain steps) that are really critical, such as when you want to send an email or other notification that a failure has occurred. Otherwise I'd just call a procedure.

  • DBMS_SCHEDULER.CREATE_JOB

    Hi,
    I am running following script in my DB
    SET SERVEROUTPUT ON SIZE 100000
    Declare
    v_count number ;
    BEGIN
    select count(*) into v_count from USER_scheduler_jobs where job_name = 'DELETE_RECORDS_IA';
    if v_count > 0 then
    dbms_output.put_line ('Job DELETE_RECORDS_IA Exists.. ');
    DBMS_SCHEDULER.DROP_JOB (
    job_name => 'DELETE_RECORDS_IA'
    ,force => TRUE
    end if;
    DBMS_SCHEDULER.CREATE_JOB (
    job_name => 'DELETE_RECORDS_IA'
    ,job_type => 'PLSQL_BLOCK'
    ,job_action => 'delete from emp2'
    ,repeat_interval => 'FREQ=HOURLY;INTERVAL=1'
    ,enabled => TRUE
    it is running without error but after 16 hour when i check there is no difference in emp2 table . and when i checked from USER_scheduler_jobs table it is giving 16 time faliure of the JOB. Please suggest me how can i know why my job is failing.

    I have read that document but not find the syntax for the little small action like this
    You sure about that? I can see the answer to your very question right there in the create_job syntax where it describes all of the valid values for job_action depending on job_type.
    And another thing - when you read the manual and get it working, you might want to think about explicitly commiting.

  • How to use dbms_Scheduler.Create_Job from within stored procedure?

    Hello,
    using 10g (10.1.0.2.0) on Windows 2000 I had problems to create scheduler jobs from within a stored procedure (see example below). What easily succeeds using anonymous blocks failed when calling from a stored procedure, due to ORA-27486. Only when I compile the procedure with invoker's rights the call to dbms_Job.Create_Job is successfull!? From my knowledge there is no difference between invoker's and definer's rights, if I compile and call with the same user, is there?
    Does anyone know the reason for this behaviour or is it simply a bug?
    Have a nice day.
    Björn Hachmann
    Hamburg / Germany
    -- Example start.
    create table t
    a number(1),
    b date default sysdate
    create or replace procedure sched1
    is
    begin
    dbms_scheduler.create_job(
    job_name => 'TEST_JOB1',
    job_type => 'PLSQL_BLOCK',
    job_action => 'BEGIN insert into t values (1); END;',
    repeat_interval => 'freq=secondly',
    enabled => TRUE
    commit;
    end;
    create or replace procedure sched2
    authid current_user
    is
    begin
    dbms_scheduler.create_job(
    job_name => 'TEST_JOB2',
    job_type => 'PLSQL_BLOCK',
    job_action => 'BEGIN insert into t values (2); END;',
    repeat_interval => 'freq=secondly',
    enabled => TRUE
    commit;
    end;
    exec sched1; -- This call fails with ORA-27486.
    exec sched2; -- This call succeeds!
    /* Cleanup.
    exec dbms_scheduler.drop_job('TEST_JOB1', true);
    exec dbms_scheduler.drop_job('TEST_JOB2', true);
    drop table t;
    */

    Your example code ran without problems for me on 10.1.0.3.0 so it probably is a bug.

  • Job scheduling using dbms_scheduler.create_job

    hi all experts,
    i am really grateful to you for your responses, now have a look at this, i have created a job with "dbms_scheduler.create_job" and blow is the output from view "dba_schduler_jobs" why it is showing run_count to '0'...i have gone through all provided links like:
    Answers to "Why are my jobs not running?"
    and applied and checked all parameters, i am using oracle 10.2.0.1.0 on windows server 2003 32-bit
    SQL> BEGIN
         DBMS_SCHEDULER.CREATE_JOB (
             job_name => 'clouser'
            ,job_type => 'PLSQL_BLOCK'
         ,job_action => 'begin package.procedure("po_closure"); end;'
         ,start_date => to_date('17-04-2009 22:00:00', 'dd-mm-yyyy hh24:mi:ss')
         ,repeat_interval => 'FREQ=DAILY;byminute=10'
         ,enabled => TRUE
         ,comments => 'op closure everyday at 11PM'
    END;
    PL/SQL procedure successfully completed.
    SQL> select owner,job_name name,run_count run,start_date
      2  from dba_scheduler_jobs
      3  where owner='FINANCEDEV';
    OWNER                          NAME                                  RUN
    START_DATE
    FINANCEDEV                     CLOUSER                                 0
    17-APR-09 02.45.10.000000 PM +05:30
    FINANCEDEV                     CLOUSER_MAIN                            0
    18-APR-09 10.25.00.000000 AM +05:30
    FINANCEDEV                     CLOUSER_MAIN1                           0
    18-APR-09 10.45.00.000000 AM +05:30
    OWNER                          NAME                                  RUN
    START_DATE
    FINANCEDEV                     CLOUSER_MAIN4                           0
    18-APR-09 10.45.00.000000 AM +05:30
    FINANCEDEV                     CLOUSER_MAIN5                           0
    18-APR-09 10.43.00.000000 AM +05:30the time i scheduled has already passed, and i am checking it again and again, but no luck,can you please explain why is it so??
    thanks in advance
    thanks and regards
    VD
    Edited by: vikrant dixit on Apr 17, 2009 10:33 PM

    Hello,
    I should have asked only for next_run_date and state and failure_count. Do you see any value for failure_count column. Seems you have a failure in running of this job and whereever are you , what's the time?
    You can also run this job manually using and see if run_count goes up or failure and it schedules the job for tommorrow as well.
    exec DBMS_SCHEDULER.RUN_JOB('CLOUSER',TRUE);Based on your information, your next_run_date should be set to 19 APr @ 12:10 AM.
    Here is example based on your information
    BEGIN
       sys.DBMS_SCHEDULER.create_job (
          job_name          => '"SCHEMA_NAME"."CLOUSER"',
          job_type          => 'PLSQL_BLOCK',
          job_action        => 'DECLARE
    begin
      po_closure varchar2(..) := ''some_value'';
      schema_name.package_name.procedure(po_closure);
    commit;
    end;
          repeat_interval   => 'FREQ=DAILY;BYMINUTE=10;BYSECOND=0',
          start_date        => SYSTIMESTAMP AT TIME ZONE 'US/Eastern',
          job_class         => 'DEFAULT_JOB_CLASS',
          auto_drop         => FALSE,
          enabled           => TRUE
       sys.DBMS_SCHEDULER.set_attribute (name        => '"SCHEMA_NAME"."CLOUSER"',
                                         attribute   => 'restartable',
                                         VALUE       => TRUE);
       sys.DBMS_SCHEDULER.enable ('"SCHEMA_NAME"."CLOUSER"');
    END;Regards

  • Problem with Dbms_Scheduler.Create_Job

    Hi,
    Below is my package, where in I am calling scheduler to run a job for the procedure written.
    My Main Procedure: requests_delete_proc, deletes the requests which are more than 2 year old then sysdate.
    I want to run a job monthly once for this procedure which is written under "delete_job".
    This seems to be not working. I am not able to delete the records .
    Can anyone suggest me as what is the problem pls?
    CREATE OR REPLACE
    PACKAGE BODY DELETE_REQUEST_PKG
    AS
    PROCEDURE requests_delete_proc
    AS
    request_count NUMBER;
    nodatafound EXCEPTION;
    BEGIN
    SELECT
    COUNT(request_id)
    INTO
    request_count
    FROM
    max_request_dtls
    WHERE
    requested_date < sysdate - (2*365);
    IF request_count <> 0 THEN
    DELETE
    FROM
    max_req_history_dtls
    WHERE
    request_id IN
    SELECT
    request_id
    FROM
    max_request_dtls
    WHERE
    requested_date < sysdate -(2 *365)
    DELETE
    FROM
    max_request_dtls
    WHERE
    requested_date < sysdate -(2 * 365);
    dbms_output.put_line('requests deleted');
    COMMIT;
    ELSE
    raise nodatafound;
    END IF;
    EXCEPTION
    WHEN nodatafound THEN
    dbms_output.put_line('no records found for mentioned requested date');
    END requests_delete_proc;
    PROCEDURE delete_job
    AS
    BEGIN
    DBMS_SCHEDULER.create_job (
    job_name => 'request_Delete_job',
    job_type => 'STORED_PROCEDURE',
    job_action => 'Requests_Delete_Proc',
    start_date => SYSTIMESTAMP,
    repeat_interval => 'freq=MINUTELY',
    end_date => NULL,
    enabled => TRUE,
    comments => 'Job defined entirely by the CREATE JOB procedure.');
    END delete_job;
    END DELETE_REQUEST_PKG;

    Most probably your delete statement is faulty, otherwise it should work.
    SQL>  CREATE TABLE emp_test_job AS SELECT * FROM emp;
    Table created.
    SQL> SELECT COUNT(*) FROM emp_test_job;
      COUNT(*)
            14
    SQL> CREATE OR REPLACE PACKAGE DELETE_REQUEST_PKG AS
      2   PROCEDURE requests_delete_proc;
      3   PROCEDURE delete_job;
      4  END;
      5  /
    SQL> CREATE OR REPLACE PACKAGE BODY DELETE_REQUEST_PKG AS
      2    PROCEDURE requests_delete_proc AS
      3      request_count NUMBER;
      4      nodatafound EXCEPTION;
      5    BEGIN
      6      DELETE FROM emp_test_job WHERE rownum<5;
      7    END requests_delete_proc;
      8 
      9    PROCEDURE delete_job AS
    10    BEGIN
    11      DBMS_SCHEDULER.create_job(job_name        => 'request_Delete_job',
    12                                job_type        => 'PLSQL_BLOCK',
    13                                job_action      => 'BEGIN DELETE_REQUEST_PKG.requests_delete_proc; END;',
    14                                start_date      => SYSTIMESTAMP,
    15                                repeat_interval => 'freq=MINUTELY',
    16                                end_date        => NULL,
    17                                enabled         => TRUE,
    18                                comments        => 'Job defined entirely by the CREATE JOB procedure.');
    19 
    20    END delete_job;
    21  END DELETE_REQUEST_PKG;
    22  /
    Package body created.
    SQL>
    SQL>  BEGIN
      2   DELETE_REQUEST_PKG.DELETE_JOB();
      3   END;
      4  /
    PL/SQL procedure successfully completed.
    SQL> SELECT job_name, program_name, start_date
      2  FROM all_scheduler_jobs;
    JOB_NAME
    PROGRAM_NAME
    START_DATE
    REQUEST_DELETE_JOB
    29-NOV-10 05.38.10.703000 PM +05:30
    SQL>  SELECT COUNT(*) FROM   emp_test_job;
      COUNT(*)
             6
    SQL> SELECT COUNT(*) FROM   emp_test_job;
      COUNT(*)
             0
    SQL> BEGIN
      2  DBMS_SCHEDULER.DROP_JOB('request_Delete_job',TRUE);
      3  END;
      4  /
    PL/SQL procedure successfully completed.

  • How to use NULL as an argument in a dbms_scheduler.create_job script?

    Hello All,
    We are trying to pass a null argument as a parameter to a PL/SQL program after CURRENT_TIMESTAMP. However, every attempt we try is producing errors. Why we are passing the null is another story. Does anyone know of the correct syntax, if there is any, to accomplish passing the null argument as a parameter to a PL/SQL program?
    We'd like to continue running with this same script setup and have the passing of the null working.
    This is what we've tried and directly below are the results. Any help so far would be appreciated!
    begin
    dbms_scheduler.create_job ( job_name => 'LOAD_CRF_TRANSACTION',
    job_type => 'PLSQL_BLOCK',
    job_action => 'begin
    DW_CRF.PKG_LPS_CRF_LOAD_TRANS.sp_load_target(''LOAD_CRF'', ''LOAD_LOAN_TRAN'', CURRENT_TIMESTAMP, );
    end;',
    start_date => sysdate +1/24/59,
    enabled => TRUE,
    auto_drop => TRUE,
    comments => 'LOAD LOAN TRANSACTION TABLE IN DW_CRF ' );
    end;
    ORA-06550: line ORA-06550: line 2, column 115:
    PLS-00103: Encountered the symbol ")" when expecting one of the following:
    ( - + case mod new not null others <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> avg
    count current exists max min prior sql stddev sum variance
    execute forall merge time timestamp interval date
    <a string literal with character set specification>
    <a number> <a single-quoted SQL string> pipe
    <an alternatively-quoted string literal with character set specification>
    <an alternatively-q
    , column :
    begin
    dbms_scheduler.create_job ( job_name => 'LOAD_CRF_TRANSACTION',
    job_type => 'PLSQL_BLOCK',
    job_action => 'begin
    DW_CRF.PKG_LPS_CRF_LOAD_TRANS.sp_load_target(''LOAD_CRF'', ''LOAD_LOAN_TRAN'', CURRENT_TIMESTAMP);
    end;',
    start_date => sysdate +1/24/59,
    enabled => TRUE,
    auto_drop => TRUE,
    comments => 'LOAD LOAN TRANSACTION TABLE IN DW_CRF ' );
    end;
    ORA-06550: line ORA-06550: line 2, column 21:
    PLS-00306: wrong number or types of arguments in call to 'SP_LOAD_TARGET'
    ORA-06550: line 2, column 21:
    PL/SQL: Statement ignored
    , column :
    begin
    dbms_scheduler.create_job ( job_name => 'LOAD_CRF_TRANSACTION',
    job_type => 'PLSQL_BLOCK',
    job_action => 'begin
    DW_CRF.PKG_LPS_CRF_LOAD_TRANS.sp_load_target(''LOAD_CRF'', ''LOAD_LOAN_TRAN'', CURRENT_TIMESTAMP, NULL);
    end;',
    start_date => sysdate +1/24/59,
    enabled => TRUE,
    auto_drop => TRUE,
    comments => 'LOAD LOAN TRANSACTION TABLE IN DW_CRF ' );
    end;
    ORA-20050: ORA-20050: Error Loading PKG_LPS_CRF_LOAD_TRANS Data
    ORA-06512: at "DW_CRF.PKG_LPS_CRF_LOAD_TRANS", line 958
    ORA-06512: at line 2
    begin
    dbms_scheduler.create_job ( job_name => 'LOAD_CRF_TRANSACTION',
    job_type => 'PLSQL_BLOCK',
    job_action => 'begin
    DW_CRF.PKG_LPS_CRF_LOAD_TRANS.sp_load_target(''LOAD_CRF'', ''LOAD_LOAN_TRAN'', CURRENT_TIMESTAMP, "NULL");
    end;',
    start_date => sysdate +1/24/59,
    enabled => TRUE,
    auto_drop => TRUE,
    comments => 'LOAD LOAN TRANSACTION TABLE IN DW_CRF ' );
    end;
    ORA-01858: a non-numeric character was found where a numeric was expected

    Hi,
    The third syntax you used is correct i.e.
    DW_CRF.PKG_LPS_CRF_LOAD_TRANS.sp_load_target(''LOAD_CRF'', ''LOAD_LOAN_TRAN'', CURRENT_TIMESTAMP, NULL);
    Alternatively you can use
    DW_CRF.PKG_LPS_CRF_LOAD_TRANS.sp_load_target(''LOAD_CRF'', ''LOAD_LOAN_TRAN'', CURRENT_TIMESTAMP, '''');
    all the other calls give syntax errors that are expected. The third call is giving an application error which you will need to look into (maybe starting at "DW_CRF.PKG_LPS_CRF_LOAD_TRANS", line 958). One thing that may help clarify things is if you were to switch to naming your parameters e.g. target_name=>''LOAD_CRF'' since that helps clarify exactly what parameter is called with which value.
    Hope this helps,
    Ravi.

  • DBMS_SCHEDULER.CREATE_JOB executing a shell script

    Hi ,
    Shell script :-  TEST.ksh
    #!/bin/ksh
    dhxmlfile=`date +"%Y-%j-%R"`
    dhoriginfile= /A/XMLFirstTest.xml
    dhdestinationfile=/A/B
    cp $dhoriginfile $dhdestinationfile/$dhxmlfile
    rm $dhoriginfile
    BEGIN
    DBMS_SCHEDULER.CREATE_JOB
    (job_name=>'TEST.ksh',
      job_type=>'EXECUTABLE',
    JOB_ACTION=>'/A/TEST.ksh',
    Start_date=> SYSDATE,
    job_class=> 'DEFAULT_JOB_CLASS',
    Enabled=> TRUE,
    auto_drop=> TRUE,
    Comments=> 'Run shell-script Test.ksh');
    Exception
    WHEN others then
    DBMS_OUTPUT.PUT_LINE
    (SQLCODE||SQLERRM);
    end;
    Getting an error :-
    ORA-27369: job of type EXECUTABLE failed with exit code: 274662
    STANDARD_ERROR="Oracle Scheduler error: Config file is not owned by root or is writable by group or other or extjob is not setuid and owned by root"
    Can anyone help me with this

    Can anyone help me with this
    No - not in this forum. This forum, as the title says, is for Sql developer questions.
    Please mark the question ANSWERED and repost it in the SQL and PL/SQL forum
    https://community.oracle.com/community/developer/english/oracle_database/sql_and_pl_sql

  • Dbms_scheduler.create_job problem

    Hello.
    I want to use dbms_scheduler.create_job in forms for progress_bar (http://fdegrelle.over-blog.com/article-10986844.html).
    But i get Dbms_scheduler.create_job must be declared message.
    If i connect to database as sys and check packages, dbms_scheduler is not among other packages.
    How do i install it? Is there a script?
    Thanks.

    DejanH,
    The PL/SQL code included in the sample dialog use both DBMS_SCHEDULER for 10g database and DBMS_JOB for 9i database..
    The DBMS_SCHEDULER is a 10g new feature. With a 9i version, you have to use the DBMS_JOB package:
    -- Lancement de la procédure par le package dbms_job pour la version 9i --
      If v_version = 9 Then
        dbms_job.isubmit(v_jobid,'Progress_Bar;',sysdate,null);
        forms_ddl('commit') ;
      Else
      -- Lancement de la procédure par le package dbms_scheduler pour la version 10g --
      dbms_scheduler.create_job(
        job_name   => v_jobname
       ,job_type   => 'stored_procedure'
       ,job_action => 'Progress_Bar'
       ,start_date => SYSDATE
       ,enabled    => TRUE
    ...In case of a 9i version, you have to comment all lines relative to the DBMS_SCHEDULER package ;-)
    Francois

  • DBMS_SCHEDULER.create_job Procedure will not fire

    I have created a procedure that does not seem to want to run
    create or replace
    procedure sched is
    BEGIN
      DBMS_SCHEDULER.create_job
        job_name        => 'my.MAILER',
        job_type        => 'PLSQL_BLOCK',
        job_action      => 'BEGIN MAILER;  END;',
        start_date      => SYSTIMESTAMP,
        repeat_interval => 'freq=daily;',
        end_date        => null,
        enabled         =>  TRUE,
        comments        => 'Fire off the my.MAILER procedure'
    END sched;Compiled the procedure and then ran it.
    then ran
    SELECT *
    FROM ALL_SCHEDULER_JOBS;and nothing..
    Any advice ?
    Edited by: Slider2015 on Mar 13, 2012 4:08 PM

    Hi,
    Using 'my.MAILER' puts the job in the schema 'my' . Is this what you intended to do ?
    If there are no errors after running this (you are also missing a "/" at the end which runs it) then the job will show up in dba_scheduler_jobs .
    -Ravi

  • Dbms_scheduler.create_schedule, dbms_scheduler.create_job의 차이점이 뭔가요?

    오라클 10g에서
    dbms_scheduler.create_schedule, dbms_scheduler.create_job의 차이점이
    뭔가요?

    예전에 사용하던 dbms_job 패키지는
    PL/SQL 코드 세그먼트만을 처리할 수 있으며, 데이타베이스 외부의 운영체제 파일 또는 실행 파일 이미지를 처리할 수 없다는 기능적 한계를 갖고 있습니다.
    이 때문에 DBA들은 Unix의 cron, Windows의 AT 명령 등을 사용하여 운영 체제 레벨에서 스케줄링을 설정하는 방법을 선택했었습니다.
    begin
    dbms_scheduler.create_job
    job_name => 'ARC_MOVE_2',
    schedule_name => 'EVERY_30_MINS',
    job_type => 'EXECUTABLE',
    job_action => '/home/arup/dbtools/move_arcs.sh',
    enabled => true,
    comments => 'Move Archived Logs to a Different Directory'
    end;
    또 Schedule Name을 설정하지 않고 작업을 생성하는 것도 가능합니다.
    begin
    dbms_scheduler.create_job
    job_name => 'ARC_MOVE_3',
    job_type => 'EXECUTABLE',
    job_action => '/home/arup/dbtools/move_arcs.sh',
    repeat_interval => 'FREQ=MINUTELY; INTERVAL=30',
    enabled => true,
    comments => 'Move Archived Logs to a Different Directory'
    end;
    앞의 두 가지 예를 통해 dbms_job과 비교했을 때의 Scheduler의 장점을 확인할 수 있습니다. Scheduler를 이용하면 PL/SQL 프로그램뿐 아니라 OS 유틸리티와 프로그램을 실행하는 것이 가능합니다.
    begin
    dbms_scheduler.create_schedule
    schedule_name => 'EVERY_30_MINS',
    repeat_interval => 'FREQ=MINUTELY; INTERVAL=30',
    comments => 'Every 30-mins'
    end;
    그리고, 궁금해 하셨던 create_schedule, create_job 차이는
    create_schedule 은 schedule_name, repeat interval, commnets 를 생성하여 관리하는 스케쥴일 뿐이며
    job 처럼 실제로 실행을 하지는 않습니다.
    create_job 에는 직접 repeat_interval 부분이 들어갈 수도 있으며, repeat_interval 부분을 사용하지 않고, repeat_interval 에 대한 정보가 있는schedule_name 를 사용할 수 있습니다.
    좀 더 자세한 설명은 아래 url 을 참고하세요...
    http://www.oracle.com/technology/global/kr/pub/articles/10gdba/week19_10gdba.html
    글 수정:
    minsu74 (김민수)

  • How set and get parameter for a session of a portlet (Java)

    I would like get parameter and set parameter for a portlet in portal 9.02. This parameter must be availbale during the session of the portal.
    With Java Servlet
    // I retrieve my session
    HttpServletRequest httpreq = (HttpServletRequest)req;
    HttpServletResponse httpresp = (HttpServletResponse)resp;
    HttpSession session = httpreq.getSession();
    //And after i can get or set some parameter for this servlet
    //Example
    session.setAttribute("MyEmployeeNumber","600000");
    String id = (String)session.getAttribute("MyEmployeeNumber");
    // But with Portlet in portal, i can't do it.
    PortletRenderRequest pr= (PortletRenderRequest)httpreq.getAttribute(HttpCommonConstants.PORTLET_RENDER_REQUEST);
    String sUser=pr.getUser().getName();
    ProviderSession session=pr.getSession();
    // But after if i want get or set a value in this session i have a internal error 500
    session.setAttribute("MyEmployeeNumber","600000");
    I would like my parameter is avalaible during a session for a user in each page of the portal, because my portlet is on each page.

    I have almost the same problem. I tried as you suggested, but it doesn't work yet.
    provider.xml
    <session>true</session>
    <passAllUrlParams>true</passAllUrlParams>
    My code in my jsp-portlet is
    <%@page contentType="text/html; charset=windows-1252"
    import="oracle.portal.provider.v2.render.PortletRenderRequest"
    import="oracle.portal.provider.v2.render.PortletRendererUtil"
    import="oracle.portal.provider.v2.http.HttpCommonConstants"
    import="oracle.portal.provider.v2.ParameterDefinition"
    import="oracle.portal.provider.v2.render.http.HttpPortletRendererUtil"
    %>
    <%@page session="true"%>
    <%
    PortletRenderRequest pReq = (PortletRenderRequest)request.getAttribute(HttpCommonConstants.PORTLET_RENDER_REQUEST);
    String valueSession = (String)pReq.getAttribute("sesion");
    if (valueSession != null) {
    pReq.setAttribute("session", "value1");
    out.println("<br>(1)valueSession != null");
    out.println("<br>(1)valueSession : " + pReq.getAttribute("session"));
    } else {
    pReq.setAttribute("session", "value2");
    out.println("<br>(2)valueSession == null");
    out.println("<br>(2)valueSession : " + pReq.getAttribute("session"));
    %>
    And i always get as result:
    (2)valueSession == null
    (2)valueSession : value2
    Even when i send values (post) at the same page or browsing between tabs:
    I check my provider registration and it has the value "once per session"
    I have portal 9.0.2.2.14
    Thanks

  • Parameter for Current Month and Previous Month

    I'm trying to create a parameter for current month and previous month based on the ex_date, but not sure what i'm doing wrong. 
    where ex_date = @SelectDate
    I created a second dataset below for the values in the parameters.
    SELECT Month(CURRENT_TIMESTAMP) AS 'Month', 'Current Month' as 'Current Month'
    union all
    SELECT Month(CURRENT_TIMESTAMP)-1 AS Month, 'Previous Month' as 'Previous Month'
    Results
    Month Current Month
    3 Current Month
    2 Previous Month
    Once I preview it I get "Conversion failed when converting date and/ or time from character string" I changed the data type to "date/Time" but that did not make a difference. The date is convert (varchar(10), ex_date, 101) so looks like
    11/12/2014. 
    I've also tried expressions like =month(now()) to pull current month with same error so i'm not sure what i'm doing wrong. Any ideas?

    i tired this real simple report
     in the first dataset - my main report query - select name from sysdatabases where month(crdate())=@month
    in the second dataset - select month(getdate()) as Month1
    in the parameters - choose int data type and available values - select the second data set
    in the first data set- add this parameter..( i am assumming you know this, since you have done)
    in the preview you should get the drop down with current month number - 3
    and if you run the report, it will display the database names that were created in march. remember we are no checking year, so will get all that were created in march across the years.
    Hope it Helps!!
    I'm looking to have the dropdown say "Previous Month" and "Current Month" as a option. I know how to get the information in SQL, but not sure how this translates or put into a parameter.
    Current Month
    list_date BETWEEN
    DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()), 0)
    AND
    DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()) + 1, 0)
    Previous Month
    list_date between
    CONVERT(varchar,dateadd(d,-(day(dateadd(m,-1,getdate()-2))),dateadd(m,-1,getdate()-1)),106) /* Last Month */
    and
    CONVERT(varchar,dateadd(d,-(day(getdate())),getdate()),106)

  • One parameter for multiple Crystal reports in Publication

    Does anyone know if it is possible to enter one identical parameter for multiple Crystal reports in publication when scheduling? BOE 3.1 SP3 Windows, Java.
    To elaborate I am creating publication with multiple reports, each report has one parameter and this parameter is identical in every report in publication. So instead of entering this parameter many times I would like to enter once. 
    If yes point me in the right direction to get the how to or post the steps.

    Daniel,
    Thank you so much for your answer. It was very helpful. In the end, it didn't work but it helped me figure out what was happening. I use a different form for the reports and I had it coded in the form which report to use. I created a second form for the second crystal and then I used an if statement to choose the form and it worked like a charm.
    Thanks so much again!

  • How to make a common parameter for two subreports in the main report.

    Hi,
    I have a crystal report which has 2 subreports in it. Both the subreports have the same code and I need to create a parameter for Project Cost in both the subreports for filtering the data.
    When i create the same parameter in both the subreports, i see two parameters with same name on my prompt page while refreshing the report. however I just want 1 parameter on my prompt page and data should get filtered in both the reports.
    Can anyone please suggest something, How can I do that? is there a way for sharing same parameter between two subreports?
    Thanks!
    Neha.

    hi Neha,
    here's how to do this:
    1) create a new parameter with the same name on the main report
    2) right click on your first subreport and choose Change Subreport Links
    3) in the Field to Link To list drag over your new main report parameter
    4) open the Subreport Parameter Field to Use select menu and choose your subreport parameter
    5) repeat steps for the 2nd subreport
    now you'll only get prompted once.
    cheers,
    jamie

Maybe you are looking for