Use ? style Parameter for View Object

I'm guess that if you set the ViewObject to use ? style parameter. You have to use the whereclause to pass in the parameter, correct? If so then how do you pass in parameter (use input) to the whereclause in a jsp page?

Never mind I was trying to set the whereclause in the tag, whereclause="application_id=<%=appId%>".

Similar Messages

  • How to use bind parameter in view object

    in my view object has parameter as below
    where :organization_id IS NULL
    :organization_id parameter get value from LOV
    I can run the page but it show following error :
    oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT * FROM (SELECT hou.name organization_name
    ,hapf.name position_name
    ,hapf.attribute1 position_fund
    ,pg.name grade_name
    ,pbd.budget_detail_id
    ,hapf.position_id
    ,pbd.budget_version_id pbd_budget_version_id
    ,pbv.budget_version_id pbv_budget_version_id
    ,'Y' VIEW_DETAIL
    ,'Y' VIEW_DETAIL_OCC
    ,greatest(hapf.effective_start_date, pbv.date_from) effective_date
    FROM pqh_budget_details pbd
    ,hr_all_positions_f hapf
    ,hr_all_organization_units hou
    ,per_grades pg
    ,pqh_budget_versions pbv
    WHERE pbd.budget_version_id = pbv.budget_version_id
    AND pbd.position_id = hapf.position_id
    AND hapf.effective_end_date = hr_general.end_of_time
    AND hou.organization_id = hapf.organization_id
    AND pg.grade_id = hapf.entry_grade_id
    AND EXISTS (
    SELECT 'X'
    FROM hr_all_positions_f hapf1
    WHERE hapf1.position_id = hapf.position_id
    AND hapf1.availability_status_id = 1
    AND (pbv.date_from BETWEEN hapf1.effective_Start_date AND hapf1.effective_end_date
                        OR
                   hapf1.effective_Start_date BETWEEN pbv.date_from AND pbv.date_to))
    and :gl_organization = 10)
    ## Detail 0 ##
    java.sql.SQLException: ORA-01008: not all variables bound
    Thank you very much

    Is it a seeded view or a custom view? Ideally, in OAF you do parameter binding in the style
    organization_id = :1
    Also make sure to call setWhereClauseParams(null) on your view object before going for binding.
    --Shiv                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to build sql query for view object at run time

    Hi,
    I have a LOV on my form that is created from a view object.
    View object is read-only and is created from a SQL query.
    SQL query consists of few input parameters and table joins.
    My scenario is such that if input parameters are passed, i have to join extra tables, otherwise, only one table can fetch the results I need.
    Can anyone please suggest, how I can solve this? I want to build the query for view object at run time based on the values passed to input parameters.
    Thanks
    Srikanth Addanki

    As I understand you want to change the query at run time.
    If this is what you want, you can use setQuery Method then use executeQuery.
    http://download.oracle.com/docs/cd/B14099_19/web.1012/b14022/oracle/jbo/server/ViewObjectImpl.html#setQuery_java_lang_String_

  • Using a parameter for a table name?

    In SQL Server, can you use a parameter for a table name?  I'm working with Visual C# and want to do something like this:
    SELECT MAX(ItemID) FROM @TableName;
    Can this be done?
    (Basically, I have three separate methods within a class--one for each table I have; and each one will perform the above query but on different table names.  I'd like to see if there is a way that I can have just one method that will allow me to specify
    the table name.)

    As pointed out in other posts, you can. But a more relevant question is whether you should.
    A table in a relational database is supposed to model a unique entity, and each column in the table is supposed to model a unique attribute. This is not always how it is, but it is from this model a relational database is designed.
    From this angle, having a dynamic table name does not really make sense for application code. (Administrative actions is a different story.) Think of it this way: have you ever wanted to make the class name dynamic in C#?
    Admittedly, it is different in .NET, because everything inherits from System.Object, but in a relational database there is no inheritence.
    Anyway, if you are using stored procedures, you should have one stored procedure per table. Physically, in the plan cache, there will be one query plan per table, no matter how you do it.
    If you are submitting SQL statements from your application, it is a different matter. In this case, I find it difficult to object if you have a class that performs generic actions against tables. Then you build the SQL string in the client code.
    However, no matter how you do it, you need to be careful to avoid SQL injection. We had the example:
    DECLARE @TableName nvarchar(50),@sqlCommand nvarchar(max)
      SET @TableName = ' ItemInformation'
      SET @sqlCommand = 'SELECT MAX(ItemID) FROM ' + @TableName
    EXEC (@sqlCommand)
    But what if we have:
      SET @TableName = ' sys.objects; SHUTDOWN WITH NOWAIT; --'
    As long as we do it in T-SQL, we can (and we should do!) this to prevent SQL injection:
      SET @sqlCommand = 'SELECT MAX(ItemID) FROM ' + quotename(@TableName)
    If you build your SQL strings in C#, you will need to employ other checks. There is only an issue if the user can inject data somewhere, but your generic class will not have knowledge of this, and must assume the worst.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Can I have separate Style Formatting for viewing and sending emails?

    Hey All
    I was just wondering if it was possible to have separate style settings for viewing emails sent to you and sending emails to others.
    Basically I want to set up a kind of style template for all my outgoing emails but I don't necessarily want my incoming mail to be like that if you see where I am coming from.
    Any help would be greatly appreciated.
    Thanks
    Derek

    Thanks for that.
    That would certainly be an option. However after some further investigation I came across this article which shows me exactly what I was looking for:
    http://www.apple.com/pro/tips/mail_templates.html
    But thanks for your help though. It is really appreciated.
    Derek

  • Is it good idea to use style sheet for the bgcolor of a table that is just

    is it good idea to use style sheet for the bgcolor of a table that is just being used for formatting

    Hi,
    CSS is a way to do so. I don't think that there is any problem with using CSS on any kind of table
    Frank

  • Using JDBC ? Style Parameters and Oracle Style :param on view objects

    can i use :0 style on predicate side of a sql statement
    example
    ===========================================================
    select nvl(:0, null) from dual
    ===========================================================
    After some test for me only work using ? style.
    The ? style cause me problem on my already creaded master details view objects
    Any help on this
    Best Regards

    Frank tnx for repply
    My problems is , when i use parameters on functions like decode
    ===================================================
    SELECT decode(:0,'VALOR1', 'VALOR1','SINVALOR') VALOR,
           Dept.DEPTNO,
    FROM DEPT Dept
    and
    SELECT decode(:0,'VALOR1', 'VALOR1','SINVALOR') VALOR,
           Emp.EMPNO,
           Emp.DEPTNO
    FROM EMP Emp===================================================
    on a view object that is detail view object (departments vo -> employees vo)
    and have a view link EmpsByDeptViewLink
    the parameter of my view link SQL dont work (in my case :1) <-param of SQL view link
    In my vo :0 is my first parameter, :1 of my view link is my second parameter,
    but when i access my EmpsByDept.do ADF page and set
        ViewObject vo = getDeptView1();
        vo.setWhereClause("DEPTNO = :0");
        vo.setWhereClauseParam(0,"VALOR2");
        vo.setWhereClauseParam(1,"10");
        vo.executeQuery();
        ViewObject vo1 = getEmpView1();
        vo1.setWhereClause("EMPNO = :1");
        vo1.setWhereClauseParam(0,"VALOR1");
        vo1.executeQuery();its doesnot work.
    I need to do some aditional steps to parameter of my view link SQL work?
    Also i has uploaded a TestCase on http://www.geocities.com/mroseroc/ScottADFTest.zip
    Errors from my Jdeveloper Debug level are:
    =======================================================
    SELECT * FROM (SELECT decode(:0,'VALOR1', 'VALOR1','SINVALOR') VALOR,
           Emp.EMPNO,
           Emp.ENAME,
           Emp.JOB,
           Emp.MGR,
           Emp.HIREDATE,
           Emp.SAL,
           Emp.COMM,
           Emp.DEPTNO
    FROM EMP Emp) QRSLT  WHERE (EMPNO = :1)
    06/04/26 21:55:03 [915] Bind params for ViewObject: EmpView1
    06/04/26 21:55:03 [916] Binding param 1: VALOR1
    06/04/26 21:55:03 [917] ViewObject: EmpView1 close single-use prepared tatements
    06/04/26 21:55:03 [918] QueryCollection.executeQuery failed...
    06/04/26 21:55:03 [919] java.sql.SQLException: Missing parameter IN o OUT on index:: 2=======================================================
    (EMPNO = :1) <- this value is never passed

  • Using user parameter for

    Hello,
    I have created a report using an xml pds. I am using a servlet for the xml data stream source. Everything works great with the url to the servlet hard-coded between the <xml></xml> tags (ex. <xml>http://10.3.35.119:9004/ssapp/servlet/ScheduleDataServlet</xml>) but when I try using a user parameter between the tags (so I will be able to dynamically change the url to this servlet) it bombs. Please see my source code and error message below. Any help would be greatly appreciated, I've been stuck on this for days! Thanks!
    <rw:report id="recoveryCenterScheduleReport" parameters="server=myreportserver&userid=ssstage/ssstage@DEVL&p_xmlDataURL=http://10.3.35.119:9004/ssapp/servlet/ScheduleDataServlet">
    <rw:objects id="objects">
    <?xml version="1.0" encoding="WINDOWS-1252" ?>
    <report name="XMLscheduleReport" DTDVersion="9.0.2.0.0">
    <xmlSettings xmlTag="XMLSCHEDULEREPORT" xmlPrologType="text">
    <![CDATA[<?xml version="1.0" encoding="&Encoding"?>]]>
    </xmlSettings>
    <data>
    <userParameter name="XML_HTTPS" datatype="character"
    pluginClass="oracle.reports.plugin.datasource.xmlpds.XMLDataSourceFactory"
    width="255" defaultWidth="0" defaultHeight="0" display="no"/>
    <userParameter name="p_xmlDataURL" datatype="character" width="100"
    precision="10" defaultWidth="0" defaultHeight="0"/>
    <dataSource name="QP_1">
    <plugin
    factoryClass="oracle.reports.plugin.datasource.xmlpds.XMLDataSourceFactory"
    majorVersionNumber="1" minorVersionNumber="2"
    signOnParameter="XML_HTTPS">
    <![CDATA[<xmlpds DTDVersion=" 1.0">
    <dtd>null</dtd>
    <schema>file:///C:/Practic Workspace/Practice/WEB-INF/xsd/scheduleReport.xsd</schema>
    <XSQLschema>null</XSQLschema>
    <XSQLWithDTD>false</XSQLWithDTD>
    <type>false</type>
    <xmlWritten>true</xmlWritten>
    <validate>true</validate>
    <xml>&<[b]p_xmlDataURL></xml>
    <xsl>null</xsl>
    javax.servlet.jsp.JspException: rwlib-1: REP-0002: Unable to retrieve a string from the report builder message file.
    REP-0069: Internal error
    XMLPDS-63004:Generic error while parsing the URL stream name instead of <.
    REP-4111: Fail to create pluggable data source 'QP_1'
         at oracle.reports.jsp.ObjectsTag.doEndTag(ObjectsTag.java:180)
         at jsp.reports._schedule._XMLscheduleReport._jspService(_XMLscheduleReport.java:87)
    ....

    Never mind, I discovered the problem. I wasn't using the necessary xml escape characters for the user parameter embedded in the xml.

  • ADF BC connection to SQL Server with parameterized variable for View Object

    Hi everyone
    I'm developing a BPM Application using Oracle BPM 11.1.1.5.0 and JDeveloper 11.1.1.5.0
    Following the thread from the link below, since this is a new topic, I decided to open a new thread.
    Re: ADF method call to fetch data from DB before the initiator page loads
    what I'm trying to do is to get a record from a database and show it to the user on the initiator UI using ADF BC and not the Database Adapter.
    I have been able to work with ADF BC and View Objects to get all the rows and show them to the user in a table.
    However, when I try to run the same query in the parameterized form to just return a single row, I hit a wall.
    In short, My problem is like this:
    I have an Application Module which has an entity object and a view object.
    My database is SQL Server 2008.
    when I try to create a new read only view object to return a single row I face the problem.
    The query I have in the query section of my View Object is like this:
    select *
    from dbo.Employee
    where EmployeeCode= 99which works fine.
    However when I define a bind variable, input_code for example, and change the query to the following it won't validate.
    select *
    from dbo.Employee
    where EmployeeCode= :input_codeIt just keeps saying
    >
    incorrect syntax near ":"
    >
    I don't know if this has to do with my DB not being Oracle or I'm doing something wrong.
    Can someone help me with this problem please?
    thanks in advance

    Hi
    This all seems complicated to me so I think my simplest way would be to use the java code in the aformentioned thread by Sudipto:
    public String getUserLogin() throws WorkflowException,
    BPMIdentityException,
    BPMUnsupportedAttributeException {
    String userId = "";
    IWorkflowServiceClient wfSvcClient;
    ITaskQueryService queryService;
    IWorkflowContext wfContext;
    // Get username of User Login
    String contextStr = ADFWorklistBeanUtil.getWorklistContextId();
    wfSvcClient = WorkflowService.getWorkflowServiceClient();
    queryService = wfSvcClient.getTaskQueryService();
    wfContext = queryService.getWorkflowContext(contextStr);
    userId = wfContext.getUser();
    return userId;
    } I don't know where and how I should put the code to be called when the view object loads though.
    I have created a class in the java class section of my view object which has two methods related to the bind variable input_empCode:
    getinput_empcode and setinput_empcode , as expected.
    however any code i try to put in those two would not be called at all!
    for example:
        public Integer getinput_empCode() {
            //return (Integer)getNamedWhereClauseParam("input_empCode");
            return 1444;
        }and
        public void setinput_empCode(Integer value) {
            //setNamedWhereClauseParam("input_empCode", value);
            setNamedWhereClauseParam("input_empCode", 666);
        }It just keeps filled with the values in the bind variable section.
    I don't know what I'm doing wrong here.
    would you show me the way?
    Thanks again

  • Questions about using Styles Window for formatting a book in Apple Works.

    Help says "You can create your own styles in any document type." Not clear on how to do that.
    I wish to have one Style or group of Styles associated with one document of say 500 pages for a book. Each chapter Heading. as a single column layout, is separated by Section Breaks from previous and following text in 2 column layout.
    Question 1. How do I make Styles window settings (Edit/Done) specific for this entire document? Can I edit settings in Styles window and have them remain specific and locked to this particular document? Or are the Styles window settings constant across all documents?
    Question 2. (If Styles window settings are not specific and locked to this document) Do I need to make a NEW Style for each purpose within the document, as in Book Heading, Book Subheading, Book Body, Book special paragraph style, and etc.
    Question 3. When importing multiple sections of the work (by copy and paste) from other AW documents how can I have the imported text follow the book’s Style settings (and vice versa how to keep tab settings that are specific in some areas). Sometimes the imported work refuses to conform to the Book document’s style say line spacing for instance.
    Thank you
    Hilary Fish
    iBook G4 Mac OS X (10.4.8) AppleWorks 6.2.9

    Hi Hilary,
    I haven't used styles enough to give definitive answers to your questions, but I'm sure others will join in and correct any errors in what follows.
    A "Style" is essentially a set of paragraph level format settings that can be collectively applied to a paragraph or contiguous set of paragraphs as a set, rather than having to apply each attribute individually. Once a style is applied to various parts of a document, changes made to the style specification will apply to every part of the document to which that style has been applied.
    AppleWorks also includes two other types of Styles—Outline styles (Diamond, Harvard and Legal), used to identify hierarchical levels of paragraphs, and Table styles, used to format tables.
    Question 1: From the Help article "Using Styles":
    You can copy the collection of all the styles available in a document and make them available in another document. This is called exporting and importing a stylesheet.
    I read this as saying that styles you create are specific to the document in which they are created, but may be exported to other documents. "Other documents" would includes documents saved as templates, which could be used to create the various sections of a book.
    Question 2:
    As the set of styles is specific to the document it is created in (or into which it is imported), you can probably leave "Book " off the names of the styles (but may decide that leaving it on makes it easier to know what the styles are for). You will need to use an existing style or create a new one for each purpose within the document.
    Question 3:
    Copy copies the text AND formatting of the selected material.
    Paste pastes the text AND formatting of the selected material.
    Paste also inserts the pasted material into the target document at the insertion point. All of the pasted material goes into the same Section. If the pasted material includes a section break, then a new section will be created in the target document.
    If you export the set of styles from the master document and apply them to the parts of the source document before transferring the material to the master document, I suspect the formatting will be carried over.
    Another possibility is to leave the source document with no formatting at all beyond paragraph breaks, and to apply the formatting (styles) after transferring the text.
    Regards,
    Barry

  • How to  Use page parameter for 2 grids

    Hi All,
    I have 2 grids for 2 different DB's in a report.In this page view have business dim, user able to choose the
    business.So i'm using 2 prompts for 2 grids in business dim at page view.but user wants only once he gave the
    input.How to pass one grid page parameters to another grid?
    Plzzzz give any suggestions on this................
    Thanks

    Instead of using prompts and the page, you can put the selectable dimension onto the POV of both grids and set it to current user pov on both grids.
    This way it will work, but the drawback is that you cannot make user select multiple members for that dimension, which is possible with prompts.
    hope this helps
    Bulent

  • How to use a loop for a object

    Hi, All
    I have a procedure that needs a collection to pass in. The pass_in collection has multiple records with multiple fields, so I guess I need a loop for each record.
    How to assign each record of multiple fields to each corresponding local variables?
    Thanks In advance
    T_Object is a table object
    T_ProfileInfo is a collection
    procedure P_Updateprofile(UserId in number, NewProfileInfo in T_ProfileInfo) as
    V_B_ID number;
    V_A_ID number;
    V_Profile      T_ProfileInfo;     
    begin
         V_Profile := NewProfileInfo;
         --use the loop for each records
    FORALL i IN V_Profile.FIRST..V_Profile.LAST
    -- assign each value to the local variables
    -- I got error here. ideally I want to assign each record to the local variables
         select B_ID, A_ID
         into V_B_ID, V_A_ID
         from table(V_Profile(i));
         -- insert the record into the table
         INSERT INTO PROFILE
         VALUES (UserId, V_B_ID, V_A_ID);
         commit;
    end;

    You don't say which version of the database you are using. Oracle extended the collections functionality in 9.2....
    Cheers, APC
    SQL> CREATE OR REPLACE PACKAGE t1_utl AS
      2      TYPE rt_t1 IS TABLE OF t1%ROWTYPE;
      3      FUNCTION gen_t1 (p1 IN NUMBER) RETURN rt_t1;
      4      PROCEDURE pop_t1 (t1rows IN rt_t1);
      5  END t1_utl;
      6  /
    Package created.
    SQL> CREATE OR REPLACE PACKAGE BODY t1_utl AS
      2      FUNCTION gen_t1 (p1 IN NUMBER) RETURN rt_t1
      3      IS 
      4          CURSOR cur (pn NUMBER) IS
      5              SELECT a12.NEXTVAL, col1, col2, rownum AS rn, substr(col3,30), sysdate
      6              FROM t2
      7              WHERE rownum <= pn;
      8          return_value rt_t1;
      9      BEGIN
    10          OPEN cur(p1);
    11          LOOP
    12              FETCH cur BULK COLLECT INTO return_value LIMIT 100;
    13              EXIT WHEN cur%NOTFOUND;
    14          END LOOP;
    15          RETURN return_value;
    16      END gen_t1;
    17      PROCEDURE pop_t1 (t1rows IN rt_t1) IS
    18      BEGIN
    19          FORALL indx IN t1rows.FIRST .. t1rows.LAST
    20              INSERT INTO t1
    21                VALUES t1rows (indx);
    22      END pop_t1;
    23  END t1_utl;
    24  /
    Package body created.
    SQL> SELECT * FROM t1
      2  /
    no rows selected
    SQL> DECLARE
      2      x t1_utl.rt_t1;
      3  BEGIN
      4      x := t1_utl.gen_t1(2);
      5      t1_utl.pop_t1(x);
      6  END;
      7  /
    PL/SQL procedure successfully completed.
    SQL> SELECT * FROM t1
      2  /
          COL1       COL2       COL3       COL4 COLA
    COLD
            56     165765      87979          1
    11-AUG-04
            57       3128    8217220          2
    11-AUG-04
    SQL>

  • Modifying where clauses for View Objects in Backing Beans

    In studying the RichTable class I saw no get/set methods that would allow me to manipulate the underlying view instance and rowset for the table in the Backing Bean. I know there is a way to do it, but I having great difficulty in finding it. The tutorials show how to build view objects and display them, but I haven't seen a tutorial that show how to respond to events from the Web page and directly change the data model and what is displayed via the backing bean.
    Can some one point to a tutorial or give me an example on how I can change a view object via a backing bean?

    What you want to do is add a method to your View Object Implementation class that changes the WHERE clause with setWhereClause or addWhereClause. Expose the method to your client. Then call the method from your page by binding it to a commandButton or commandLink. You can bind it through a pageDef file or a backing bean.

  • ADF Passing Parameter to View Object

    I created a view object that has, as part of it's where clause, ":1 = field". :1 can also be replaced with ?. I added this Object to my AppModule and was wondering how to bind that value from a "web tier" object. (I'm new to the "whizzy wig" development, maybe this isn't possible) thanks for any help
    -Alan

    Check out the following posting on my blog.
    http://radio.weblogs.com/0129487/2003/10/06.html#a3
    raghu
    JDev Team

  • How do i filter the records in analytic view by using variable/parameter for a time range

    i have a analytic view which has a output column as date type. i want the user who use this view have the control to decided the output records based on a time range (from x to y).
    i tried to create 2 variables, 1 for start_time, 1 for end_time. Ideally, i should have a expression for filtering data like this:
    $$start_time <= date_column <= $$end_time
    However, the variable windows doesn't seem to be feasible for the expression as above.
    Does anyone has the same problem and get it solved?
    Thanks!

    just figured out by my own. So the answer is using "variable" with "range" option.
    Making a variable, then set the "selection type" to "range".
    When preview the data, the variable input window pops up with operator on default "equal", use dropdown list to swtich it to "between", then you can enter the start_time and end_time as a range filter.

Maybe you are looking for