Passing date to procedure

Hi All,
I have one scenario where I have to fetch the data from multiple tables and write it onto the spool file like.
set pagesize 9999
create or replace procedure p1 as
sd date:='&Start_date';
ed date:='&End_date';
a number;
b number;
c number;
d number;
e number;
f number;
begin
SELECT COUNT(BARNO) into a FROM DGP;
SELECT COUNT(DISTINCT(NO)) into b FROM LOG WHERE OPERATION_DATE between sd and ed AND (OPERATION_TYPE='B');
SELECT COUNT(DISTINCT(NO)) into c FROM LOG WHERE OPERATION_TYPE='UNBARRED' AND OPERATION_DATE between sd and ed;
SELECT COUNT(DISTINCT(NO)) into d FROM LOG WHERE OPERATION_DATE between sd and ed AND MODE ='AUTO' AND OPERATION_TYPE ='B';
SELECT COUNT(DISTINCT(NO)) into e FROM LOG WHERE OPERATION_DATE between sd and ed AND MODE ='AUTO' AND OPERATION_TYPE='UB';
SELECT COUNT(DISTINCT(NO)) into f FROM LOG WHERE OPERATION_DATE between sd and ed AND MODE ='MANUAL' AND OPERATION_TYPE='B';
dbms_output.put_line(a||' '||b||' '||c||' '||d||' '||e||' '||f);
end;
The above procedure asks me the date during the creation of the procedure, whereas my requirement is during the execution of the procedure it should ask me the date and that too only once.
Pls suggest.

create or replace procedure p1 (sd in date
                               ,ed in date
as
   a number;
   b number;
   c number;
   d number;
   e number;
   f number;
begin
   select COUNT(BARNO) into a FROM DGP;
   SELECT COUNT(DISTINCT(NO)) into b FROM LOG WHERE OPERATION_DATE between sd and ed AND (OPERATION_TYPE='B');
   SELECT COUNT(DISTINCT(NO)) into c FROM LOG WHERE OPERATION_TYPE='UNBARRED' AND OPERATION_DATE between sd and ed;
   SELECT COUNT(DISTINCT(NO)) into d FROM LOG WHERE OPERATION_DATE between sd and ed AND MODE ='AUTO' AND OPERATION_TYPE ='B';
   SELECT COUNT(DISTINCT(NO)) into e FROM LOG WHERE OPERATION_DATE between sd and ed AND MODE ='AUTO' AND OPERATION_TYPE='UB';
   SELECT COUNT(DISTINCT(NO)) into f FROM LOG WHERE OPERATION_DATE between sd and ed AND MODE ='MANUAL' AND OPERATION_TYPE='B';
   dbms_output.put_line(a||' '||b||' '||c||' '||d||' '||e||' '||f);
end;
/create it once and call it like
begin
   p1 (sysdate, sysdate + 1); -- pass parameters
end;
/and don't forget to
set serveroutput onotherwise you won't see output from DBMS_OUTPUT
Edited by: Alex Nuijten on Jul 14, 2009 1:16 PM

Similar Messages

  • Help understanding how to pass dates to procedures in a package?

    When I run the following script in SQL*Plus, I get no obvious errors, but the truncate does not happen and all the other processing doesn't happen. I ran a similar version in another tool and it worked. Much of the code is deleted here but I believe I don't fully understand passing dates in the procedure. I figure if one of the dates ends up null or something invalid, the procedure will run and give no results. If someone could correct me on how to pass variables, it would help greatly. As you can see, I am passing 2 dates in from an ACCEPT statement, passing them to 1 shell type procedure which runs other procedures and passes the dates to the procedures below it. This procedures calls the 3rd procedure and passes the same dates to it:
    ACCEPT CUR_PERIOD PROMPT 'Current Period (MM/DD/YYYY): ';
    ACCEPT PRIOR_PERIOD PROMPT 'Prior Period (MM/DD/YYYY): ';
    EXEC RCO.MONTH_END_PACK_1.MONTHENDPHASE1PROC('&CUR_PERIOD','&PRIOR_PERIOD');
    The spec looks like this:
    CREATE OR REPLACE PACKAGE MONTH_END_PACK_1 AS
         PROCEDURE MonthEndPhase1PROC(get_cur_period IN DATE, get_prior_period IN DATE);
         PROCEDURE W_CAT_INFO_RPT_PROC(GET_CUR_PERIOD IN DATE, GET_PRIOR_PERIOD IN DATE);
         PROCEDURE WO_CAT_INFO_RPT_PROC(GET_CUR_PERIOD IN DATE, GET_PRIOR_PERIOD IN DATE);
    END MONTH_END_PACK_1;
    The body looks like this:CREATE OR REPLACE PACKAGE BODY MONTH_END_PACK_1  AS
    PROCEDURE MonthEndPhase1PROC(get_cur_period IN DATE, get_prior_period IN DATE) IS
         BEGIN
              EXECUTE IMMEDIATE 'TRUNCATE TABLE RPT_DS1_CNT';
              EXECUTE IMMEDIATE 'TRUNCATE TABLE RPT_DS1_CNT_CAT';
              W_CAT_INFO_RPT_PROC(GET_CUR_PERIOD, GET_PRIOR_PERIOD);
         END;
    PROCEDURE W_CAT_INFO_RPT_PROC(GET_CUR_PERIOD IN DATE, GET_PRIOR_PERIOD IN DATE) IS
         CUR_PERIOD DATE;
         PRIOR_PERIOD DATE;
         BEGIN
              -- Assign the dates to this procedure that were passed in above.
              CUR_PERIOD := GET_CUR_PERIOD;         --07/27/2007
              PRIOR_PERIOD := GET_PRIOR_PERIOD;     --06/27/2007
              -- Execute stored procedure, passing in dates.
              WO_CAT_INFO_RPT_PROC(CUR_PERIOD, PRIOR_PERIOD);
              -- Other code goes here
         END; -- W_CAT_INFO_RPT_PROC
    PROCEDURE WO_CAT_INFO_RPT_PROC(GET_CUR_PERIOD IN DATE, GET_PRIOR_PERIOD IN DATE) IS
         CUR_PERIOD DATE;
         PRIOR_PERIOD DATE;
         BEGIN
              CUR_PERIOD := GET_CUR_PERIOD;
              PRIOR_PERIOD := GET_PRIOR_PERIOD;
              INSERT INTO RPT_DS1_CNT
              (select distinct trim(CVBI_KEY) as CVBI_KEY, vendor_id
              from
              (select m.cvbi_key, v.vendor_name
              from  rco.cogs_resource m,RCO.COGS_SRVCTYP st,rco.cogs_mkt ms,RCO.COGS_VENDOR v,
                (select distinct cvbi_key, vendor_id
                 from RCO.COGS_resource
                 where period = CUR_PERIOD)ak
              where  ak.cvbi_key = m.cvbi_key
              and  trim(m.cvbi_key) = trim(st.cvbi_key(+))
              and  period = CUR_PERIOD));
         END;
    END;
    /

    EXEC RCO.MONTH_END_PACK_1.MONTHENDPHASE1PROC(to_date('&CUR_PERIOD','MM/DD/YYYY'),to_date('&PRIOR_PERIOD','MM/DD/YYYY'));
    As you can see, I am passing 2 dates in from an ACCEPT statementUntil you convert them using TO_DATE they are just strings
    Message was edited by:
    3360
    Fixed date formats

  • Passing date to procedure help

    Hello, this maybe simple question, but I couldn't figure out why I am getting
    ORA-01843: not a valid month.. Here is what I did:
    exec proc(to_date('01/01/2007','MM/DD/YYYY'),to_date(01/30/2007,'MM/DD/YYYY'))NLS setting is: DD-MON-RR
    procedure proc (date1 in date, date2 in date)
    v_date_period varchar2;
    select date_period into v_date_period from t1 where start_date = to_date(date1,'MM/DD/YYYY') and end_date = to_date(date2,'MM/DD/YYYY');
    start_date and end_date are in date MM/DD/YYYY format in the table, but the above code is failed b/c of the above error.
    One thing I noticed that when dates are passed into the procedure, they come in DD-MON-RR format and the comparion never works in cursor. start_date and end_date are in MM/DD/YYYY format. but it works only when to_date(date1,'DD-MON-RR') and to_date(date2,'DD-MON-RR'). How is it working when start_date and end_date are in MM/DD/YYYY format???
    another question is, when I say To_date, does it always convert any date to NLS setting? I used
    to_date('01/01/2007', 'dd/mm/yyyy'), but it doesn't have any effect when it goes to the procedure.. still comes as DD-MON-RR.
    what mistake i am doing? I would appreciate your ans. Thanks,

    I think I got it now. I really didn't need that extra
    conversion within the procedure. It works now. Then let's make sure it's clear for you.
    You are right to consider the NLS_DATE_FORMAT settings, that's good, as most people are unaware of it and really have no understanding whatsoever as to what it does. Perhaps your understanding of it is not quite up to scratch just yet...
    The setting relates to how oracle converts between dates and strings when no format is specified explicitly. e.g.
    SQL> select to_char(sysdate) from dual;
    TO_CHAR(SYSDATE)
    04/03/2008 10:00:11
    SQL> alter session set nls_date_format = 'YYYY MON DD';
    Session altered.
    SQL> select to_char(sysdate) from dual;
    TO_CHAR(SYS
    2008 MAR 04
    SQL> select to_char(sysdate, 'DD/MM/YYYY') from dual;
    TO_CHAR(SY
    04/03/2008
    SQL>Likewise if you convert the other way from a string to a date...
    Firstly with implicit conversion, which will assume the NLS_DATE_FORMAT setting format for the string...
    SQL> select to_date('2008 JAN 01') from dual;
    TO_DATE('20
    2008 JAN 01And then if you explicitly convert specifying the format...
    SQL> select to_date('01/01/2008','DD/MM/YYYY') from dual;
    TO_DATE('01
    2008 JAN 01However if you try and implicitly convert (using the NLS setting) but the string isn't of the correct format...
    SQL> select to_date('01/01/2008') from dual;
    select to_date('01/01/2008') from dual
    ERROR at line 1:
    ORA-01843: not a valid month
    SQL>So now let's look at what you were doing...
    select date_period into v_date_period
    from t1
    where start_date = to_date(date1,'MM/DD/YYYY')
    and end_date = to_date(date2,'MM/DD/YYYY');Your date1 and date2 are already of a DATE datatype. This means that they are already stored in the oracle internal date format. Note: ALL dates are stored the same internally regardless of how they are displayed. e.g.
    SQL> select sysdate, dump(sysdate) from dual;
    SYSDATE
    DUMP(SYSDATE)
    04/03/2008 10:35:20
    Typ=13 Len=8: 216,7,3,4,10,35,20,0
    SQL> alter session set nls_date_format = 'YYYY MON DD HH24:MI'
      2  ;
    Session altered.
    SQL> select sysdate, dump(sysdate) from dual;
    SYSDATE
    DUMP(SYSDATE)
    2008 MAR 04 10:36
    Typ=13 Len=8: 216,7,3,4,10,36,50,0
    SQL>However, you are using the to_date function. This expects the first parameter to be a string and the second parameter is an optional string specifying the format of the first string.
    So it was expecting:
    to_date(<string>,<string>)and you gave it
    to_date(<date>,<string>)When oracle comes across this sort of thing, rather than produce an error it recognises that it is able to do an implicit conversion of datatypes so internally it is doing
    to_date(to_char(<date>),<string>)Note: because it is an implicit conversion within the "to_char" it is using the NLS settings to do this.
    You said your NLS setting was DD-MON-RR, so this is the same as...
    to_date(to_char(<date>,'DD-MON-RR'),<string>)Now look at your code again with the implicit conversions in place...
    select date_period into v_date_period
    from t1
    where start_date = to_date(to_char(date1,'DD-MON-RR'),'MM/DD/YYYY')
    and end_date = to_date(to_char(date2,'DD-MON-RR'),'MM/DD/YYYY');Hmmm, so the to_date function is getting it's first parameter as a string in the format 'DD-MON-RR' and the second parameter is telling it that the first parameter is in the format 'MM/DD/YYYY'.
    The two dates you passed were:
    '01/01/2007'
    and
    '01/30/2007'
    But after the implicit conversion your code looks like...
    select date_period into v_date_period
    from t1
    where start_date = to_date('01-JAN-07','MM/DD/YYYY')
    and end_date = to_date('30-JAN-07','MM/DD/YYYY');As you can see there are numerous problems with this. The first one Oracle errored on was the fact that 30 is not a valid Month as defined by your format string.
    Hopefully that clarifies things a little more for you and you'll understand a little more about the differences between strings, dates and implicit and explicit conversion between the two using format strings and the NLS setting.
    ;)

  • Passing Date to procedure give Problem

    heloo...
    I have two database schema, And both schema contain same procedure with Date as argument.
    that procedure workes well in one schema but it give error of "INVALID MONTH" in another schema.
    Any sollution of this?
    Thanks

    Why it is working fine in one schema and it give error in another schema? You did not post the most important part of your problem (how are you calling this procedure), but as indicated, if you are passing a string that looks like a DATE, then it can be converted to a date only using the database implicit conversion logic that will rely on NLS seetings (and those can well be different for the two users).
    See replies above on how to fix this.

  • Error while passing date parameters in procedure and commit issue

    Hi
    1) I am doing a archiveing records and pls find my code below and i have couple of issue,pls find my code and want to ensure the commit is happening every 100000 rows inserted but i am archeiving a huge table but when i checks the table frequently it shows 0 records and after it shows count the actual rows around 20 million records.How can i ensure it commiting on every 100000 records. pls find my code my db version is 10g on windows
    CREATE OR REPLACE PROCEDURE doins as
    cnt number:=0;
    FOR x IN (select * from Call_log
    where trunc(c_date) = to_date('11-Aug-2008','DD-MON-YYYY'))
    LOOP
    INSERT INTO call_arch
    select * from Call_log
    where trunc(c_date) = to_date('11-Aug-2008','DD-MON-YYYY');
    cnt := cnt + 1;
    IF( cnt = 10000 )
    THEN
    cnt := 0;
    commit;
    END IF;
    commit;
    END LOOP;
    2) Error while passing date as parameter i am getting following errors while passing date parameter pls find my code and errors
    CREATE OR REPLACE PROCEDURE doins(p_date date) as
    cnt number:=0;
    begin
    FOR x IN (select * from Call_log
    where trunc(c_date) = to_char(p_date,'DD-MON-YYYY'))
    LOOP
    INSERT INTO call_arch
    select * from Call_log
    where trunc(c_date) = to_char(p_date,'DD-MON-YYYY');
    cnt := cnt + 1;
    IF( cnt = 10000 )
    THEN
    cnt := 0;
    commit;
    END IF;
    commit;
    END LOOP;
    end;
    exec doins(11-Aug-2008) then gives
    SQL> exec doins(11-Aug-2008);
    BEGIN doins(11-Aug-2008); END;
    ERROR at line 1:
    ORA-06550: line 1, column 16:
    PLS-00201: identifier 'AUG' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    if i gave exec doins(11-08-2008) it gaves
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'DOINS'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    rgds
    rosh

    CREATE OR REPLACE PROCEDURE doins(p_date varchar2) as
    cnt number:=0;
    begin
    FOR x IN (select A.rowid,A.* from Call_log A
    where trunc(c_date) = to_date(p_date,'DD-MON-YYYY'))
    --hope that's c_date columne is   DATE datatype
    LOOP
    INSERT INTO call_arch
    select * from Call_log
    where rowid=x.rowid;
    cnt := cnt + 1;
    IF( cnt = 10000 )
    THEN
    cnt := 0;
    commit;
    END IF;
    commit;
    END LOOP;
    end;
    thats your correct procedure - but NOT CORRECT ISSUE.
    You should use bulk collect with limit clause and forall clause to do it faster!!! Or Merge clause.

  • Pass Parmeter To Sql Data Base Procedure

    Hi,
    i used JDEVADF_11.1.1.4.0
    I have two fields Date type on the Page, and I have a Procedure database gives difference between two dates, on the road to send the values of the two date , and give me the number of days
    I make a call the Procedure in AppModuleImpl
    How can I send the parameter two dates from the screen to data base Procedure , for run the Procedure

    Hi,
    Bind the dates value to the bean and call the IMPL method with help of these value passed as argument .
    The IMPL method must exposed as client interface so that bean can access that method.
    @Gunanidhi

  • Passing data from Oracle stored procedures to Java

    We're going to write a new web interface for a big system based on Oracle database. All business rules are already coded in PL/SQL stored procedures and we'd like to reuse as much code as possible. We'll write some new stored procedures that will combine the existing business rules and return the final result dataset.
    We want to do this on the database level to avoid java-db round trips. The interface layer will be written in Java (we'd like to use GWT), so we need a way of passing data from Oracle stored procedures to Java service side. The data can be e.g. a set of properties of a specific item or a list of items fulfilling certain criteria. Would anyone recommend a preferable way of doing this?
    We're considering one of the 2 following scenarios:
    passing objects and lists of objects (DB object types defined on the schema level)
    passing a sys_refcursor
    We verified that both approaches are "doable", the question is more about design decision, best practice, possible maintenance problems, flexibility, etc.
    I'd appreciate any hints.

    user1754151 wrote:
    We're going to write a new web interface for a big system based on Oracle database. All business rules are already coded in PL/SQL stored procedures and we'd like to reuse as much code as possible. We'll write some new stored procedures that will combine the existing business rules and return the final result dataset.
    We want to do this on the database level to avoid java-db round trips. The interface layer will be written in Java (we'd like to use GWT), so we need a way of passing data from Oracle stored procedures to Java service side. The data can be e.g. a set of properties of a specific item or a list of items fulfilling certain criteria. Would anyone recommend a preferable way of doing this?
    We're considering one of the 2 following scenarios:
    passing objects and lists of objects (DB object types defined on the schema level)
    passing a sys_refcursor
    We verified that both approaches are "doable", the question is more about design decision, best practice, possible maintenance problems, flexibility, etc.
    I'd appreciate any hints.If logic is already written in DB, and the only concern is of passing the result to java service side, and also from point of maintenance problem and flexibility i would suggest to use the sys_refcursor.
    The reason if Down the line any thing changes then you only need to change the arguments of sys_refcursor in DB and as well as java side, and it is much easier and less efforts compare to using and changes required for Types and Objects on DB and java side.
    The design and best practise keeps changing based on our requirement and exisiting design. But by looking at your current senario and design, i personally suggest to go with sys_refcursor.

  • Problem in passing data from 1 screen to another using BBP_DOC_CHANGE_BADI.

    Hi Experts,
    i am new to the SRM, i am facing problem in passing data from one screen to another.
    my requirement is that when we select one shopping cart and press the PROPOSE SOURCES OF SUPPLY button, we will fetch all the contracts that are attached to the shopping cart.
    we have implemented a BADI implementation of BBP_SOS_BADI (method BBP_SOS_CHECK) for passing some changed values to the contracts of the shopping cart into the popup screen that is displayed when we press PROPOSE SOURCES OF SUPPLY button and when we select any contract and press ASSIGN ONLY button in the popup screen the badi BBP_DOC_CHANGE_BADI is triggered.
    i have implemented another BADI implementation of BBP_DOC_CHANGE_BADI for fetching the selected contract and pass the values to another screen, but the problem is that when we select one contract and press the assign only button we are fetching the wrong contract number ( that is in the BADI method BB_SC_CHANGE parameter IT_ITEM we are fetching the wrong contract), if we again do the same procedure for the second time we are getting the correct contract.
    i am unable to understand why we are getting the wrong contract in the first time( that is we are getting contract other than the selected one).
    as per my understanding i think when we are passing data to the popup screen using BBP_DOC_CHANGE_BADI we are not updating the shopping cart with the changed data.
    can anyone tell me how we can update the SHOPPING CART with the changed contracts data, i have used BBP_PD_SC_UPDATE, BBP_PD_SC_SAVE and other shopping cart FM but nothing is happening.
    Thanks
    Tanveer

    Hello,
    What version of SRM are you on?  Have you check for OSS Notes?  I have had trouble with BBP_DOC_CHANGE_BADI but it was because of other issues.  The BADI works pretty well and it is called almost every time something happens to the shopping cart.
    I have noticed that sometimes that values are not changed til the second calling of the BADI.  I have yet understand why but I think it has to do with prompt processing. Usually, we train our requisitioners to click the 'Check'  button to flush things out.
    I don't know if I was helpful.... another thought.... could there be an error caught by BBP_DOC_CHECK_BADI that is preventing change in BBP_DOC_CHANGE_BADI?
    Regards, Dean.

  • How to pass Data from one form to the other

    Hi all
    Can any one suggest me how to pass data from one form to the other form, which i zoomed from the original one?
    I tried to do this by passing parameter in Event Procedure but i am getting error msg when i am opening the zoomed form.
    If any one of u have any idea, give me a reply
    Thank you
    Suhasini

    If you choose the second alternative you should erase these global variables after the second form is opened
    You can erase the global variable using:
    erase('global_var')
    Greetings,
    Sim

  • Passing date format in sys.dbms_xmlgen

    hello all,
    i am using following query to generate insert SQL statements
    SELECT
    'insert into ' || table_name || ' (' || (select rtrim(extract(xmlagg(xmlelement(e, t.column_value.getrootelement() || ',')),'//text()'),',') from table(xmlsequence(t.column_value.extract('ROW/*'))) t) || ') values (' ||
    (select dbms_xmlgen.convert(rtrim(extract(xmlagg(xmlelement(e, '''' || t.column_value.extract('//text()') || ''',')),'//text()'),','),1) from table(xmlsequence(t.column_value.extract('ROW/*')))t) || ');' ins_stmt
    from user_tables,
    table(xmlsequence(dbms_xmlgen.getxmltype('select * from ' || a_TblName ||' WHERE MODIFIEDON >'||a_date).extract('ROWSET/ROW'))) t
    where table_name in (select table_name from user_tables where table_name =a_TblName);but when i execute the procedure as
    sql> exec   Gen_Insert_Statement('11-jun-2009');
    ORA-19202: Error occurred in XML processing
    ORA-00904: "JUN": invalid identifier
    ORA-06512: at "SYS.DBMS_XMLGEN", line 288
    ORA-06512: at line 1
    ORA-06512: at "MRILDATA17TEST.GEN_INSERT_STATEMENT", line 22
    ORA-06512: at line 2     and if i do this
    SQL> exec Gen_Insert_Statement('11-06-2009');
    begin Gen_Insert_Statement('11-06-2009'); end;
    ORA-01843: not a valid month
    ORA-06512: at line 2is there any format to pass date while using XML packages??? i am also not getting in which this issue is occuring??
    any suggestion will be appreciable
    thanks and regards
    VD
    Edited by: dixit on Aug 13, 2009 6:15 AM
    Edited by: dixit on Aug 13, 2009 6:21 AM

    The date issue is coming from
    dbms_xmlgen.getxmltype('select * from ' || a_TblName ||' WHERE MODIFIEDON >'||a_date)It is due to the implicit conversion from the internal Date object type to a String type for display. The format is based off the NLS_DATE_FORMAT so varies from system to system. When dealing with dates, it is always best to use either to_char or to_date to ensure there are no errors in converting from one format to the other. That would include adding to_date with a format mask making it part of your Select SQL statement around a_date, such as to_date(a_date, 'DD-MON-YYYY')
    Also, if you have any dates in the tables that are being queried, you will run into a similar implicit conversion issue. Oracle does not format dates in the proper XML format of YYYY-MM-DD when building XML in this manner as it uses the NLS_DATE_FORMAT. So you cannot guarantee the INSERT statement will work on another DB with a different NLS_DATE_FORMAT.
    As others have asked, why you are trying to build insert statements this way as there is a lot to take into consideration regarding data formats. It seems this has been discussed on the {forum:id=75} forum but that has been some time ago.

  • Issue in passing data from PAge A to Page B

    Hi
    I have a scenario where I am trying to pass data from Page A to Page B. This data has to
    be passed on the click of a button. On the button's event, I have set the paramaters that
    I want to pass. I have passed these params in a hashmap in pageContext.forwardImmediately
    method.
    Page A has the requisition records. Clicking the radio button against one of these
    records and clicking the Lines button should take me to Page B with that Requisition VO's
    Row.
    In Page B, there are 2 parts..
    (1) A header which displays the requisition details like Req Number, Current Version,
    Previous Version etc
    (2) A table (Advanced Table) regiion which displays the Line details per that Requisition
    (Each Requisiton has 'n' lines).
    I am also getting the paramater value(s) in Page B's controller's processRequest.
    Here, I am calling the init methods on both the requisitionsVO and the linesVO which calls the executeQuery() methods. I thought that this will populate the Page B as the VO's columns are mapped to the
    respective fields in the Page. But I am not able to see any data on Page B. Am I missign anything here.

    reinitlize the VO
    By this do you mean the following :
    In the Controller:
    String reqNum = (String)pageContext.getParameter(PoConstants.PO_REQUISITION_KEY);
    if(!PoUtils.isEmpty(reqNum)) {
    Serializable[] param = {reqNum};
    Class [] paramTypes = {reqNum.getClass()};
    am.invokeMethod("initPoReqHeadersQuery",param, paramTypes);
    In the AM:
    public void initPoReqHeadersQuery(String criteria)
    OADBTransaction txn = this.getOADBTransaction();
    if ( txn.isLoggingEnabled(oracle.apps.fnd.framework.OAFwkConstants.PROCEDURE))
    txn.writeDiagnostics(this, "initPoReqHeadersQuery.begin", oracle.apps.fnd.framework.OAFwkConstants.PROCEDURE);
    PoReqPendingForAcceptanceVOImpl vo = getPoReqPendingForAcceptanceVO1();
    vo.initReqQueryAction(criteria);
    if(!PoUtils.isEmpty(vo)) {
    PoReqPendingForAcceptanceVORowImpl row = (PoReqPendingForAcceptanceVORowImpl)vo.first();
    if(!PoUtils.isEmpty(row)) {
    vo.setCurrentRow(row);
    if ( txn.isLoggingEnabled(oracle.apps.fnd.framework.OAFwkConstants.PROCEDURE))
    txn.writeDiagnostics(this, "initPoReqHeadersQuery.end", oracle.apps.fnd.framework.OAFwkConstants.PROCEDURE);
    In the VO:
    public void initReqQueryAction(String criteria)
    OADBTransaction txn = (OADBTransaction)getApplicationModule().getTransaction() ;
    if ( txn.isLoggingEnabled(oracle.apps.fnd.framework.OAFwkConstants.PROCEDURE))
    txn.writeDiagnostics(this, "initReqQueryAction.begin", oracle.apps.fnd.framework.OAFwkConstants.PROCEDURE);
    setWhereClauseParams(null);
    setWhereClause(null);
    setWhereClause("SEGMENT1 = :1");
    setWhereClauseParam(0,criteria);
    executeQuery();
    if ( txn.isLoggingEnabled(oracle.apps.fnd.framework.OAFwkConstants.PROCEDURE))
    txn.writeDiagnostics(this, "initReqQueryAction.end", oracle.apps.fnd.framework.OAFwkConstants.PROCEDURE);
    }

  • Can not pass data after while loop

    Hello.
    I have created a VI for my experiment and am having problem passing data outside a while loop to save on an excel file. The VI needs to first move a probe radially, take data at 1mm increment, then move axially, take data radially at 1mm increment, then move to the next axial position and repeat. It would then export these data to an excel file. The VI is a little complicated but it's the only way I know how to make it for our experiment. I have tested it and all the motion works correctly, however I can not get it to pass the data after the last while loop on the far right of the VI where I have put the arrows (Please see the attached VI ). Is it because I'm using too many sequence, case, and while loops?  If so, what other ways can I use to make it export data to the excel file?
    Any help would be appreciated. 
    Thank you,
    Max
    Attachments:
    B.Dot.Probe.Exp.vi ‏66 KB

    Ummmm .... gee, I'm not even sure where to begin with this one. Your VI is well .... ummmm... You have straight wires! That's always nice to see. As for everything else. Well... Your fundamental problem is lack of understanding of dataflow programming. What you've created is a text program. It would look fantastic in C. In LabVIEW it makes my heart break. For a direct answer to your question: Data will not show up outside a while loop until the while loop has completed. This means your most likely problem is that the conditions to stop that specific loop are not being met. As for what the problem is, I don't even want to start debugging this code. Of course, one way to pass data outside of loops is with local variables, and hey, you seem to be having so much fun with those, what's one more?
    This may sound harsh, and perhaps be somewhat insulting, but the brutal truth is that what I would personally do is to throw it out and to start using a good architecture like a state machine. This kind of framework is easy to code, easy to modify, and easy to debug. All qualities that your code seems to lack.
    Message Edited by smercurio_fc on 08-17-2009 10:00 PM

  • How to pass date parameter from one page to other in BSP application

    Hello gurus,
    In my BSP application i have taken an input field and made its type "date" and its value also of type date and have set showhelp .
    Now once a particular date is given as an input i want to pass its value to next page. And in next page i have to fire a query based on the date entered in previous page...
    Now my prb is that my date value is not getting passed to the next page.
    I have used
    navigation->set_parameter( name = 'BEGDA' value = BEGDA ).
    to pass date parameter.....still parameter is not getting passed.
    plz help me with this.....
    thankx.....

    Hi Eddy,
    By truncation i mean the entire date becomes 10 char including the ' . ' eg(06.12.2006).
    so with begda being 8chars it takes my date as 06.12.200
    as a result my query is not getting executed.
    now i have tried to use a FM  'CONVERT_DATE_TO_INTERN_FORMAT'.
    in my 1st page but still in 2nd page its giving me following error.
    <b>The data that was read could not be written to the specified target field during a SELECT access. Either the conversion is not supported for the type of the target field, or the target field is too short to accept the value, or the data is not in the appropriateformat for the target field.
    </b>
    Regards
    Swati

  • Passing date parameter from prompt

    Hi experts
    I am getting some problem while passing date from a dashboard prompt.
    In RPD i have changed the date column properties as DATE only so that i will get the DATE part of the data not the time stamp.
    Now in the dashboard prompt i added a prompt for the date column.
    I initialized the date prompt with a server variable of sysdate
    when i am running the dashboard i am getting default value in the prompt(04/15/2011)
    when i am changing the date it is selected as(04/15/2011)
    but when i am clicking the 'Go' button the date is converting to 2011-04-15 00:00:00 due to which my report is not running and i am getting error as
    View Display Error
    A date value was expected (received "2011-04-15 00:00:00").
    Error Details
    Error Codes: QABPH2PO
    can anyone help me to pass only date part
    thanks in advance
    regards
    Gourisankar

    Hi J / Srikanth
    Sorry to restart the thread again.
    As we discussed i have downloaded the patch and applied to my windows 32 bit machine.
    But now when i run the report the report is running only for the default value(Server Variable) which is specified to the prompt. when i change the date there is no effect to the report.
    When i drill down to the report i found that the date column(is prompted) is changed to teh server variable name which is might be the cause.
    any input on this???
    regards
    Gourisankar

  • Problem with passing date parameters in cursor

    Is there any problem in passing date parameters and like clause as below
    CURSOR eftcursor(start_date DATE, end_date DATE, where_clause varchar2) IS
    select * from r_records
    where created_date between start_date and end_date and description like where_clause;
    and in the open statement
    select to_date('01/06/2010 00:00:00', 'dd/mm/yyyy hh24:mi:ss') into startDate from dual;
    select to_date('01/07/2010 00:00:00', 'dd/mm/yyyy hh24:mi:ss') into endDate from dual;
    str := '%something%aaaaa%';
    open eftcursor(startDate ,endDate , str);
    Do i need to do any kind of conversion in the cursor where clause or when i am passing the parameter in open statement.

    Almora wrote:
    Do i need to do any kind of conversion in the cursor where clause or when i am passing the parameter in open statement.No, your code looks correct -- ou're passing a date to the cursor.
    You might consider whether you really need an explicit cursor though. An implicit cursor is easier to code and performs better.

Maybe you are looking for

  • ISE 1.1 'Change password on next logon' fails on iPhone / iPad

    Hello - We're in the process of implementing an ISE 1.1 server for Guest Wireless Access / BYOD at our company and ran into an issue with authenticating from iPhones / iPads when the account is set with 'change password on next logon' (it's a local a

  • All open POItems in MD04

    Hi experts, I have following requirement: I am looking into transaction MD04. In the field MRP-Element I have the values POConf and POItem. For my report I need all the values in the future.  In my report I have the selection criteria vendor. So I wa

  • Is Photoshop Elements v. 8.0 compatible with OSX 10.10.3?

    Is Photoshop Elements v. 8.0 compatible with OSX 10.10.3?

  • Windows 2000 Logon without getting the windows workatation log on screen

    Hi I wonder if anyone can help me!! We have Win2K Professional workstations in our company. The workstations have Zenworks for Desktops 4 installed as well as Netware client 4.83SP2. When the PC boots up, the users get the following screens for loggi

  • AL external FW enclosure ????

    I'm looking an AL, external, firewire 400/800 enclosure that will accept a 2.5" SATA drive (removed from my MBP). Can anyone recommend a quality enclosure? Does G-Tech sell enclosures? Thanks