How to select value of selectOneChoice

Hello,
First of all I want to describe what I want to do and then the preconditions for my case.
What I want to do:
I simply want a <selectOneChoice> Component which represents an enumeration of values.
In database there is a column which has the value 'A' or 'P'.
In the DataTransferObject´s mentioned below these values are represented with Character objects.
If the DataTransferStructure mentioned below is loaded I want the <selectOneChoice> to display the current value originate from database.
If I submit the DataTransferStructure (or DataTransferObject --> see below) I want that the selected value (of <selectOneChoice>) will be written to database.
Preconditions:
ADF BusinessComponenets are not used.
Only ADF Faces and Bindings are used.
I have defined a Bean wich executes functions over RMI on EJBs.
This bean is used as DataControl to bind their return values to pages.
It looks nearly like following class:
public class FunctionalObjectServiceBean{
     public FunctionalObjectServiceBean() {
public DataTransferStructure readObjectWithId(Long Id)
throws Exception{
DataTransferStructure has link to> DataTransferObject
DataTransferObject has attribute> Character attributeA (with either value 'A' or 'P')
I have defined a selectOneChoice in the jspx.
DataTransferObjectAttr1 is an Iterator-Binding to the matching attribute in DataTransferObject.
value="#{bindings.DataTransferObjectAttr1.inputValue}" should select the appropriate value originating from database on load.
<af:selectOneChoice value="#{bindings.DataTransferObjectAttr1.inputValue}"
label="#{bindings.DataTransferObjectAttr1.label}"
required="#{bindings.DataTransferObjectAttr1.hints.mandatory}"
shortDesc="#{bindings.DataTransferObjectAttr1.hints.tooltip}"
id="soc1"
                                   valuePassThru="true">
<af:selectItem label="Active" value="A" id="si1"/>
<af:selectItem label="Passive" value="P" id="si2"/>
</af:selectOneChoice>
When I try to execute this example following errors occur:
<FacesCtrlListBinding> <getInputValue> ADFv: In der Werteliste wurden keine gewählten Elemente gefunden, die mit dem Wert A des Typs java.lang.Character übereinstimmen.
<Utils> <buildFacesMessage> ADF: Adding the following JSF error message: Erstellen eines Objekts vom Typ java.lang.Character aus Typ java.lang.String mit dem Wert A nicht möglich
oracle.jbo.domain.DataCreationException: JBO-25009: Erstellen eines Objekts vom Typ java.lang.Character aus Typ java.lang.String mit dem Wert A nicht möglich
Using converters has also no effect here.
thanking you in anticipation

I try to translate it in my words:
<FacesCtrlListBinding> <getInputValue> In the value list no elements were found which match the value A with datatype java.lang.Character.
<Utils> <buildFacesMessage> ADF: Adding the following JSF error message: Creating object of type java.lang.Character from source type java.lang.String not possible.
oracle.jbo.domain.DataCreationException: JBO-25009: Cannot create an object of type:java.lang.Character from type:java.lang.String with value: A.

Similar Messages

  • How to get selected value from SelectOneChoice

    Hi,
    I'm facing a problem to get selected value from SelectOneChoice. I have valueChangeListener event on a (SelectOneChoice)item. After user makes a choice I want to store selected value in a bean property to pass it to a method.
    For example List item shows dname from dept table after user makes a choice I want to get deptno and populate into bean which I use to pass into my method.
    If I use valueChangeEvent.getNewValue() I always get negative value instead I want deptno selected. Sample code pasted below.
    public void setDeptno(ValueChangeEvent valueChangeEvent) {
    BindingContainer b = getBindings();
    OperationBinding oB = b.getOperationBinding("setDeptno");
    //Checking instance of because same method is called from another text inputText item.
    if (valueChangeEvent.getSource() instanceof CoreSelectOneChoice){
    CoreSelectOneChoice cN = (CoreSelectOneChoice)valueChangeEvent.getSource();
    if (columnName.getId().toString().equals("deptDname")){
    JSFUtils.setManagedBeanValue("dept.deptDeptno",valueChangeEvent.getNewValue());
    }

    if your selectOneChoice has value equal to #{bindings.deptno} bound to the iterator Dept1Iterator,
    then the backing code will look more like
                    public void setDeptno(ValueChangeEvent valueChangeEvent) {
                        BindingContainer b = getBindings();
                        OperationBinding oB = b.getOperationBinding("setDeptno");
                        //Checking instance of because same method is called from another text inputText item.
                        if (valueChangeEvent.getSource() instanceof CoreSelectOneChoice){
                            CoreSelectOneChoice cN = (CoreSelectOneChoice)valueChangeEvent.getSource();
                        if (columnName.getId().toString().equals("deptDname")){
                            FacesContext ctx = FacesContext.getCurrentInstance();
                            Application app = ctx.getApplication();
                            ValueBinding bind = app.createValueBinding("#{bindings.Dept1Iterator.currentRow}");
                            Row row = (Row)bind.getValue(ctx);
                            JSFUtils.setManagedBeanValue("dept.deptDeptno", row.getAttribute("deptno"));
                    } I haven't tested it, so it could perfectly not work at all

  • How to set value for selectOneChoice

    Hello,
    How to set value for selectOneChoice defined as:
    <af:selectOneChoice label="Label" id="soc1" binding="#{DepositorMergingBean.socSurnameComponent}">
    <f:selectItems id="si1" value="#{DepositorMergingBean.socSurnames}"/>
    </af:selectOneChoice>
    where socSurnames is List<SelectItem> - manually filled list of SelectItem(SomeObject, (String)text_description), so - SOC is filled manually (no binded iterators, etc..)
    Neither socSurnameComponent.setValue( new Integer(0) ) nor socSurnameComponent.setValue( socSurnames.get(0) ) do not help.
    Thanks in advance.

    this.selectOneChoice.setValue(selectItems.get(2).getValue());Try as per the following sample:
    SelectOneChoiceTest.JSPX:
    <af:form id="f1">
    <af:selectOneChoice label="Select One Choice" id="soc1"
    binding="#{SelectOneChoiceTestBean.selectOneChoice}">
    <f:selectItems value="#{SelectOneChoiceTestBean.selectItems}"
    id="si1"/>
    </af:selectOneChoice>
    <af:commandButton text="Set Selected Value" id="cb1"
    actionListener="#{SelectOneChoiceTestBean.onClick}"/>
    </af:form>
    SelectOneChoiceTestBean.java:
    import java.util.ArrayList;
    import java.util.List;
    import javax.faces.event.ActionEvent;
    import javax.faces.model.SelectItem;
    import oracle.adf.view.rich.component.rich.input.RichSelectOneChoice;
    public class SelectOneChoiceTestBean {
    private RichSelectOneChoice selectOneChoice;
    public SelectOneChoiceTestBean() {
    super();
    private List<SelectItem> selectItems;
    public void setSelectItems(List<SelectItem> selectItems) {
    this.selectItems = selectItems;
    public List<SelectItem> getSelectItems() {
    selectItems = new ArrayList<SelectItem>();
    selectItems.add(new SelectItem("One", "One"));
    selectItems.add(new SelectItem("Two", "Two"));
    selectItems.add(new SelectItem("Three", "Three"));
    return selectItems;
    public void setSelectOneChoice(RichSelectOneChoice selectOneChoice) {
    this.selectOneChoice = selectOneChoice;
    public RichSelectOneChoice getSelectOneChoice() {
    return selectOneChoice;
    public void onClick(ActionEvent actionEvent) {
    this.selectOneChoice.setValue(selectItems.get(2).getValue());
    Thanks,
    Navaneeth

  • How to select values frm table giving the condition value at runtime in SQL

    Hi All,
    How to select values from a table by giving the condition value at runtime in SQL
    My SQL statement is select * from employee where empno=<empno>, this empno I want to provide at run time. Also I don't have any bind variables defined. Can anyone please tell how can I achieve this. Also do I have to write a SQL or pl/sql statement.

    Hi Roshni Shankar,
    You can use substitution variable in case of SQL.
    SQL> select * from employees where emplployee_id = &emp_id;
    Enter value for emp_id: 100
    old   1: select * from employees where emplployee_id = &emp_id
    new   1: select * from employees where emplployee_id = 100If you want to put condition on varchar values then eighter provide values in single quotes or use single quote for substitution variable.
    SQL> select * from employees where last_name = &emp_name;
    Enter value for emp_name: 'King'
    old   1: select * from employees where last_name = &emp_name
    new   1: select * from employees where last_name = 'King'
    no rows selected
    SQL> select * from employees where last_name = '&e_name';
    Enter value for e_name: King
    old   1: select * from employees where last_name = '&e_name'
    new   1: select * from employees where last_name = 'King'In case of pl/sql you can pass values to procedure and you can use those values at run time.
    create or replace procedure test (p_emp_id number)
    as
       v_last_name      varchar2(100);
    begin
       select last_name
       into    v_last_name
       from  employees
       where employee_id = p_emp_id;
       dbms_output.put_line(p_emp_id ||'    ->    '||v_last_name);
    end;
    show errors
    SQL>exec test(100);
    SQL>exec test(101);Edited by: Gaurav Bhide on Oct 29, 2012 4:07 AM

  • How to select values of nested elements that have maxOccurs="unbounded"

    I have the following xml schema and xml data:
    <?xml version="1.0" encoding="UTF-8"?>
    <!--W3C Schema generated by XML Spy v4.4 U (http://www.xmlspy.com)-->
    <xs:schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:qbl="http://10.0.1.233:8080/home/cpa/xsd/qbl.xsd" xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0" xdb:storeVarrayAsTable="true">
    <xs:element name="QBL_Envelope" type="QBL_Envelope_Type" xdb:defaultTable="MYQBL"/>
         <xs:complexType name="QBL_Envelope_Type">
         <xs:sequence>
                   <xs:element ref="Transmission_Date" minOccurs="0"/>
                   <xs:element ref="QBL" maxOccurs="unbounded"/>
              </xs:sequence>
         </xs:complexType>
    <xs:element name="Transmission_Date" type="xs:string"/>
    <xs:element name="QBL">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element ref="QBL_Number"/>
                        <xs:element ref="Priority"/>
                        <xs:element ref="Date_Prepared"/>
                        <xs:element ref="Line_Item" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="QBL_Number" type="xs:string"/>
    <xs:element name="Priority" type="xs:string"/>
    <xs:element name="Date_Prepared" type="xs:string"/>     
         <xs:element name="Line_Item">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element ref="Item_Name" maxOccurs="unbounded"/>
                        <xs:element ref="Line_Item_Weight"/>
                        <xs:element ref="Line_Item_Cube_Info"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="Line_Item_Cube_Info">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element ref="Line_Item_Cube" minOccurs="0"/>
                        <xs:element ref="Line_Item_Cube_Qualifier" minOccurs="0"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="Line_Item_Cube" type="xs:string"/>
    <xs:element name="Line_Item_Cube_Qualifier" type="xs:string"/>
    <xs:element name="Item_Name" type="xs:string"/>
         <xs:element name="Line_Item_Weight" type="xs:string"/>
    </xs:schema>
    insert into MYQBL values(
    xmltype('<QBL_Envelope>
         <Transmission_Date>030531</Transmission_Date>
         <QBL>
              <QBL_Number>316180J2</QBL_Number>
              <Priority>3</Priority>
              <Date_Prepared>20030530</Date_Prepared>
              <Line_Item>
                   <Item_Name>FREIGHT ALL KINDS</Item_Name>
    <Item_Name>Specail Item</Item_Name>
                   <Line_Item_Weight>0000212</Line_Item_Weight>
                   <Line_Item_Cube_Info>
                        <Line_Item_Cube>31.1</Line_Item_Cube>
                        <Line_Item_Cube_Qualifier>E</Line_Item_Cube_Qualifier>
                   </Line_Item_Cube_Info>
              </Line_Item>
    <Line_Item>
                   <Item_Name>AAAAAA</Item_Name>
    <Item_Name>BBBBBBBB</Item_Name>
                   <Line_Item_Weight>0000512</Line_Item_Weight>
                   <Line_Item_Cube_Info>
                        <Line_Item_Cube>67.1</Line_Item_Cube>
                        <Line_Item_Cube_Qualifier>E</Line_Item_Cube_Qualifier>
                   </Line_Item_Cube_Info>
              </Line_Item>
    </QBL>
    </QBL_Envelope>').createSchemaBasedXML('http://10.0.1.233:8080/home/cpa/xsd/qbl.xsd'));
    My question is how to select
    /QBL_Envelope/QBL/QBL_Number,
    /QBL_Envelope/QBL/Line_Item/Item_Name,
    /QBL_Envelope/QBL/Line_Item/Line_Item_Weight,
    /QBL_Envelope/QBL/Line_Item/Line_Item_Cube_Info/Line_Item_Cube
    /QBL_Envelope/QBL/Line_Item/Line_Item_Cube_Info/Line_Item_Cube_Qualifier
    in a select stetament? (Note that these elements QBL_Number, Line_Item and Item_Name have maxOccurs="unbounded") actually I want to use the select statement to create a view.
    I tried the following select statement and it works fine:
    select extractValue(value(b), '/QBL/QBL_Number'),
    extractValue(value(b), '/QBL/Priority'),
    extractValue(value(b), '/QBL/Date_Prepared')
    from egbl e, table(xmlsequence(extract(value(e), '/QBL_Envelope/QBL'))) b
    Please advise. It is import to us. Thank you for your help in advance!!!
    The database version is 9.2.0.3.0 and the operating system is Windows 2000.
    Thanks,
    Mary Wu

    Hi Mark,
    Thank you for your reply and I really appreciate!
    I tried the select statement you gave me but I got error:
    SQL*Plus: Release 9.2.0.3.0 - Production on Fri Aug 1 09:11:03 2003
    Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
    Connected to:
    Oracle9i Enterprise Edition Release 9.2.0.3.0 - Production
    With the Partitioning, Oracle Label Security, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.3.0 - Production
    SQL> set long 10000;
    SQL> set pagesize 10000
    SQL> select * from myqbl;
    SYS_NC_ROWINFO$
    <QBL_Envelope>
    <Transmission_Date>030531</Transmission_Date>
    <QBL>
    <QBL_Number>316180J2</QBL_Number>
    <Priority>3</Priority>
    <Date_Prepared>20030530</Date_Prepared>
    <Line_Item>
    <Item_Name>FREIGHT ALL KINDS</Item_Name>
    <Item_Name>Specail Item</Item_Name>
    <Line_Item_Weight>0000212</Line_Item_Weight>
    <Line_Item_Cube_Info>
    <Line_Item_Cube>31.1</Line_Item_Cube>
    <Line_Item_Cube_Qualifier>E</Line_Item_Cube_Qualifier>
    </Line_Item_Cube_Info>
    </Line_Item>
    <Line_Item>
    <Item_Name>AAAAAA</Item_Name>
    <Item_Name>BBBBBBBB</Item_Name>
    <Line_Item_Weight>0000512</Line_Item_Weight>
    <Line_Item_Cube_Info>
    <Line_Item_Cube>67.1</Line_Item_Cube>
    <Line_Item_Cube_Qualifier>E</Line_Item_Cube_Qualifier>
    </Line_Item_Cube_Info>
    </Line_Item>
    </QBL>
    </QBL_Envelope>
    SQL> select extractValue(value(q), '/QBL/QBL_Number'),
    2 extractValue(value(q), '/QBL/Priority'),
    3 extractValue(value(q), '/QBL/Date_Prepared'),
    4 extractValue(value(n), '/Item_Name'),
    5 extractValue(value(l), '/Line_Item/Line_Item_Weight'),
    6 extractValue(value(l), '/Line_Item/Line_Item_Cube_Info/Line_Item_Cube'),
    7 extractValue(value(l), '/Line_Item/Line_Item_Cube_Info/Line_Item_Cube_Qualifier')
    8 from MYQBL e,
    9 table (xmlsequence(extract(value(e), '/QBL_Envelope/QBL'))) q,
    10 table (xmlsequence(extract(value(q), '/QBL/Line_Item'))) l,
    11 table (xmlsequence(extract(value(l), '/Line_Item/Item_Name'))) n;
    select extractValue(value(q), '/QBL/QBL_Number'),
    ERROR at line 1:
    ORA-00904: "SYS_NT0jPUiVR5SS6VqgqEvU1LkQ=="."SYS_NC_ROWINFO$": invalid
    identifier
    SQL>
    Do you have any idea about it?
    Actually before I posted the message I had tried the same select statement and had got the same error.
    Again, thank you very much and I really appreciate your help.
    Mary Wu

  • How to select value from database view with * in wher clause

    Hi ,
      I ahve a database view with some fields.
    Now my requirement is to serach a single row on the basis of process type.
    Process type can have values like ZBA,ZBC,ZBD,ZBE or similarly anything starting with ZB.
    Now i know that starting two letters will be ZB , but dont knwo the last letter.
    So how should i use select query for the same?
    Should i use like operator for the same?
    regards
    PG

    hi,
    u can use character '%'.sample code like this
    SELECT reltype
                 instid_a
                 catid_a
                 instid_b
                 FROM /dbm/ord_docflow
                 INTO TABLE it_link
                 FOR ALL ENTRIES IN it_pnwtyh
                 WHERE  instid_a  =  it_pnwtyh-instid_a AND
                 instid_b  LIKE 'QMSM%'  AND
                 typeid_a  = 'BUS2400'  AND
                 typeid_b  = 'BUS2400' AND
                 catid_a   = 'BO' AND
                 catid_b   = 'BO' AND
                 reltype   = 'VONA'.
    this is similar to using* while we fetch values from table.in the above code only i no QMSM rest values not sure,so used QMSM%

  • How to select value from DropDownByKey?

    Hi all,
    In my application, I am using 2 Bapis. The first one just for displaying data with all material numbers. The second Bapi is for inserting the Sales data to database. Both of them have Material number. Now from the first Bapi, I displayed all the materials in a dropdown list. Now when i select one value from Dropdown list, and I fill some values for Sales data, then the data has to be stored in database along with the material number.I displayed the material number of first Bapi in my View and the remaining feilds of second (Sales)Bapi. How to do this?
    Help is highly appreciated.

    Hi,
    Step1:
    //Input Tothe First BAPI
         <Bapi>Input input1=new <Bapi>Input();
         wdContext.node<BAPIInput>().bind(input);
            input.set<Param>(wdContext.current<ContextName>Element.get<Param>());
    Step2:
    //Execute the First BAPI
    Step3:
    //Output Of the FirstBapi
    int len=wdContext.node<BAPIList>().size();
    Step4:
         <Bapi2>Input input2=new <Bapi2>Input();
         wdContext.node<BAPI2Input>().bind(input2);
    //SecondBapi Input from First Bapi
    for(int l=0;l<len;l++) {
         String returndata=String.valueOf(((IPrivate<viewname>.I<BAPIList>Element)(wdContext.node<BAPIList>().getElementAt(l))).get<Parameter>());
    input2.set<Param>(returndata);
    //Do Other Input for Second Bapi
    input2.set<Param>("Input");
    //Execute the Second Bapi
    //Output Of Second Bapi//Like Step4
    //Execute the SQl
    Kind Regards
    Mukesh

  • How to select values for different fields in a report

    Beginner needs help!  I have five columns of linked data.  I want to show the counts of the number of "true" values in each column.  However when I set the first one to true none of the other rows which might be true for that instance when the first column is false show up anymore?  Any help appreciated.

    1st off how do you have your tables joined, suggest outter left joins.
    create a formula
    if (field) =true then 1 else 0 
    use manual running totals to calcualte your values
    RESET
    The reset formula is placed in a group header report header to reset the summary to zero for each unique record it groups by.
    whileprintingrecords;
    Numbervar  X := 0;
    CALCULATION
    The calculation is placed adjacent to the field or formula that is being calculated.
    (if there are duplicate values; create a group on the field that is being calculated on. If there are not duplicate records, the detail section is used.
    whileprintingrecords;
    Numbervar  X := x + ; ( or formula)
    DISPLAY
    The display is the sum of what is being calculated. This is placed in a group, page or report footer. (generally placed in the group footer of the group header where the reset is placed.)
    whileprintingrecords;
    Numbervar  X;
    X

  • How to select value from list with multiple selections ?

    HI,
    i have a list with multiple selections where i show email address retrieved from database.
    what i want to do is to send the selected email address to the invoiceedit.jsp.
    please look at the following code which gives you the better idea.
    <td class='smalltext'><select name="email" size="3" multiple="multiple">
       <% 
       Connection conn = null;
       Statement stmt = null;
       Statement stmt_contactperson = null;
       Statement stmt_address = null;
       try{
          conn = getREConnection();
           stmt = conn.createStatement();
       ResultSet rs = null;
       rs = stmt.executeQuery("SELECT PROPERTYID, VALUE FROM PROPERTIES WHERE ENTITYID="+ g_strGroupID+" AND NAME = 'invoice_default_email'");
       int numofrows = 0;
       while(rs.next())
               %>
       <option value="<%= rs.getString("VALUE") %>" selected="selected"> <%= rs.getString("VALUE")  %> </option>
        <%
           }//end of while
          %>
         </select>
        <a href="invoiceedit.jsp?entityid=<%=g_strGroupID%>&add=1"><font color="#000000">Add</font></a>
         <a href="invoiceedit.jsp?entityid=<%=g_strGroupID%>&email_to="><font color="#000000"> Edit</font></a> </td>thanks

    Use a form button instead of a link so that you can send it as a request parameter to the server. In the server side just use HttpServletRequest#getParameterValues() to obtain all values for the given parameter name. If you really need a link rather than a button, then use Javascript to submit the form on click of the link.
    That said, your design is bad. Java code belongs in Java classes, not in JSP files. Database access logic belongs in a DAO class. Business and controlling logic belongs in a Servlet class. Only presentation logic belongs in the JSP file. Avoid scriptlets as much as possible and use JSP EL and/or JSTL instead.

  • *SELECT: How to select value from cube into variable?

    Hi,
    I have an application that need lots of complex calculations.  Currently I am facing problem in retrieving a value from BPC application/database (BW cube) into a script logic local variable.  Let's say the application has  these  following dimensions
    1.  FYPD ( fiscal yr period. 200901, 200902 etc)
    2.  REGION ( A, B , C , D etc)
    3.  PRODUCT(Product ID)
    4.  VERSION ( ACTUAL, FORECAST etc)
    5.  AMOUNT (Sales Amount, signed data )
    Now I need to extract the sales amount into a local valriable where REGION = "A" and  PRODUCT = "SMK-1234" and FYPD = "200905"  and VERSION = "ACTUAL"
    What's should be the equivalent SELECT command? I tried but could not figure out. Any help?
    Regards
    DipM

    Hi DipM,
    There isn't really a concept of local variables for values in script logic. Instead, you'll want to use *WHEN, *LOOKUP, or MDX statements.
    For example, this will copy the value you mention into the PLAN version:
    *WHEN REGION
    *IS A
    *WHEN PRODUCT
    *IS SMK-1234
    *WHEN FYPD
    *IS 200905
    *WHEN VERSION
    *IS ACTUAL
    *REC(FACTOR=1,VERSION=PLAN)
    *ENDWHEN
    *ENDWHEN
    *ENDWHEN
    *ENDWHEN
    See *WHEN ([link|http://help.sap.com/saphelp_bpc70sp02/helpdata/en/36/339907938943ad95d8e6ba37b0d3cd/frameset.htm]) and *REC ([link|http://help.sap.com/saphelp_bpc70sp02/helpdata/en/25/8d51050c43496887ddff88f13e5f1a/frameset.htm]) documentation for more.
    As mentioned, you can also use *LOOKUP or MDX statements to look up values and drive calculations in *REC(EXPRESSION=....) statements. This functionality is outlined in the SP02 documentation addendum ([link|http://service.sap.com/~form/sapnet?_SHORTKEY=00200797470000088146&_SCENARIO=01100035870000000202&]).
    In the MS Version of BPC, there is a concept of local MDX variables that work with the specialized *GO script logic statement. This statement is not available in the Netweaver version.
    Ethan

  • How to select values if I know the fieldname in PL*SQL? [SOLVED]

    There was a simple trick in SQL*PLUS:
    DEFINE var='EMP_NUMBER';
    SELECT &var FROM emp;
    And the result was the same as:
    SELECT emp_number FROM emp;
    Does anybody know how to write this in PL*SQL procedure? I didn't find any similar things in forum... I have db8i and 10g.
    m.

    Thank's a lot! I found this usefull article on Metalink as well:
    Subject: Dynamic SQL
    Doc ID: Note:62592.1 Type: BULLETIN
    Last Revision Date: 06-MAR-2007 Status: PUBLISHED

  • Af:table and selectOneChoice, creating a new row resets selected value

    Hello,
    I have a table containing 4 columns, first two are read-only (outputtext) and next 2 contains selectOneChoice , table model is baed on java.util.List
    adding a new row, works fine but it resets the selectOneChoice(dropbox) selected value to First Index For All Rows
    so everytime you add a new row, it resets the value to the very First Value in the dropbox for all rows,
    it seems after PPR it loses the selected value in SelectOneChoice for each row...
    any ideas?
    Thanks,

    Hi,
    What is the EL expression given for value property of selectOneChoice list?
    I guess it is the bean variable and it is same for each row, due to which selection in any selectOneChoice list in table modifies the same bean variable and sets the same value for lists in all other rows too(same happens in case of new insertion also, when you insert new record selectonechoice list points to the first value if no selection item is not added), in case of selectonechoice list you need to handle the selected values differently for each row. If you can share sample code, I can tell you what could be the problem.
    Sireesha

  • Error window while changing the value in SelectOneChoice.

    Hi I am facing a problem on change of values in SelectOneChoice, "ERROR For input string: "N"
    Below is how i am implementing SelectOneChoice:
    I am creating values for SelectOneChoice in a Java class:
    *SelectItem itemY=new SelectItem();*
    *itemY.setLabel("Yes");*
    *itemY.setValue("Y");*
    *confirmation.add(itemY);*
    *SelectItem itemN=new SelectItem();*
    *itemN.setLabel("No");*
    *itemN.setValue("N");*
    *confirmation.add(itemN);*
    Using this values in JSFF like this:
    *<af:selectOneChoice value="#{bindings.confURLSubmitted.inputValue}"*
    *label="Conference Website URL Submitted"*
    *required="#{bindings.confURLSubmitted.hints.mandatory}"*
    *shortDesc="#{bindings.confURLSubmitted.hints.tooltip}"*
    *binding="#{backingBeanScope.EditComplianceDetails.confURLSubmitted}"*
    *id="confURLSubmitted"*
    *unselectedLabel="Select One"*
    *autoSubmit="true"*
    *valueChangeListener="#{backingBeanScope.EditComplianceDetails.OnConfURLSubChange}">*
    *<f:selectItems value="#{pageFlowScope.generalLists.confirmation}"*
    *binding="#{backingBeanScope.EditComplianceDetails.si1}"*
    *id="si1"/>*
    *</af:selectOneChoice>*
    And in bean method i am trying to print the selected value in SelectOneChoice:
    *public void OnConfURLSubChange(ValueChangeEvent valueChangeEvent) {*
    *// Add event code here...*
    *System.out.println("this.confURLSubmitted.getValue() "+this.confURLSubmitted.getValue());*
    Now when i try to change the value in SelectOneChoice:
    I am getting an error window "ERROR For input string: "N"
    Any idea y i am getting this error.
    Thanks in Advance

    Remove selectOneChoice value binding and set static value and try
    *<af:selectOneChoice value="XXX"*
    label="Conference Website URL Submitted"
    required="#{bindings.confURLSubmitted.hints.mandatory}"
    shortDesc="#{bindings.confURLSubmitted.hints.tooltip}"
    binding="#{backingBeanScope.EditComplianceDetails.confURLSubmitted}"
    id="confURLSubmitted"
    unselectedLabel="Select One"
    autoSubmit="true"
    valueChangeListener="#{backingBeanScope.EditComplianceDetails.OnConfURLSubChange}">
    <f:selectItems value="#{pageFlowScope.generalLists.confirmation}"
    binding="#{backingBeanScope.EditComplianceDetails.si1}"
    id="si1"/>
    </af:selectOneChoice>

  • How can I pre-define the default selection in a SelectOneChoice?

    How can I pre-define the default selection in a SelectOneChoice?
    (1) Here's my JSF-code:
    <af:selectOneChoice label="#{res['usercreate.input.sex']}"
    value="#{bindings.Sex.inputValue}"
    binding="#{SelectListBean.sexlist}"
    readOnly="false" autoSubmit="false">
    <af:selectItem label="#{res['data.sex.women']}" value="1"/>
    <af:selectItem label="#{res['data.sex.man']}" value="2"/>
    </af:selectOneChoice>
    (2): manged bean: to set the default value to be the first in the list, my managed bean as follows:
    import oracle.adf.view.faces.component.core.input.CoreSelectOneChoice;
    public class MBSListBean {
    private CoreSelectOneChoice sexlist;
    public MBSListBean() {
    public void setSexlist(CoreSelectOneChoice sexlist) {
    this.sexlist = sexlist;
    this.sexlist.setValue(1);
    public CoreSelectOneChoice getSexlist() {
    return sexlist;
    (3) when i launch the page, it often gives me such warnings:
    WARNUNG: Could not find selected item matching value "1" in CoreSelectOneChoice[UIXEditableFacesBeanImpl, id=_id7]
    how to solve the problem ?
    Thanks,
    wzzdx

    You could also set the default on your entity or viewobject, in the properties of your attribute.

  • How to get real value from selectOneChoice with javascript?

    Hi,
    How to get real value from selectOneChoice with javascript? The event.getNewValue() only gets me the index of the selected item, not the value/title.
    JSF page:
    <af:resource type="javascript">
    function parseAddress(event)
    alert("new value: " + event.getNewValue());
    </af:resource>
    <af:selectOneChoice label="Location:" value="" id="soc4">
    <af:clientListener type="valueChange" method="parseAddress" />
    <f:selectItems value="#{Person.locations}" id="si7"/>
    </af:selectOneChoice>
    HTML :
    <option title="225 Broadway, New York, NY-10007" selected="" value="0">225 Broadway (Central Office)</option>
    <option title="90 Mark St., New York, NY-10007" value="1">90 Mark St. (Central Office)</option>
    Thanks a lot.

    Something I was missing ,
    You need to add valuePassThru="true" in your <af:selectOneChoice component. I have personally tested it and got the actual value in alert box. I hope this time you got the real solution. You can also test the following code by your end.
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document id="d1">
    <af:form id="f1">
    <af:panelBox text="PanelBox1" id="pb1">
    <af:selectOneChoice label="Set Log Level" id="soc1"
    value="#{SelectManagedBean.loggerDefault}"
    valuePassThru="true">
    <af:selectItem label="select one" value="First" id="s6"/>
    <af:selectItem label="select two" value="Second" id="s56"/>
    <af:clientListener method="setLogLevel" type="valueChange"/>
    </af:selectOneChoice>
    <af:resource type="javascript">
    function setLogLevel(evt) {
    var selectOneChoice = evt.getSource();
    var logLevel = selectOneChoice.getSubmittedValue();
    // var logLevelObject = AdfLogger.NONE;
    alert("new value is : " + logLevel);
    //alert(evt.getSelection);
    //alert(logLevelObject);
    evt.cancel();
    </af:resource>
    </af:panelBox>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>

Maybe you are looking for

  • Output device LOCL is not defined

    Hi, I am getting an error message while executing a report containing smartform 'Output device LOCL is not defined'. The coding is as follows:   l_s_ssfctrlop-no_dialog   = 'X'.   l_s_ssfctrlop-getotf      = 'X'.   l_s_output_options-tddest = 'LOCL'.

  • Multiple apps won't open at all

    Hello all. I'm not that mac-literate so please forgive me if this question may seem redundant or just stupid.. but I'm having problems with my mac. Several apps just ceased to load; the main ones being Safari, Mail, Yahoo messenger, Adium, iTunes, iD

  • [solved]Grep usage

    So if I'm reading the man pages right if I run something like 'grep -f awesome'  It'll search the whole filesystem for any file with 'awesome' Last edited by jedijimi (2014-03-23 19:19:49)

  • Unable to play Level3 live stream with OSMF v1.0

    Hi, I'm trying to play a live stream hosted by level3. When adding the mp4: prefix to my rtmp stream url I am able to connect but get a mediaError: "Failed to play  (stream ID: 1)". parallelElement.addChild(mediaFactory.createMediaElement(new URLReso

  • Do you know why we need to go to Thai restaurants?

    For eat some thai food in Thai restaurants, In the same ways You sold an movies in thai market, but don't has Thai-sub or Thai Audio, Think a lot.