HELP: VO Bind variable gets lost, VO passivation checked!

JDEv 10.1.3.0.4 + Struts/ADF
I have a VO with one bind variable "accountId", this VO is the "root master" of the hierarchy => not a detail of a link.
I added a method in the VO (that is part of one AM only) to set the bind variable:
  WHERE CLAUSE:
(Wevent.EVENT_ID = WeventDesign.EVENT_ID) AND (Wevent.ACCOUNT_ID = AccountOwner.ACCOUNT_ID) AND (Wevent.PHOTOGRAPHER_ACCOUNT_ID = AccountPhotoGrapher.ACCOUNT_ID) AND (Wevent.EVENT_STATUS BETWEEN 30 AND 80) AND (Wevent.ACCOUNT_ID = :0)
  Binding Style: Oracle Positional
  private Number accountId = null;
  private Object[] DEFAULT_VALUES = new Object[]{ Constants.NUMBER_ZERO };
  private static int NUM_DEFAULT_VALUES = DEFAULT_VALUES.length;
  public Row setAccountId(Number newAccountId)
    Row row = null;
    if (newAccountId == null)
    this.accountId = null;
    this.clearCache();
    System.out.println(getClass().getName()+".setAccountId no exeqry newAccountId == null");    
    else
      this.accountId = newAccountId;
      row = this.getCurrentRow();
      if(row == null || row.getAttribute("AccountId") == null || !newAccountId.equals(row.getAttribute("AccountId")))  
// not good account events !!!!
      this.setWhereClauseParam(0,newAccountId);
      System.out.println(getClass().getName()+".setAccountId before exeqry newAccountId: "+newAccountId);    
      this.executeQuery();
//      System.out.println(getClass().getName()+".setAccountId after exeqry getRowCount(): "+this.getRowCount());    
      row = this.first();
        if (row != null)
        System.out.println(getClass().getName()+".setAccountId after exeqry+first row.getAttribute(AccountId): "+row.getAttribute("AccountId"));            
        else
        System.out.println(getClass().getName()+".setAccountId after exeqry+first row is null => no rows");                    
      else
      System.out.println(getClass().getName()+".setAccountId NO exeqry this.accountId: "+this.accountId+", newAccountId: "+newAccountId+" current is null? "+(this.getCurrentRow() == null));          
      this.accountId = newAccountId;   
      DEFAULT_VALUES[0] = newAccountId;
      System.out.println(getClass().getName()+".setAccountId this.accountId: "+this.accountId+", newAccountId: "+newAccountId+", DEFAULT_VALUES[0]: "+DEFAULT_VALUES[0]);          
    return row;
In the AMImpl class I added a service method:
  public Row prepareModelForEventAccountOwnerList(Number accountId)
    EventAccountOwnerListExtVOImpl eventAccountOwnerListExtVOImpl = this.getEventAccountOwnerListExtVO1();
    return eventAccountOwnerListExtVOImpl.setAccountId(accountId);
  }When the user logs in his accountId is retrieved and stored in the HttpSession.
and the service method is called.
Ok at this point.
I have a Page that displays the view.
In the class AccountEventsAction that extends PagingDataForwardAction I have following initializeModelForPage method.
  protected void initializeModelForPage(DataActionContext ctx)
    System.out.println(getClass().getName()+".initializeModelForPage BEGIN "+System.currentTimeMillis());
    WebAccountAM webAccountAM = (WebAccountAM) this.getApplicationModule(WebConstants.AM_WEBACCOUNT,ctx);
    if (webAccountAM == null)
     // return error
     System.out.println(getClass().getName()+".initializeModelForPage webAccountAM not found.");
    else
      UserContainer userContainer = this.getUserContainer(ctx);
      Row row = webAccountAM.prepareModelForEventAccountOwnerList(userContainer.getAccountId());
      if (row != null)
      System.out.println(getClass().getName()+".initializeModelForPage userContainer.getAccountId(): "+userContainer.getAccountId()+", EventId: "+row.getAttribute("EventId")+", current row key: "+row.getKey());             
      else
      System.out.println(getClass().getName()+".initializeModelForPage userContainer.getAccountId(): "+userContainer.getAccountId()+", First row is null? "+(row == null));     
      super.initializeModelForPage(ctx);
    }To my knowledge because this page is accessible only after login and the VO passivation state (+bind vars ..) is yes it shouldn't be necessary?
FIRST PROBLEM:(non blocking)
=============
I noticed in my trace that the VO current row is null when the service method gets called in the initializeModelForPage binding method?
So the query gets re-exceuted, is this normal??
SECOND PROBLEM (blocking)
================
At some point the Web app. the frameworks calls the executeQueryForCollection and an exception is thrown as if the bind variable was lost???
extract:
oracle.jbo.JboException: JBO-29000: Unexpected exception caught: oracle.jbo.SQLStmtException, msg=JBO-27122: SQL error during statement preparation.  Statement: SELECT Wevent.EVENT_ID, ...       
FROM WEVENT Wevent, WEVENT_DESIGN WeventDesign, ACCOUNT AccountOwner, ACCOUNT AccountPhotoGrapher WHERE (Wevent.EVENT_ID = WeventDesign.EVENT_ID) AND (Wevent.ACCOUNT_ID = AccountOwner.ACCOUNT_ID) AND (Wevent.PHOTOGRAPHER_ACCOUNT_ID = AccountPhotoGrapher.ACCOUNT_ID) AND (Wevent.EVENT_STATUS BETWEEN 30 AND 80) AND (Wevent.ACCOUNT_ID = :0) ORDER BY Wevent.T_MODIFIED
     at oracle.jbo.JboException.<init>(JboException.java:346)
     at oracle.adf.controller.lifecycle.PageLifecycle.handleError(PageLifecycle.java:722)
     at oracle.adf.controller.struts.actions.DataAction.handleError(DataAction.java:257)
     at oracle.adf.controller.struts.actions.DataAction.handleError(DataAction.java:453)
     at oracle.adf.controller.lifecycle.PageLifecycle.handleLifecycle(PageLifecycle.java:147)
     at oracle.adf.controller.struts.actions.DataAction.handleLifecycle(DataAction.java:223)
     at com.photoswing.webview.actions.BaseDataForwardAction.handleLifecycle(BaseDataForwardAction.java:239)
     at oracle.adf.controller.struts.actions.DataAction.execute(DataAction.java:155)
     at oracle.adf.controller.v2.struts.actions.DataAction.execute(DataAction.java:104)
     at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
     at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
     at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
     at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:434)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
     at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
     at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:332)
     at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
     at com.photoswing.filter.LocaleFilter.doFilter(LocaleFilter.java:318)
     at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:627)
     at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)
     at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
     at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
     at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218)
     at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)
     at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
     at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
     at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
     at java.lang.Thread.run(Thread.java:595)
## Detail 0 ##
oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. 
06/10/13 22:37:15 java.sql.SQLException: Missing IN or OUT parameter at index:: 1
06/10/13 22:37:15      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:138)I hope I didn't miss something and I don't have to review all my bind variables setting methods!
Your help is required and will be appreciated
Fred

More info:
I added a trace in the executeQueryForCollection method of the VO.
As I said before the binding var is set on login and in initializeModelForPage
but when the executeQueryForCollection is called by framework later on in the action cycle, it is called without any parameters => bind variables = numUserParams: 0 ??
trace extract
com.photoswing.model.site.EventAccountOwnerListExtVOImpl.executeQueryForCollection this.accountId: null, numUserParams: 0, DEFAULT_VALUES[0]: 0
I suppose that some code must be added so that my bind variables will be part of the passivation process.
Can you help me with that?
Thanks for your time.
Fred
PS It's my second day on this problem.

Similar Messages

  • Help with bind variables

    Hello I'm new to .net and I'm trying to work with bind variables
    I keep getting the ORA-01036: illegal variable name/number error.
    here's my code, can somebody help me out and show me what am I doing wrong?
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    Dim drLocation As OracleDataReader = getSCLocation("SOMEBODY")
    End Sub
    Private Function getSCLocation(ByVal contactName As String) As OracleDataReader
    Dim drLocation As OracleDataReader
    Dim connString As String = ConfigurationManager.ConnectionStrings("scConnString").ConnectionString
    Dim conn As New OracleConnection(connString)
    conn.Open()
    Dim queryString As String = "select a.location, a.location_name from locationm1 a where a.primary_contact_dept in (select b.dept from contactsm1 b where b.contact_name = p_contactName)"
    Dim p_contactName As New OracleParameter
    p_contactName.OracleType = OracleType.VarChar
    p_contactName.Value = contactName
    Dim cmdLocation As New OracleCommand(queryString, conn)
    cmdLocation.Parameters.Add(p_contactName)
    drLocation = cmdLocation.ExecuteReader(CommandBehavior.CloseConnection)
    Return drLocation
    End Function
    Thanks
    Peter

    never mind i got it by playing around with it
    had to change the way to start the bind variable
    Dim p_contactName As New OracleParameter("p_contactName", OracleType.VarChar)
    p_contactName.Size = 140
    p_contactName.Value = contactName

  • Need help in Bind variable in AF Query LOV

    Hi,
    i have one problem with bind variable, if i use bind variable in the LOV VO Query then my result is not coming, if there is not bind variable it's working fine and if i use the bind variable in the LOV search option then it's working fine but if i hide the bind variable and set the value in AM prepareSesstion method the LOV is not returning any value. I try to return the values also all values are also coming but those values are not setting to AF Query Attribute.
    Query is:
    select substr(d.description,0,40) description
    from cm_system_users a,
    cm_user_responsibilities b,
    cm_responsibility_processes c,
    cm_processes d
    where a.nt_login =:B_NT_LOGIN
    and a.user_id = b.user_id
    and trunc(sysdate) between b.eff_date and nvl(b.exp_date,sysdate + 1)
    and b.RESPONSIBILITY_ID = c.RESPONSIBILITY_ID
    and c.process_type = d.process_type
    and d.enabled_flag = 'Y' order by d.arguments_flag
    AM Method:
    CmProcessViewImpl vo = getCmProcessView();
    String nt_login = getUserPrincipalName();
    vo.setNamedWhereClauseParam("B_NT_LOGIN", nt_login.toUpperCase());
    vo.executeQuery();
    Can any one help me in this. it's urgent for me.

    This is a little underdescribed. IIUC, the view object in question is being used as a target for a view accessor, correct? (Otherwise you'll have to be more explicit about what you mean by "Query LOV".
    If I'm right, there are two possibilities:
    1) You are using a VO instance in a shared application module instance. If so, make sure your code is in the prepareSession() for that application module class if it's session dependent (as it seems to be below), you need to make sure the application module instance is shared at session scope.
    2) You've based the view accessor directly on the VO definition. This basically creates an anonymous VO instance; I don't think there's any way to use prepareSession() to set a bind variable on such an instance (which won't be created until the accessor is first used). You might be able to get by with putting similar code into the view object class' create() method, but I haven't tested this.
    If your code is in your primary application module class (as opposed to the class for a shared AM instance), the problem here is that getCmProcessView() returns the VO instance from that application module instance's design-time data model, which is never used by view accessors.
    By the way, why do you need to do this in prepareSession() instead of at the view accessor level? I believe you can get the logged in user name (for the view accessor) in with the groovy expression
    viewObject.DBTransaction.session.userPrincipalName
    or possibly just
    DBTransaction.session.userPrincipalName
    (despite this involving DBTransaction, it returns the web app user name, not the DB username).
    That's a 100% declarative solution, if you don't count the Groovy expression as non-declarative.
    If you're afraid of a user executing the LOV (somehow) before the bind variable value gets set, just ensure that the bind variable is marked "required".

  • A little bit of help with Bind variables please

    Hi,
    I am having a bit of trouble with bind variables I have been looking at the Dev guide and the forum to try and achieve this and it is still not happening for me, could anybody please help or point me in the right direction:
    I have created a simple PersonVO with the basic query:
    Select distinct full_name from xxml_people where person_id = :1
    In the PersonVOImpl.java I have added the method:
    public void initQuery(String personId)
    Number person = null;
    try
    person = new Number(personId);
    catch
    (Exception e){}
    setWhereClauseParam(1,person);
    executeQuery();
    Then in the PersonAM I have added the method:
    public void initPersonQuery(String personId)
    getPersonVO1().initQuery(personId);
    I then call this method in my processRequest section of my page controller:
    PersonAMImpl am = (PersonAMImpl) pageContext.getRootApplicationModule();
    String personId = "581";
    am.initPersonQuery(personId);
    When I try and run this I get the error:
    oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT distinct full_name from xxml_absence_calendar where person_id = :1
    java.sql.SQLException: ORA-01006: bind variable does not exist
    Am I binding the variables correctly? Or am I making some stupid mistake?
    I am ultimately looking to create a messageChoice where the logged in user will see a list of all organisations underneath him and the one level above. I plan to do this by passing the User’s Organisation name into a VO query using the organisation as a Bind Variable. I think once I have worked out how to bind variables this should be straight forward.
    Many Thanks

    Even though the parameter binding values may be same, you should never use the positional param more than once. So always go for the format
    select distinct full_name from xxml_people where supervisor_id = :1
    UNION
    select distinct full_name from xxml_people where person_id = :2
    --Shiv                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • [Oracle 8i] Need help with bind variable in add_months function

    I'm trying to put a variable within my add_months function:
    AND     t1.edatetime >= add_months(sysdate,:v1)
    AND     t1.edatetime <= add_months(sysdate,:v2)I have tried defining the variable both as 'integer' type and 'numeric' type, but in both cases, my query returns no results. If I hard code the values, it works just fine.
    Any suggestions?

    Hi,
    Sorry, I can't reproduce the problem.
    What do you mean by "I have tried defining the variable both as 'integer' type and 'numeric' type"?
    Like Max said, you should post a complete script that gets the incorrect results.
    Include your CREATE TABLE and INSERT statements, or use tables that are commonly available.
    For example:
    VARIABLE      v1     NUMBER
    VARIABLE      v2     NUMBER
    EXEC  :v1 := -28 * 12;
    EXEC  :v2 := -27 * 12;
    PROMPT       ===== Checking values of bind variables  =====
    SELECT       :v1
    ,       :v2
    FROM       dual;
    PROMPT       =====  Main query (expecting 1 row of output) =====
    SELECT       ename
    ,       hiredate
    FROM       scott.emp
    WHERE       hiredate     >= ADD_MONTHS (SYSDATE, :v1)
    AND       hiredate     <= ADD_MONTHS (SYSDATE, :v2)
    ;Output:
    PL/SQL procedure successfully completed.
    PL/SQL procedure successfully completed.
    ===== Checking values of bind variables  =====
           :V1        :V2
          -336       -324
    =====  Main query (expecting 1 row of output) =====
    ENAME      HIREDATE
    MILLER     23-Jan-1982

  • Please help on binding variables

    Hello,
    I need to bind the variable in following function.
    If the single deptno is passed into function, the function will return correct result. However, if the set of deptno is passed, the function cannot give correct result.
    Could anyone please help me on it...
    Thanks in advance!!!
    scott@ORA111>create or replace function my_test (p_deptno_list varchar2)
    2 return sys_refcursor
    3 as
    4 rec sys_refcursor;
    5 v_sql varchar2(1000);
    6
    7 begin
    8 v_sql := 'select * from emp where deptno in (:1)';
    9 open rec for v_sql using p_deptno_list;
    10 return rec;
    11
    12 end;
    13 /
    Function created.
    Elapsed: 00:00:00.04
    scott@ORA111>var my_rec refcursor
    scott@ORA111>execute :my_rec := my_test('10');
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.00
    scott@ORA111>print :my_rec
    EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
    7782 CLARK MANAGER 7839 09-JUN-81 2450 10
    7839 KING PRESIDENT 17-NOV-81 5000 10
    7934 MILLER CLERK 7782 23-JAN-82 1300 10
    9999 TEMP SALESMAN 7782 27-APR-09 6000 10
    Elapsed: 00:00:00.01
    scott@ORA111>var my_rec refcursor
    scott@ORA111>execute :my_rec := my_test('10, 20');
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.01
    scott@ORA111>print :my_rec
    ERROR:
    ORA-12801: error signaled in parallel query server P000
    ORA-01722: invalid number
    no rows selected
    Elapsed: 00:00:00.01

    Hello Beijing,
    Thank you so much for your help!!!
    We need a procedure/function to take the inputs as query conditions, execute the query, store the result in refer cursor and pass it into Client Application.
    With the help on this Forum, I have done following test. Only one thing that I have not figure out is the variable-list. As you know the line 15 in my procedure will not give the correct result. However, I am not able to concatenate the bind variable in the string.
    Please help, thanks again.
    SQL> create or replace function test_function
    2 (p_deptno_list varchar2,
    3 p_hire_start emp.hiredate%type,
    4 p_hire_end emp.hiredate%type,
    5 p_job emp.job%type)
    6 return sys_refcursor
    7 as
    8 rec sys_refcursor;
    9 v_sql varchar2(1000);
    10
    11 begin
    12 v_sql := 'select * from emp';
    13
    14 if p_deptno_list is not null then
    15 v_sql := v_sql ||' where instr(replace(:1, '' '', ''''), deptno) > 0';
    16 else
    17 v_sql := v_sql ||' where :1 is null';
    18 end if;
    19
    20 if p_hire_start is not null and p_hire_end is not null then
    21 v_sql := v_sql ||' and hiredate between :2 and :3';
    22 else
    23 v_sql := v_sql ||' and :2 is null and :3 is null';
    24 end if;
    25
    26
    27 if p_job is not null then
    28 v_sql := v_sql ||' and job = :4';
    29 else
    30 v_sql := v_sql ||' and :4 is null';
    31 end if;
    32
    33 open rec for v_sql using p_deptno_list, p_hire_start, p_hire_end, p_job;
    34 return rec;
    35
    36 end;
    37 /
    Function created.
    SQL> set lin 200
    SQL> var rec refcursor
    SQL> execute :rec := test_function(null, null, null, null);
    PL/SQL procedure successfully completed.
    SQL> print rec
    EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
    7369 SMITH CLERK 7902 17-DEC-80 800 20
    7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30
    7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
    7566 JONES MANAGER 7839 02-APR-81 2975 20
    7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30
    7698 BLAKE MANAGER 7839 01-MAY-81 2850 30
    7782 CLARK MANAGER 7839 09-JUN-81 3450 10
    7788 SCOTT ANALYST 7566 19-APR-87 3000 20
    7839 KING PRESIDENT 17-NOV-81 6000 10
    7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30
    7876 ADAMS CLERK 7788 23-MAY-87 1100 20
    EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
    7900 JAMES CLERK 7698 03-DEC-81 950 30
    7902 FORD ANALYST 7566 03-DEC-81 3000 20
    7934 MILLER CLERK 7782 23-JAN-82 4300 10
    14 rows selected.
    SQL> execute :rec := test_function('20, 30', null, null, null);
    PL/SQL procedure successfully completed.
    SQL> print rec
    EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
    7369 SMITH CLERK 7902 17-DEC-80 800 20
    7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30
    7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
    7566 JONES MANAGER 7839 02-APR-81 2975 20
    7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30
    7698 BLAKE MANAGER 7839 01-MAY-81 2850 30
    7788 SCOTT ANALYST 7566 19-APR-87 3000 20
    7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30
    7876 ADAMS CLERK 7788 23-MAY-87 1100 20
    7900 JAMES CLERK 7698 03-DEC-81 950 30
    7902 FORD ANALYST 7566 03-DEC-81 3000 20
    11 rows selected.
    SQL> execute :rec := test_function('20', to_date('01-JAN-1981','DD-MON-YYYY'), to_date('31-DEC-1981','DD-MON-YYYY'), null);
    PL/SQL procedure successfully completed.
    SQL> print rec
    EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
    7566 JONES MANAGER 7839 02-APR-81 2975 20
    7902 FORD ANALYST 7566 03-DEC-81 3000 20
    SQL> execute :rec := test_function('20', to_date('01-JAN-1981','DD-MON-YYYY'), to_date('31-DEC-1981','DD-MON-YYYY'), 'MANAGER');
    PL/SQL procedure successfully completed.
    SQL> print rec
    EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
    7566 JONES MANAGER 7839 02-APR-81 2975 20
    SQL> spool off

  • Help with bind variable

    I am very new to this site so I hope I get the format right...
    I am using Oracle Application Express Edition and trying to answer a question for my class, but I keep getting the same error every time. I've looked it up and it's apparently a storage error, but I don't understand how it can be a storage error if I'm not able to store it in the first place. So confused! Please help!
    Here's my code and the error I keep getting:
    DECLARE
    VARIABLE b_basic number
    VARIABLE b_pf number
    today DATE:=SYSDATE;
    tomorrow today%TYPE;
    BEGIN
    b_basic:=45;
    b_pf:=12;
    tomorrow:=today +1;
    DBMS_OUTPUT.PUT_LINE(' Hello World ');
    DBMS_OUTPUT.PUT_LINE('TODAY IS : '|| today);
    DBMS_OUTPUT.PUT_LINE('TOMORROW IS : ' || tomorrow);
    END;
    ORA-06550: line 2, column 23: PLS-00103: Encountered the symbol "NUMBER" when expecting one of the following: := . ( @ % ; not null range default character
    --------------------------------------------------------------------------------

    Don't mix SQL*Plus and PL/SQL syntax. In PL/SQL there is no VARIABLE keyword, just remove it.
    See http://docs.oracle.com/cd/E11882_01/appdev.112/e25519/fundamentals.htm#LNPLS208.
    With this:
    set echo on
    set serveroutput on
    DECLARE
    b_basic number;
    b_pf number;
    today DATE:=SYSDATE;
    tomorrow today%TYPE;
    BEGIN
    b_basic:=45;
    b_pf:=12;
    tomorrow:=today +1;
    DBMS_OUTPUT.PUT_LINE(' Hello World ');
    DBMS_OUTPUT.PUT_LINE('TODAY IS : '|| today);
    DBMS_OUTPUT.PUT_LINE('TOMORROW IS : ' || tomorrow);
    END;
    /you get with SQL*Plus command line:
    SQL> set serveroutput on
    SQL> --
    SQL> DECLARE
      2  b_basic number;
      3  b_pf number;
      4  today DATE:=SYSDATE;
      5  tomorrow today%TYPE;
      6  BEGIN
      7  b_basic:=45;
      8  b_pf:=12;
      9  tomorrow:=today +1;
    10  DBMS_OUTPUT.PUT_LINE(' Hello World ');
    11  DBMS_OUTPUT.PUT_LINE('TODAY IS : '|| today);
    12  DBMS_OUTPUT.PUT_LINE('TOMORROW IS : ' || tomorrow);
    13  END;
    14  /
    Hello World
    TODAY IS : 05-FEB-13
    TOMORROW IS : 06-FEB-13
    PL/SQL procedure successfully completed.Try to post APEX specific questions in APEX dedicated forum Oracle Application Express (APEX)
    Edited by: P. Forstmann on 5 févr. 2013 13:38
    Edited by: P. Forstmann on 5 févr. 2013 13:40

  • Dynamic view object loses bind variables after passivation

    I am creating a view object definition/view object programmatically in Jdev 11.1.1.2.0. The query requires a named bind parameter. All was working fine but now I am testing with app module pooling disabled and the bind variable is not being restored after passivation -- it's like the definition has disappeared or something.
    Here is my VO creation code:
    ViewObject vo = findViewObject("FinalistsWithEvalDataVO");
    if (vo != null){
    vo.remove();
    ViewDefImpl voDef = new ViewDefImpl("FinalistsWithEvalDataVODef");
         // I add a bunch of viewAttrs here...
    voDef.setQuery(fullQuery);
    voDef.setFullSql(true);
    voDef.setBindingStyle(SQLBuilder.BINDING_STYLE_ORACLE_NAME);
    voDef.resolveDefObject();
    voDef.registerDefObject();
    vo = createViewObject("FinalistsWithEvalDataVO", voDef);
    vo.defineNamedWhereClauseParam("Bind_SchlrAyId", null, new int[] {0});
    vo.setNamedWhereClauseParam("Bind_SchlrAyId", new Number(1)); //For testing
    vo.executeQuery();
    The query executes fine right there and then the VO seems to passivate fine. I even see the bind var in passivation:
    <exArgs count="1">
    <arg name="Bind_SchlrAyId" type="oracle.jbo.domain.Number">
    <![CDATA[1]]>
    </arg>
    </exArgs>
    But then when it reactivates prior to rendering the page, it invariably throws a missing parameter exception and this in the log:
    <ViewUsageHelper><createViewAttributeDefImpls> [7409] *** createViewAttributeDefImpls: oracle.jdbc.driver.OraclePreparedStatementWrapper@1af78e1
    <ViewUsageHelper><createViewAttributeDefImpls> [7410] Bind params for ViewObject: [FinalistsWithEvalDataVO]AwardViewingServiceAM.FinalistsWithEvalDataVO
    <ViewUsageHelper><createViewAttributeDefImpls> [7411] ViewUsageHelper.createViewAttributeDefImpls failed...
    <ViewUsageHelper><createViewAttributeDefImpls> [7412] java.sql.SQLException: Missing IN or OUT parameter at index:: 1
    I have worked on this for hours and can't see anything wrong. Like I said, it works fine when not forcing passivation...
    Any help would be appreciated.
    Thanks.
    -Ed

    @Jobinesh - Thanks for the suggestions. I have read all the documentation I can find. Everything works fine without passivation. Everything still breaks with passivation. I have given up on trying to get the bind variable to restore after passivation and am currently just building the query with all values embedded in the query rather than bind variables. This is bad practice but avoids the problem. However, now that I avoided that obstacle, I'm on to the next issue with passivation of this dynamic view object, which is that the current row primary key apparently cannot be reset after activation. I get the following error:
    <Key><parseBytes> [7244] Key(String, AttributeDef[]): Invalid Key String found. AttributeCount:1 does not match Key attributes
    <DCBindingContainer><reportException> [7254] oracle.jbo.InvalidParamException: JBO-25006: Value 00010000000A30303033383133343734 passed as parameter String to method Constructor:Key is invalid: {3}.
         at oracle.jbo.Key.parseBytes(Key.java:537)
         at oracle.jbo.Key.<init>(Key.java:179)
         at oracle.jbo.server.IteratorStateHolder.getCurrentRowKey(IteratorStateHolder.java:34)
         at oracle.jbo.server.ViewRowSetIteratorImpl.activateIteratorState(ViewRowSetIteratorImpl.java:3877)
    I've been trying various workarounds for over a day now with no luck. Very frustrating.
    Thanks for trying to help.
    -Ed

  • How to update bind variable and restrict values in a Model Driven LOV?

    Hi Guys,
    Using JDev 11.1.1.2.0
    I've recreated an excellent Frank Nimphius article about restricting values derived from a model driven LOV (http://www.oracle.com/technetwork/developer-tools/adf/learnmore/44-restrict-lov-169186.pdf)
    But my bind variable isn't updating. Deleting the bind variable gets me the entire LOV. Activate the code below and insert a bind variable into the where clause like Frank says and I get nothing back. Bind variable is blank. Any ideas? Code wasn't supplied with the article. It seems simple enough but the bind variable isn't updating in the SQL, even though the updated value shows up here...
      public void onLovLaunch(LaunchPopupEvent launchPopupEvent)
        BindingContext bctx = BindingContext.getCurrent();
        BindingContainer bindings = bctx.getCurrentBindingsEntry();
        FacesCtrlLOVBinding lov = (FacesCtrlLOVBinding)bindings.get("DepartmentId");
        lov.getListIterBinding().getViewObject().setNamedWhereClauseParam("deptId","60");
        System.out.println("lov name: " + lov.getName().toString());
        System.out.println("lov Param Attrs: " + lov.getListIterBinding().getViewObject().getNamedWhereClauseParams().getAttribute("deptId").toString());
        System.out.println("lov View Object: " + lov.getListIterBinding().getViewObject().getName().toString());
        System.out.println("lov IterBinding: " + lov.getListIterBinding().getName().toString());
       }Gets me ...
    lov name: DepartmentId
    lov Param Attrs: 60
    lov View Object: _LOCAL_VIEW_USAGE_lov_model_queries_EmployeesView_DepartmentsView
    lov IterBinding: DepartmentIdList_2

    That's a good idea, but it's still not working. Here is how I implemented it. It might be different from your suggestion as I'm still pretty new to this.
    I have a recursive tree table. You select a node. You then click a button which calls the listener below. "findParents" is a method call to the AppModuleImpl class and it finds all parent nodes of your selection. "restrictPartBomLOV", also of the AppModuleImpl class, then modifies the model driven lists' View Object (partBomLOV) to exclude those parent node values.
    The resulting model driven LOV on the popup should be updated, yeah? But it still isn't udpating. If I manually type in the updated Where clause in PartBomLOV.xml query tab, it works, but it doesn't programmatically.
      public void insertPopupFetchListener(PopupFetchEvent popupFetchEvent)
        BindingContainer bindings = getBindings();
        OperationBinding operationBinding = bindings.getOperationBinding("findParents");
        parents = (List)operationBinding.execute();
        operationBinding = bindings.getOperationBinding("restrictPartBomLOV");
        operationBinding.execute();
       public void restrictPartBomLOV(List parents)
          ViewObjectImpl vo = getPartBomLOV();
          String wcl = "";
          Object[]   p = parents.toArray();
          for(int i = 0; i < p.length; i++)
             if (i == 0)
                wcl = wcl + "PNUM <> '" + p.toString() + "'";
    else
    wcl = wcl + "AND PNUM <> '" + p[i].toString() + "'";
    vo.setWhereClause(wcl);
    System.out.println(vo.getWhereClause().toString());
    vo.executeQuery();
    Edited by: LovettWB on Nov 11, 2010 11:23 PM

  • Bind Variable Not Being Reset

    I am using JDeveloper 11.1.1.2 and ADF with BC. I have the following situation:
    I have a view object whose where clause has multiple bind variables. On one of my pages, I dragged this view object as a form onto the page. I also dragged the ExecuteWithParams method for this view object onto my page as a command button. I dynamically set the bind variables for this action via EL-based NamedData elements. When I click the button, the query is run with the bind variables I specify. Everything looks great.
    On another page, I am programmatically setting one of the bind variables (let's call it bv1) for the same view object and then navigating to the page described above. The data displays fine. However, when I try to use the command button (ExecuteWithParams) with a different value for bv1, the query continues to use the value that I set programmatically.
    It seems like the bind variable value set programmatically (using vo.setNamedWhereClauseParam) always trumps the one that gets set using the NamedData element in ExecuteWithParams. Why doesn't this value get reset with the value from the NamedData element?
    Thanks,
    Brad

    hi Brad
    ... It seems as if once the bind variable gets set on the view object programatically, the corresponding parameter in ExecuteWithParams does not overwrite it. ...Looks similar to the behaviour I describe in forum thread forum thread "10g versus 11g : bind variable issue"
    at 10g versus 11g : bind variable issue
    regards
    Jan Vervecken

  • White spaces in bind variables

    While calling a Report(based on sql with a bind variable) from a Form and passing a value with white space to the bind variable gives the following error:-
    Error: An unexpected error occurred: ORA-06502: PL/SQL: numeric or value error (WWV-16016)
    Also, attempting to translate white spaces is not helpful for bind variable.
    Any help would be appreciated.
    Thanks,
    Gopi.

    Thanks for you replay Reddi,
      Let me explain the scenario: The scenario is RFC --> XI  --> JDBC, one of the element of the FM sometimes could be have the value "      ", when this occurrs in the SXMB_MONI TC I see the value null in the element, that is the tag is <Element />, in this case I need to preserve this white space in the element. The message could be something like this:
    <root>
      <element1>value 1</element1>
      <element2>value 2</element2>
      <element3>      </element3>
    </root> 
    but I see the message in this form:
    <root>
      <element1>value 1</element1>
      <element2>value 2</element2>
      <element3 />
    </root>
    In the message mapping tool I assign the string value "      " and the problem still the same.
      Any Idea?

  • Error with concurrent users- Activation Passivation Bind variable ?

    I have a programmatic view object based on procedure call that returns a ref cursor.
    Application Module has a function that exposes get Method for this View object using client interface.
    Everything works good until many users call the same Method ,for many concurrent users i got the below error intermittently :
    JBO-27122: SQL error during statement preparation.
    Attempt to set a parameter name that does not occur in the SQL: bussId
    For 1 or 2 users this works perfectly fine.
    bussId is a bind variable defined at View object of type Array.
    I understand this should be because of activation/passivation as many users calling same function comes to picture.
    To solve this I overloaded activateState/passivateState in View implementation for the bind var.
    But i don't see those methods getting invoked ever.
    I also enabled connection pool/AM pool and kept the default pool values high enough for concurrent users.
    Nothing works .
    Appreciate any help in this regard.
    -Sam

    Hi,
    See
    http://antonis-antoniou.blogspot.com/2012/02/ensuring-that-your-adf-application-is.html

  • How to get binding variables from request

    We are trying to use html-db to develop an application which need to get values from user request to use in the queries, i.e. we will have pages depend on several binding variables and the value of these variables will be provided by the user through get/post request. Because the request will be initialed by another application so to use a form to collect the values is not an option.
    I am a html-db newbie. Does anyone here know how to do that?

    you're right in thinking this is a bit of a newbie html db question. it's a pretty straightforward matter to set up a report in html db that runs off of bind variables that can be set from a URL. you can see a pretty simple example on the first page of our "Sample Application" that's available to install into your workspace. try taking a look at that to see what i mean. you can install the Sample Application by clicking the "Review Demonstration Applications" link that's available right after logging into htmldb.oracle.com. that resulting screen lets you create (or re-create) the Sample App in your workspace. once it's installed, take a look at how the report on page 1 calls the first report on page 201. that report on 201 is dependent on a bind variable, :P202_CATEGORY, that's set from the URL. this particular URL is generated from the report on page 1, but it could just as easily have been generated from your other application. when you look at this example, the two key points to pay attention to are the 1) syntax used in the URL to set the bind variable (which is explained in our online help at http://htmldb.oracle.com/i/doc/mvl_fund005.htm#sthref357) and 2)the way in which that bind variable is referenced in the first sql query region on page 201. take a look at those when you get a chance, and let us know if you have further questions.
    thanks,
    raj

  • Get bind variables of a dynamic view object

    I seem unable to retrieve the bind variables for a dynamically created view object, even though I can do the same thing for a regular view object.
    Here is the code:
    newVO = repServ.createViewObjectFromQueryStmt("newQry",strSql);
    VariableValueManager vvm = newVO.ensureVariableManager();
    if (vvm != null)
    Variable vars[] = vvm.getVariables();
    vars will be empty, even though the sql statement in strSql has bind variables in it.
    Is there any way to determine the bind variables of a dynamic view object?
    Thanks!

    I got the same problem as yours and still could not find any way out.
    However, as I can see, you wanted to get VariableValueManager of newly created ViewObject that may be not available at this moment.
    If you find way to solve the problem, please help.
    Cheer,
    MinhTran

  • Getting error 025036 while setting bind variable value

    Hi,
    I have created a view object (ViewObj) having bind variable (Bind_Val).
    I am writing custom java method in AppModuleImpl.java, so that I can use that in serviceInterface.
    my method is:
    public void Met(String a){
    ViewObjImpl vo=new ViewObjImpl();
    vo.setBind_Val(a);
    I tried the below method also:
    public void Met(String a){
    ViewObjectImpl vo=new ViewObjectImpl();
    vo.setNamedWhereClauseParam("Bind_Val",a)
    But when I am running the AppModuleServiceImpl.java and select the Met method and pass the value for a. It is giving me error 02036.
    How to set the bind variable value in AppModuleImpl.java??
    Thanks,
    Rohit

    Hi Frank,
    Thanks for reply. It was helpful.
    Please go through the below mentioned two queries.
    My sql query is:
    SELECT Message.MESSAGE_ID,
    MessageProp.VALUE,
    MessageProp.MSG_PROP_ID
    FROM MESSAGE Message, MESSAGE_PROP MessageProp
    WHERE (MessageProp.Key='From' OR MessageProp.Key='To')AND Message.MESSAGE_ID = MessageProp.MESSAGE_ID And MessageProp.Value='B'
    and I have created one view criteria where I am giving the condition as MessageId=:Bind_MessageId.
    And then I am executing my findViewCriteria method from AppModuleServiceImpl where I am passing the value for Bind_MessageId and I am getting the output as I want.
    Now I am modifying my query as:
    SELECT Message.MESSAGE_ID,
    MessageProp.VALUE,
    MessageProp.MSG_PROP_ID
    FROM MESSAGE Message, MESSAGE_PROP MessageProp
    WHERE (MessageProp.Key='From' OR MessageProp.Key='To')AND Message.MESSAGE_ID = MessageProp.MESSAGE_ID And MessageProp.Value=:Bind_Value
    and setting the value for :Bind_Value programatically as:
    public void test(String s){
    ViewObjectImpl view = this.getViewObj1();
    VariableValueManager vm = view.ensureVariableManager();
    vm.setVariableValue("Bind_Value",s);
    **Note- I have written this custom method in AppModuleImpl.java class
    Then firstly I am executing test method from AppModuleServiceImpl to set the value for :Bind_Value. After that I am executing findViewCriteria method but then I am not getting any record.
    **Note-I am not getting any error.
    I want to set Bind_Value programatically and then I want to execute my FindViewCriteria from serviceInterface.
    Thanks,
    Rohit

Maybe you are looking for

  • How to load a .class file dynamically?

    Hello World ;) Does anyone know, how I can create an object of a class, that was compiled during the runtime? The facts: - The user puts a grammar in. Saved to file. ANTLR generates Scanner and Parser (Java Code .java) - I compile these file, so XYSc

  • Isradobeform iview

    Hi,      The Adobe forms are technically part of the Web Dynpro application IsrForm in the Development Component (DC) ISR from the Software Component PCUI_GP. If you want to use custom scenarios with Adobe forms in your Enterprise Portal, you need to

  • Shipment cost not added to material

    hello Gurus In inbound Transportation, shipment cost is not getting loaded to material cost while doing PGR... Pls Help Rgds

  • HT1338 How do I eject a dvd that may have been put in upside down by my toddler?

    How do I manually eject a DVD. It may have been put in upside down.

  • LiveCycle Designer 7, Display Pattern not working

    With Adobe LiveCycle Designer version 7.1.2295.1.242059: I have a Form that has fields that the user fills out and an "Email Submit Button" where when the user clicks it, it submits the form via email that attaches a .xml file. When I receive the ema