[SOLVED] Bind Variables

How to set a value to bind variable? Yes we can use it by executewithparameters method, but i wanna use it to set a value myself in bean code. Please help,
Thank you.
Message was edited by:
Mucahid Uslu
Message was edited by:
Mucahid Uslu

yes adf bc+jsf
Some of code is here ;
you can see to call method at
<af:commandButton action="#{BeanEnv.getMyEnv}"
below..
<?xml version='1.0' encoding='windows-1254'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
xmlns:afh="http://xmlns.oracle.com/adf/faces/html">
<jsp:directive.page contentType="text/html;charset=windows-1254"/>
<f:view>
<af:document>
<af:messages/>
<af:form id="myForm">
<af:pageTemplate viewId="oracle/templates/threeColumnTemplate.jspx">
<f:facet name="center">
<af:panelFormLayout>
<af:panelLabelAndMessage label="#{bindings.EnvId.hints.label}">
<af:outputText value="#{bindings.EnvId.inputValue}">
<af:convertNumber groupingUsed="false"
pattern="#{bindings.EnvId.format}"/>
</af:outputText>
</af:panelLabelAndMessage>
<af:panelLabelAndMessage label="#{bindings.DbSid.hints.label}">
<af:outputText value="#{bindings.DbSid.inputValue}"/>
</af:panelLabelAndMessage>
<af:panelLabelAndMessage label="#{bindings.ScmSid.hints.label}">
<af:outputText value="#{bindings.ScmSid.inputValue}"/>
</af:panelLabelAndMessage>
<af:panelLabelAndMessage label="#{bindings.LibPath.hints.label}">
<af:outputText value="#{bindings.LibPath.inputValue}"/>
</af:panelLabelAndMessage>
<af:panelLabelAndMessage label="#{bindings.DbUsername.hints.label}">
<af:outputText value="#{bindings.DbUsername.inputValue}"/>
</af:panelLabelAndMessage>
<af:panelLabelAndMessage label="#{bindings.DbPassword.hints.label}">
<af:outputText value="#{bindings.DbPassword.inputValue}"/>
</af:panelLabelAndMessage>
<af:panelLabelAndMessage label="#{bindings.ScmUsername.hints.label}">
<af:outputText value="#{bindings.ScmUsername.inputValue}"/>
</af:panelLabelAndMessage>
<af:panelLabelAndMessage label="#{bindings.ScmPassword.hints.label}">
<af:outputText value="#{bindings.ScmPassword.inputValue}"/>
</af:panelLabelAndMessage>
<af:panelLabelAndMessage label="#{bindings.ScmPath.hints.label}">
<af:outputText value="#{bindings.ScmPath.inputValue}"/>
</af:panelLabelAndMessage>
<af:panelLabelAndMessage label="#{bindings.ScmWorkarea.hints.label}">
<af:outputText value="#{bindings.ScmWorkarea.inputValue}"/>
</af:panelLabelAndMessage>
<af:panelLabelAndMessage label="#{bindings.DbIpaddr.hints.label}">
<af:outputText value="#{bindings.DbIpaddr.inputValue}"/>
</af:panelLabelAndMessage>
<af:panelLabelAndMessage label="#{bindings.DbPort.hints.label}">
<af:outputText value="#{bindings.DbPort.inputValue}"/>
</af:panelLabelAndMessage>
<af:panelLabelAndMessage label="#{bindings.DbServerSid.hints.label}">
<af:outputText value="#{bindings.DbServerSid.inputValue}"/>
</af:panelLabelAndMessage>
<af:panelLabelAndMessage label="#{bindings.ScmConnUrl.hints.label}">
<af:outputText value="#{bindings.ScmConnUrl.inputValue}"/>
</af:panelLabelAndMessage>
<f:facet name="footer">
<af:group>
<af:panelGroupLayout layout="horizontal">
<af:commandButton actionListener="#{bindings.First.execute}"
text="First"
disabled="#{!bindings.First.enabled}"/>
<af:commandButton actionListener="#{bindings.Previous.execute}"
text="Previous"
disabled="#{!bindings.Previous.enabled}"/>
<af:commandButton actionListener="#{bindings.Next.execute}"
text="Next"
disabled="#{!bindings.Next.enabled}"/>
<af:commandButton actionListener="#{bindings.Last.execute}"
text="Last"
disabled="#{!bindings.Last.enabled}"/>
<af:commandButton action="#{BeanEnv.getMyEnv}"
text="ExecuteWithParams"
disabled="#{!bindings.ExecuteWithParams.enabled}"
/>
</af:panelGroupLayout>
</af:group>
</f:facet>
</af:panelFormLayout>
</f:facet>
and my bean method ;
public String getMyEnv() {
// Add event code here...
String AM = " anadolubank.tasima1.model.AppModule";
String CF = "AppModuleLocal";
ApplicationModule am = Configuration.createRootApplicationModule(AM, CF);
// String[] ss= am.getViewObjectNames();
ViewObject vo = am.findViewObject("ScpEnvView");
// vo.setWhereClauseParam(0,new Integer(10));
vo.setNamedWhereClauseParam("env",new Integer(24));
executeAndShowResults(vo);
//deptIdBinding.setInputValue(new Integer(24));
// Row result = vo.first();
// System.out.println(result.getAttribute("Deptno"));
Configuration.releaseRootApplicationModule(am, true);
//AdfFacesContext.getCurrentInstance().returnFromDialog(null,null);
// set where clause parameter
//vo.setWhereClauseParam(1,10);
// execute View
//vo.executeQuery();
return null;
private static void executeAndShowResults(ViewObject vo) {
vo.executeQuery();
while (vo.hasNext()) {
Row curUser = vo.next();
vo.setCurrentRow(curUser);
String aa=curUser.getAttribute("EnvId").toString();
aa.toString(); // in trace, i can see my new value, but form elements
// same!!!! how to refresh, how to re-bind ???
}

Similar Messages

  • Bind Variables [SOLVED]

    Hello,
    I made a post yesterday and didn't solve my problems, but I'm getting a lot closer.
    I found two tutorials about bind variables and have been trying to follow them, but I am getting some errors and was hoping someone here could tell me what I'm doing wrong.
    Following this tutorial: http://groundside.com/blog/GrantRonald.php?title=adf_invokeaction_immediately_flitering_e&more=1&c=1&tb=1&pb=1
    I created a similar structure. Instead of his Employee view I have Sections and instead of Department I have Project.
    Here is what I've done:
    1. Created an Entity for Sections (eSections) based off the database table and used ROWID as primary key.
    2. Created a view object for Sections (vSections). In this view object I created a variable pProjectID which I set as Number and default 1. I also added a WHERE clause to the query: WHERE eSections.PROJECT_ID = (:pProjectID)
    3. Created a read only view object for Projects (vProjects). The query for this is: SELECT * FROM project
    4. Created an application module and added vProjects and vSections.
    5. Dragged the ExecuteWithParameters node onto the page and created an ADF Parameter Form, clicking okay for the default values (Value binding pProjectID and component ADF Input Text)
    6.Dragged the vSections1 node onto the form under the button to create an ADF readonly Table.
    Now I test it and I get a 500 Server error message "Null pointer exception".
    When I do it slightly differently, by dragging the ExecuteWithParameters as a Command Button and then the pProjectID as a selectOneChoice, the page will render and will actually filter properly for my default ProjectID of 1, but will still show a Null Pointer Exception and won't let me change the value of pProjectID (but it does show the list).
    Hopefully there's something obvious I've done wrong here. If anyone could let me know if they see something or if there's a way I can figure out where the null pointer exception is coming from that would be great, I'm having a really hard time with this and it's very important to my project.
    Thanks again,
    Nelson
    EDIT: I just created a new project and did everything the same and it worked. I don't understand it.
    Message was edited by:
    TheNelson

    Hello,
    I made a post yesterday and didn't solve my problems, but I'm getting a lot closer.
    I found two tutorials about bind variables and have been trying to follow them, but I am getting some errors and was hoping someone here could tell me what I'm doing wrong.
    Following this tutorial: http://groundside.com/blog/GrantRonald.php?title=adf_invokeaction_immediately_flitering_e&more=1&c=1&tb=1&pb=1
    I created a similar structure. Instead of his Employee view I have Sections and instead of Department I have Project.
    Here is what I've done:
    1. Created an Entity for Sections (eSections) based off the database table and used ROWID as primary key.
    2. Created a view object for Sections (vSections). In this view object I created a variable pProjectID which I set as Number and default 1. I also added a WHERE clause to the query: WHERE eSections.PROJECT_ID = (:pProjectID)
    3. Created a read only view object for Projects (vProjects). The query for this is: SELECT * FROM project
    4. Created an application module and added vProjects and vSections.
    5. Dragged the ExecuteWithParameters node onto the page and created an ADF Parameter Form, clicking okay for the default values (Value binding pProjectID and component ADF Input Text)
    6.Dragged the vSections1 node onto the form under the button to create an ADF readonly Table.
    Now I test it and I get a 500 Server error message "Null pointer exception".
    When I do it slightly differently, by dragging the ExecuteWithParameters as a Command Button and then the pProjectID as a selectOneChoice, the page will render and will actually filter properly for my default ProjectID of 1, but will still show a Null Pointer Exception and won't let me change the value of pProjectID (but it does show the list).
    Hopefully there's something obvious I've done wrong here. If anyone could let me know if they see something or if there's a way I can figure out where the null pointer exception is coming from that would be great, I'm having a really hard time with this and it's very important to my project.
    Thanks again,
    Nelson
    EDIT: I just created a new project and did everything the same and it worked. I don't understand it.
    Message was edited by:
    TheNelson

  • SOLVED -Newbie with Bind Variable Issue in Data template

    My XML output looks the way I want it structure-wise, but the data is the same for each group. Obviously my bind variable never gets updated. How can this be achieved? Here are the dataquery and data structure parts of my template:
    <dataQuery>
              <sqlStatement name="Q1">
              SELECT DISTINCT trans_id FROM table1
    </sqlStatement>
              <sqlStatement name="Q2">
                   <![CDATA[SELECT * from table1 WHERE report_type = 'invoice' and record_type = 'HEADER' AND trans_id = :trans_id]]>
              </sqlStatement>
              <sqlStatement name="Q3">
                   <![CDATA[SELECT * from table1 where report_type = 'invoice' and record_type = 'LINE'  AND trans_id = :trans_id]]>
              </sqlStatement>
              <sqlStatement name="Q4">
                   <![CDATA[SELECT * from table1 where report_type = 'PSA_INV' and record_type = 'FOOTER'  AND trans_id = :trans_id]]>
              </sqlStatement>
         </dataQuery>
    <dataStructure>
    <group name="ONE" source="Q1" groupFilter="">
                   <element name="trans_id" value="trans_id" function=""/>
                   <group name="HEADER" source="Q2" groupFilter="">
                        <element name="Direct_Inquiries_To" value="ATT1" function=""/>
                        <element name="Tax_Id" value="ATT2" function=""/>
                        <element name="Bill_To_Address_Line1" value="ATT3" function=""/>
                        <element name="Bill_To_Address_Line2" value="ATT4" function=""/>
                        <element name="Bill_To_Address_Line3" value="ATT5" function=""/>
                        <element name="Bill_To_Address_Line4" value="ATT6" function=""/>
                        <element name="Bill_To_Address_Line5" value="ATT7" function=""/>
                   </group>
                   <group name="LINE" source="Q3" groupFilter="">
                        <element name="Line_No" value="ATT1" function=""/>
                        <element name="Desc_Line1" value="ATT2" function=""/>
                        <element name="Amount" value="ATT3" function=""/>
                        <element name="Desc_Line2" value="ATT4" function=""/>
                        <element name="Amount_Line2" value="ATT5" function=""/>
                                       </group>
                   <group name="FOOTER" source="Q4" groupFilter="">
                        <element name="Sub_Total" value="ATT1" function=""/>
                        <element name="Taxes" value="ATT2" function=""/>
                        <element name="Net_Amount" value="ATT3" function=""/>
              </group>
         </group>
    </dataStructure>
    I have 2 possible transids
    The transid gets updated in the 1st group , but the rest of the data is the same as the first trans_id.
    Message was edited by:
    user647407

    "What do you mean by 'Obviously my bind variable never gets updated' - are the sub queries not getting the trans_id from the first query ?"
    yes, that would appear to be the case. It only gets one value of the transid. To put it in a better perspective, I'll compare it to the Employee example in the user's guide. My Depts would all come out fine. But Dept 10, 20, etc would all show the employee data for dept 10 only.

  • [SOLVED]how to use a VO that has bind variables in a Tree

    Hi,
    I have 3 view objects that I have linked using ViewLinks.
    My last object - the details is based on a View Object that takes in a bind parameter for use in its where clause.
    Originally when I used this View Object I could set this where clause by creating an ExecuteWithParams action in the page on the Iterator and set an executeable to invoke this when the page loads. This worked fine in the non-tree version.
    However when you use a Tree only the master collection gets turned into an iterator in the page def. Therefore I cannot invoke an ExecuteWithParams and set my bind variable in this way.
    How can I set my bind variable on the view object declaratively ? If it is not possible and I have to do it programmatically then where should I do this - I presume it would have to be in a method that the tree has ?
    thanks in advance.
    Message was edited by:
    Dom

    Hi,
    My Employees equivalent table is actually a xref table.
    It is like this :
    Master table = Skills
    This has a self join so a skill can have a master skills (I guess a bit like MGR)
    So I have 2 views on the skills - one for the top level skills and one for all ones below it.
    Then I have my last VO which is employees_skills_xref. This is a xref to the skills table and can hold many rows - so an employee could have many entries under the Skill names "Oracle technologies" - eg "PL/SQL, SQL, Portal etc"
    the Where clause for this xref VO has to take in the employeeId so that it only returns those rows that pertain to the user.
    This empId is stored in a managed bean,
    hth

  • [Solved] Named Bind Variables at Runtime - SQL WHERE clause issue

    Hey 'all,
    I've been having this issue today with a Search page using Named Bind Variables at Runtime for the search parameters for the WHERE clause in the view objects SQL.
    I've got everything working except for a clearing method which I've created so that the user can clear the current WHERE clause from the SQL statment and set it as 1=2 (so that it doesn't do a blind query on load).
    The method can clear and set the WHERE clause to 1=2 only when there is already one there.
    Below are the methods: (located in my view object class)
    public void findInvoiceById(Number invoiceId){
        setWhereClause("invoice_id = :P_INVOICE_ID");
        defineNamedWhereClauseParam("P_INVOICE_ID",null,null);
        setNamedWhereClauseParam("P_INVOICE_ID",invoiceId);
        executeQuery();
    public void clearCriteria(){
        setWhereClause("1=2");
        removeNamedWhereClauseParam("P_INVOICE_ID");
        executeQuery();
    }The error which I get is the following - this happens when the button is pressed twice in a row, or when no query has been passed previously.
    1. JBO-29000: Unexpected exception caught: oracle.jbo.NoDefException, msg=JBO-25058: Definition P_INVOICE_ID of type Variable not found in SupplierInvoicesView1
    2. JBO-25058: Definition P_INVOICE_ID of type Variable not found in SupplierInvoicesView1
    Any help with this would be greatly appreciated!
    Cheers,

    Hi Bonnie,
    we have it working ok, but still feel that there is room for improvement in the design.
    For us the key factors are:
    Pages based on the same view object that can be queried multiple ways.
    We don't want to put design time bind variables in because it limits the use of the VO
    We don't wan't multiple VO's with different where clauses.
    The page is displaying the same table columns and fields, but the where clause must be dynamic.
    We only want to query on the search field entered (some of our tables are massive)
    TopLink named queries are really what we are after, but we don't want to forgo all the other ADF BC functionality. The only examples of ViewCriteria in the developer guide had literals in the where clause and no bind variables. The View Criteria may still be an option, but it appeared quite complex compaired to directly adding and removing bind variables at runtime.
    a couple of footnotes:
    the following methods are used to clear the runtime variables prior to reusing the VO (thanks to John Stegman for the pointer on the exception handler):
        public void clearBindVariable(String bindVariableName){
            try
                removeNamedWhereClauseParam(bindVariableName);
            catch (NoDefException e)
        public void clearBindVariables(){
            clearBindVariable("P_INVOICE_ID");
            clearBindVariable("P_INVOICE_NUM");
            clearBindVariable("P_SUPPLIER_NAME");
            clearBindVariable("P_INVOICE_DATE_FROM");
            clearBindVariable("P_INVOICE_DATE_TO");
            clearBindVariable("P_SUPPLIER_NUMBER");
        }We are using 1=1 and 1=2 in the where clause to supress blind querying. 1=2 is applied when ever we are not explicitely searching for something. We had a problem with using the refresh condition ${adfFacesContext.postback == true} which I posted about here:
    executeQuery called twice using ${adfFacesContext.postback == true}
    Would still gladly hear other ideas on a better reuse design.
    regards,
    Brenden

  • [Solved] Referencing another View Objects Bind Variables

    Hello,
    I have a Master view object and a detail object.
    The Master object, vProjects, has a bind variable :pProjectId that the user selects by using a selectOneChoice component. The View object vSections then shows only those Sections that have the selected ProjectId.
    I have a view link to get to the lower level which connects vSections to vRequirements.
    This works well except that the vRequirements lists all requirements that match the SecID I pass through the link. I need it to list only the ones that match the SecID AND the ProjectId chosen earlier.
    Is there a way to reference the bind variable that I used in vProjects inside of vRequirements?
    Thank you,
    Nelson
    Message was edited by:
    TheNelson

    Thanks, I can't believe I didn't think of that. I was rewriting queries and everything.
    Thanks again.

  • Bind variable is not defined

    Hi, it is my first attempt to modify a rdf file.
    I run into a problem while trying to add an additional user parameter in an existing rdf file. While I am successful in adding a new FREQUENCY user parameter and I am able to update the form to show this new parameter, I am not able to run the report.
    I have updated the SQL query in the report editor, under data view to use this new parameter :FREQUENCY. (select ... from table where frequency= :FREQUENCY) There was no error here.
    Whenever I run the report, I will always get an error saying:
              "REP-0730: The following bind variable is not defined: "(nothing behind this                                                             error message)
    The program will have a memory error and it exits itself.
    I had tried many methods trying to solve this problem to no avail.
    I am using Oracle 9i Reports Builder 9.0.2.0.3.
    I would appreciate any help given on this matter.
    Thank you :)
    Message was edited by:
    Leion

    In Object Navigator Under Layout ->User parameters are you able to see your bind variable FREQUENCY?

  • Slow performance when using cursor with bind variable

    i'm facing the problem mentioned in the subject.
    whenever i use the bind variable it would take more than 5mins to fetch 157 records, but if i hardcode the value ( not using variable ) it would take only 10sec to fetch 157 records.
    can anyone give me some guide to solve this problem? thank you..
    Code :
    DECLARE
    cursor cur1(l_startdate IN varchar2,l_enddate IN varchar2) IS
    select * from shipment ship where ship.insertion_date >= to_date(l_startdate,'DD-MM-YYYY HH24:MI:SS') and ship.insertion_date < to_date(l_enddate ,'DD-MM-YYYY HH24:MI:SS')
    TYPE shipment_aat IS TABLE OF cur1%ROWTYPE INDEX BY PLS_INTEGER;
    l_shpt shipment_aat;
    limit_in INTEGER := 100;
    BEGIN
    v_startdate := '10-06-2008 14:00:00';
    v_enddate := '10-06-2008 17:00:00';
    OPEN C_shpt(v_startdate,v_enddate);
    LOOP --start shipment loop   
    FETCH C_shpt BULK COLLECT INTO l_shpt LIMIT limit_in;
         FOR indx IN 1 .. l_shpt.COUNT
    LOOP
    DBMS_OUTPUT.PUT_LINE('l_shpt value ' || l_shpt(indx).ship_number || '/' || l_shpt(indx).insertion_date);
    END LOOP;
    EXIT WHEN l_shpt.COUNT < limit_in;
    END LOOP; -- end of shipment loop
    CLOSE cur1;
    END;

    When your query takes too long ...

  • How to use p_mainsearch parameter in basic search for a report with bind variable?

    Hello,
    I'd like to extend the basic-search in content-area elements to extra records in my own tables.
    So I'd like to use the p_mainsearch-urlparameter (which holds the searchtext of a basic search) into a bind variable of my own report. My report will be on an extra tab on the search-page.
    Especially I don't know how to transfer the value of p_mainsearch into the bind variable of the report.
    Has anyone done that so far?
    Example?
    Thank you,
    Joerg

    I found out the following way:
    1.)Report
    1.1)SQL-Query:
    select * from <owner>.<tablename> where UPPER(column) like '%'||UPPER(NVL(:searchtext,'abczyx123098'))||'%'
    (Note: bind variable is :searchtext).
    1.2)in "before displaying page"-section in "additional plsql" add the following:
    if length(get_value('p_mainsearch')) >= 3 then
    portal30.wwv_name_value.replace_value(
    l_arg_names, l_arg_values, p_reference_path||'.searchtext,
    portal30.wwv_standard_util.string_to_table2(get_value('p_mainsearch')));
    end if;
    1.3) publish as portlet
    2.) Integrate the report-portlet into a new tab on search page. Run basic search.
    Change to the tab with the portlet.
    For me it is solved.
    Joerg.

  • ADF - ViewObject (with Bind Variable) Bind to Table- JDeveloper 10.1.3 EA

    Hi all,
    1.- This is the situation:
    In JDeveloper 10g 10.1.3 EA I have two JSP JSF Pages with bind automatically coponents (backing bean).
    - In the first page I can select a value from a list. Then, when I press the "Accept" ADF Command Button, the selected value is stored in a property called "rutEntidad" of a Session Managed Bean and the Flow Control is passed to the second page.
    - In the second page I have an ADF Table (called tablePolizas) bind to a ViewObject (I drop the ViewObject from the Data Control Palette to the Page - ADF Read-Only Table ). The ViewObject has a Bind Variable called RUT_ENTIDAD. When this page is loaded, value in the rutEntidad property of Session Managed Bean is passed to the ViewObject in order the ADF Table show filtered data . Also in this page there is a "back" ADF Command Button to the first page. The filter mechanism is performed in the getTablePolizas method in the backing bean of the second page, like this:
    //**** The backing bean of the second page *****
    package cl.bicevida.view.backing;
    public class CrearUsuario {
    private CoreTable tablePolizas;
    public CoreTable getTablePolizas() {
    DCBindingContainer dcbc;
    DCControlBinding cb;
    String rutEntidad;
    FacesContext ctx =FacesContext.getCurrentInstance();
    ValueBinding vb =
    ctx.getApplication().createValueBinding("#{SessionManager.rutEntidad}");
    rutEntidad = vb.getValue(ctx).toString();
    dcbc = this.getBindingContainer();
    cb = dcbc.findCtrlBinding("VoPolizasAsociadasEntidadExterna1");
    ViewObject vo = cb.getViewObject();
    vo.setNamedWhereClauseParam("RUT_ENTIDAD", rutEntidad);
    vo.executeQuery();
    return tablePolizas;
    2.- And this is the problem:
    The first time all works fine... then I press the "back" ADF Command Button to the first page (and NOT the back button of the browser). The second time, if the numbers of rows returned by the ViewObject is different than the first time, the application throws this message (but not crash):
    validation - JBO-29000: Unexpected exception caught: oracle.jbo.JboException, msg=JBO-35007: Row currency has changed since the user interface was rendered. The expected row key was oracle.jbo.Key[1 ]
    validation - JBO-35007: Row currency has changed since the user interface was rendered. The expected row key was oracle.jbo.Key[1 ]
    Well, I had read the "Generic Approach for Back-Button-Friendly Web Rowset Paging" article of Steve Muench in http://www.oracle.com/technology/products/jdev/tips/muench/paging/index.html
    but I think here have another problem.
    3.- The questions:
    Which is the cause of this problem?
    How I can solve it?
    What another way I can programmatic pass a parameter to a ViewObject connected to a table?
    Thanks!!!

    Another thing: the used strategy to obtain a binding container is explained by Steve Muench http://www.oracle.com/technology/products/jdev/tips/muench/1013eabinding/index.html:
    Next, you can use JDeveloper's Overview tab of the faces-config.xml file editor to configure a managed property. Define the managed property name as bindingContainer to match the property in your bean, and set the class to the fully-qualified name of the DCBindingContainer class. You can use the (Browse...) button to quickly locate the class using the new JDeveloper 10.1.3 class browser. Just type in the first few letters of the DCBindingContainer name, and then select the class. Edit the new managed property and set its Value to the JSF EL expression: #{bindings}.
    ************************

  • How to pass a value to a bind variable in a query report in oracle apex

    Hi Guys,
    I have requirement to send weekly reports via email to some users. The users should receive their own records in the report. The user details is stored in a table. What I am planning to do is to create a report query in oracle apex to generate the report and then run a function/procedure via a scheduler to email the report to respective users. Now my query is ............. is it possible to pass a value (user name) to the report query to pull records of only that user? I know we can have bind variables in the report query but I have no idea how to pass a value for bind variables from a function/procedure.
    Can anyone help me on this issue or suggest a better approach?
    Thanks,
    San

    You need to use dynamic sql
    But please keep in mind that since you're using Oracle you may be better off posting this in some Oracle forums
    This forum is specifically for SQL Server
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How to use List of values with bind variables on item?

    Hi
    I made a dynamic list of values with a bind variable as a provider. I tried to run the list, and it worked fine - i filled inn the bind variable when asked for, and i got a list of values to choose from.
    I would very much like to use this list of values as an attribute on a custom made item. My wish is that when creating the item you someplace write the bind variable, and the list will then turn up as wanted. (I could f.ex add the variable as an attribute on the page type)
    I tried to create a custom attribute and assign the list of values to it. It created an error when I then tried to add the attribute to the item.
    Does anyone have any idea on how to solve this?
    Any help appreciated!
    Maja R. Anjer

    Hi
    i am getting error as
    oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT * FROM (SELECT meaning, lookup_code,lookup_type
    FROM fnd_lookup_values
    WHERE view_application_id = 200) QRSLT WHERE (lookup_type=:1 AND ( UPPER(MEANING) like :2 AND (MEANING like :3 OR MEANING like :4 OR MEANING like :5 OR MEANING like :6)))
    Thanks
    Mateti

  • 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

  • How to call a report with a bind variable from a multi-record block

    Hi,
    I have created a report using the BI Publisher functionality. I did all the integration, created the SQL Query and uploaded the template. Up till here everythings fine!
    My SQL Query has 2 bind variables.
    I will call my report from a multi record block, at the end of each record an icon is shown which the user can click to open the report.
    I created a column link for this item (PRINT_REPORT=Inschrijvingsformulier) but I do not manage to pass the parameters to my report. The parameters I want to pass are 2 columns in this Multi Record block.
    I created 2 hidden fields on the page P9_PARAMETER1, P9_PARAMETER2 with the same names as my bind variables and fill this in with the values #PARAMETER1#, #PARAMETER2# from the multi record block.
    It seems it does not work as my report stays empty. (also XML file stays empty).
    Am I trying the wrong way?
    Thanks for any advice,
    Kris

    hi khadeer,
         create one report program and write the required code,and call this function module 'SSF_FUNCTION_MODULE_NAME' and give your smartform name  and also when u activate ur smart form u will get one function module call that function module also and specify any tables used...
    i think this solves ur problem...
    any queries revert back..
    pls reward points if helpful,
    shylaja

  • Bind variable error while adding dynamic where clause to VO query

    hi
    i have extended a VO and in the VOImpl i have written the following code
    public class HzPuiClassificationListVOExImpl extends HzPuiClassificationListVOImpl
    public void initQuery(String partyId, String s1, String classCode)
    /* Logging Code*/
    if(this.isLoggingEnabled(OAFwkConstants.PROCEDURE))
    {this.writeDiagnostics(this," > initQuery() , partyId ="+partyId+" , s1 ="+s1+", classCode="+classCode,OAFwkConstants.PROCEDURE);}
    setWhereClauseParams(null);
    setWhereClauseParam(0, classCode);
    setWhereClauseParam(1, classCode);
    setWhereClauseParam(2, partyId);
    String query = super.getQuery();
    * Check if the whereClause is already present
    if(query!=null && query.toUpperCase().indexOf("AAAAA") == -1)
    OAApplicationModule am = (OAApplicationModule)this.getApplicationModule();
    OADBTransaction oadbTxn = am.getOADBTransaction();
    String whereClause = "   class_category IN ("+
    *" SELECT flv.lookup_code"+*
    *" FROM fnd_lookup_values flv, fnd_lookup_values_dfv dfv"+*
    *" WHERE flv.rowid = dfv.row_id"+*
    *" AND flv.lookup_type = 'XXXXX'"+*
    *" AND dfv.context_value = flv.lookup_type"+*
    *" AND dfv.oco_enabled = 'Y' "+*
    this.addWhereClause(whereClause);
    this.executeQuery();
    * This is the default constructor (do not remove)
    public HzPuiClassificationListVOExImpl()
    when i run the page i get this error
    java.sql.SQLException: Missing IN or OUT parameter at index:: 2
    the original vo query below has 3 bind variables
    SELECT *
    FROM (SELECT *
    FROM (SELECT cc.class_category
    ,l.meaning
    FROM hz_class_categories cc
    ,fnd_lookup_types_vl l
    WHERE cc.class_category = l.lookup_type
    AND l.view_application_id = 222
    AND EXISTS (
    SELECT NULL
    FROM hz_code_assignments ca
    WHERE ca.owner_table_name = 'HZ_CLASS_CATEGORIES'
    AND ca.owner_table_id IS NULL
    AND ca.owner_table_key_1 = cc.class_category
    AND ca.class_category = 'CLASS_CATEGORY_GROUP'
    AND ca.class_code = :1
    AND NVL (ca.status, 'A') = 'A'
    AND SYSDATE BETWEEN ca.start_date_active AND NVL (ca.end_date_active, SYSDATE + 1))
    UNION ALL
    SELECT cc.class_category
    ,l.meaning
    FROM hz_class_categories cc
    ,fnd_lookup_types_vl l
    WHERE cc.class_category = l.lookup_type
    AND l.view_application_id = 222
    AND 'INDUSTRIAL_GROUP' <> :2
    AND NOT EXISTS (
    SELECT NULL
    FROM hz_code_assignments ca
    WHERE ca.owner_table_name = 'HZ_CLASS_CATEGORIES'
    AND ca.owner_table_id IS NULL
    AND ca.owner_table_key_1 = cc.class_category
    AND ca.class_category = 'CLASS_CATEGORY_GROUP'
    AND NVL (ca.status, 'A') = 'A'
    AND SYSDATE BETWEEN ca.start_date_active AND NVL (ca.end_date_active, SYSDATE + 1))
    AND hz_classification_v2pub.is_valid_category ('HZ_PARTIES'
    ,cc.class_category
    ,:3) = 'T') a
    WHERE EXISTS (
    SELECT NULL
    FROM hz_class_code_denorm
    WHERE class_category = a.class_category
    AND TRUNC (SYSDATE) BETWEEN NVL (start_date_active, TRUNC (SYSDATE)) AND NVL (end_date_active, TRUNC (SYSDATE))
    AND enabled_flag = 'Y'
    AND LANGUAGE = USERENV ('LANG'))) qrslt
    A similar error was discussed at this link but it did not give final solution
    [http://kr.forums.oracle.com/forums/thread.jspa?threadID=618451]
    help me to solve this issue..
    Thanks,
    Varun
    Edited by: user10707840 on May 19, 2009 7:18 AM

    its not the AM code .. its the code in VOImpl...
    the same code is working in 11i but when its migrated to R12 its giving this error..
    The original seeded VO query in 11i contains the same bind variable :1 at three places
    SELECT * FROM (select class_category, meaning from hz_class_categories, fnd_lookup_types_vl l where hz_class_categories.class_category = l.lookup_type and l.view_application_id = 222 and class_category in (select owner_table_key_1 from hz_code_assignments ca where ca.owner_table_name = 'HZ_CLASS_CATEGORIES' and ca.owner_table_id is null and ca.class_category = 'CLASS_CATEGORY_GROUP' and ca.class_code = :1 and nvl(ca.status, 'A') = 'A' and sysdate between ca.start_date_active and nvl(ca.end_date_active, sysdate+1)) union all select cc.class_category , meaning from hz_class_categories cc, fnd_lookup_types_vl l, hz_class_category_uses cu where cc.CLASS_CATEGORY = cu.class_category AND ( UPPER(CU.ADDITIONAL_WHERE_CLAUSE) LIKE decode(:1, 'ORG_GROUP','%PARTY_TYPE%ORGANIZATION%', 'PERSON_GROUP', '%PARTY_TYPE%PERSON%', '%') or CU.ADDITIONAL_WHERE_CLAUSE IS NULL or UPPER(CU.ADDITIONAL_WHERE_CLAUSE) LIKE '%WHERE 1=1%' ) and cu.owner_table = 'HZ_PARTIES' and cc.class_category = l.lookup_type and l.view_application_id = 222 and cc.class_category not in (select owner_table_key_1 from hz_code_assignments hca where hca.owner_table_name = 'HZ_CLASS_CATEGORIES' and hca.owner_table_id is null and hca.class_category = 'CLASS_CATEGORY_GROUP' and nvl(hca.status, 'A') = 'A' and sysdate between hca.start_date_active and nvl(hca.end_date_active, sysdate+1)) and cc.class_category not in ( 'RELATIONSHIP_TYPE_GROUP', 'CLASS_CATEGORY_GROUP') and 'INDUSTRIAL_GROUP' <> :1) QRSLT ORDER BY meaning
    the code working in 11i had only one setWhereClauseParam line i.e. setWhereClauseParam(0, classCode);
    when i ran the same code in R12 it errd out..
    I checked the original R12 query... it has 3 bind variables :1 , :2 and :3 ... so i added 2 more setWhereClauseParam statements
    setWhereClauseParam(1, classCode);
    setWhereClauseParam(2, partyId);
    but still its giving the same error
    ORIGINAL R12 query already posted above...

Maybe you are looking for

  • Ipad 4.3.3 does not show events in Photo

    Hello, I updated my IPAD to Software Version 4.3.3 and now when I go into PHOTOS, it only has tabs for PHOTOs, Albums, Faces and Places. I currently have IPHOTO 11.  Before the update, I had a tab for EVENTS.  Having the EVENTS tab is very useful.  H

  • How to manually force sync messages after an iTunes restore?

    I backed up my iPhone 4 before getting rid of the phone in anticipation of the iPhone 5. (circumstances prevented me from keeping the iPhone 4 until after I got the 5). In the meantime, used iMessage on an older iPod Touch (upgraded to iOS 6) and my

  • What is a good strategy for keeping the OEM GRID up and running?

    Hi, What is a good strategy for keeping OEM GRID up and running? Currently, we have grid installed on one linux64bit box with 4 cpus and 8 gigs of RAM, oms 10204, repdb 10204, agent 10204. In addition to using this oem grid for notifications and perf

  • Using a packaged function in a query

    Hi , I have read the following statement (correct option for the question)in 1z0-147 questions. The question is :: WHEN USING A PACKAGED FUNCTION IN A QUERY which of the following is true :: The packaged function cannot execute DML statements against

  • Use of Apple System Voice for commercial purposes.

    I apologise if this is posted in the wrong category (I could see no other alternative however). My question is: I'd like to be able to make use of Apple's In-Built Voices for both web content and e-book use (recording samples of phrases and including