Creating on the fly dynamic named bind variable names.

I have an application process which gets called by a Dynamic action and Javascript.
Everything is working great however I'm using it to drive dynamic charts.
I could use IF statements at the end of the application process to decide what BIND vairable to fill with the information the process has collected however I'd prefer just to create the BIND variable from the
name of the submitted information.
So I have an application level variable called WHICHCHART. this gets populated with text upon calling the application process...so let's say 'chart1' is what it gets filled with.
What I"d like to have at the end of the application process is just a bind variable waiting called :chart_1.
So no matter what the value of WHICHCHART it will create an on the fly a bind variable with the same name.

Ok. I guess this question was more how do you do this..then OH NO there are not other ways to do this.
So I have a page with a chart region. this chart will have 3 Y Axes which prohibits the use of the default XML.
So..
I have the following Javscript:
function getdata(whichchart) {
  var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=VM_XML_GENERATION',0);
        get.add('WHICHCHART',whichchart);
        gReturn = get.get('XML');
  get = null;
Which is called when the page loads by a dynamic action:
getdata('production');
When the javascript is called as you can see it fires off:
declare
   chart_series_data VARCHAR(32767);
   type array_cols is varray(7) of varchar2(100);
   array array_cols := array_cols('VM_HOSTS_NUM','VM_NUMBER','VM_PHYS_MEM','VM_VIRT_MEM','VM_CPU_COUNT', 'VM_TOTAL_DISK','VM_PROVISIONED_DISK');
BEGIN
--IF :WHICHCHART IS NULL THEN
--RAISE_APPLICATION_ERROR(-20001,'Chart variable not set');
--END IF;
chart_series_data := null;
chart_series_data := '      <data>'||chr(10);
chart_series_data := chart_series_data||  '        <series name="Hosts Number" type="Line" color="0x1D8BD1" >'||chr(10);
for c1 in (SELECT VM_REPORT_DATE LABEL,VM_HOSTS_NUM from TABLE where VM_REPORT_DATE between add_months(SYSDATE,-24) and SYSDATE and lower(VM_DCNAME)=lower(:WHICHCHART) )
loop
chart_series_data := chart_series_data || '<point name="'||c1.LABEL||'" ';
chart_series_data := chart_series_data || 'y="'||c1.VM_HOSTS_NUM||'"></point> '||chr(10);
end loop;
chart_series_data := chart_series_data|| '      </series>'||chr(10)||'</data>';
:PROD_DATA := chart_series_data;
END;
The : production variable at the end of this I want to change the name of based on the value I'm sending of WHICHCHART from the javascript. I hope this is clearer now.
AGAIN this is not really a need. It is a want to be able to create dynamic bind variable names going forward.
Thanks

Similar Messages

  • [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

  • Date Effective SDO and named bind variable

    Hi.
    I have a problem with named bind variable in date effective ADF Business Component (:Bind_SysEffectiveDate).
    Service interface of my EmployeeHistorySDO has next methods:
    getEmployeeHistoryView1
    updateEmployeeHistoryView1
    findEmployeeHistoryView1
    createEmployeeHistoryView1
    deleteEmployeeHistoryView1
    If I invoke getEmployeeHistoryView1 method I'm getting next SQL statement:
    [332] EmployeeHistoryView1 ViewRowSetImpl.doSetWhereClause(-1, SysEffectiveDateBindVar, null)
    [333] EmployeeHistoryView1 ViewRowSetImpl.doSetWhereClause(-1, SysEffectiveDateBindVar, null)
    [334] Column count: 7
    [335] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.doSetWhereClause(-1, SysEffectiveDateBindVar, null)
    [336] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.setWhereClauseParams caused params changed
    [337] EmployeeHistoryView1 ViewRowSetImpl.doSetWhereClause(-1, SysEffectiveDateBindVar, null)
    [338] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.setWhereClauseParams caused params changed
    [339] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.setWhereClauseParams caused params changed
    [340] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.setWhereClauseParams caused params changed
    [341] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.doSetWhereClause(-1, SysEffectiveDateBindVar, null)
    [342] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.setNamedWhereClauseParam(SysEffectiveDateBindVar, null)
    [343] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.doSetWhereClause(-1, fbkKy__0, null)
    [344] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.setNamedWhereClauseParam(fbkKy__0, 3)
    [345] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.setNamedWhereClauseParam(SysEffectiveDateBindVar, 2010-10-01)
    [346] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.doSetWhereClause(-1, SysEffectiveDateBindVar, 2010-10-01)
    [347] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.doSetWhereClause(-1, fbkKy__0, 3)
    [348] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.execute caused params to be "un"changed
    [349] Column count: 7
    [350] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.doSetWhereClause(-1, SysEffectiveDateBindVar, 2010-10-01)
    [351] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.doSetWhereClause(-1, fbkKy__0, 3)
    [352] executeQueryForCollection ViewObject:EmployeeHistoryView_0_findByKey_, RowSet:EmployeeHistoryView_0_findByKey_
    [353] ViewObject: [com.test.sdo.dateeffective.employee.history.EmployeeHistoryView]EmplHistoryAppModule.EmployeeHistoryView_0_findByKey_ close prepared statements...
    [354] ViewObject: [com.test.sdo.dateeffective.employee.history.EmployeeHistoryView]EmplHistoryAppModule.EmployeeHistoryView_0_findByKey_ Created new QUERY statement
    [355] EmployeeHistoryView_0_findByKey_>#q computed SQLStmtBufLen: 403, actual=380, storing=410
    [356] SELECT EmployeeHistory.HISTORY_ID,         EmployeeHistory.POSITION,         EmployeeHistory.WAGE,         EmployeeHistory.EMPL_ID,         EmployeeHistory.START_DATE,         EmployeeHistory.END_DATE FROM EMPLOYEE_HISTORY EmployeeHistory WHERE (EmployeeHistory.HISTORY_ID = :fbkKy__0) AND (:SysEffectiveDateBindVar BETWEEN EmployeeHistory.START_DATE AND EmployeeHistory.END_DATE)
    [357] pStmt = conn.prepareStatement("SELECT EmployeeHistory.HISTORY_ID, EmployeeHistory.POSITION, EmployeeHistory.WAGE, EmployeeHistory.EMPL_ID, EmployeeHistory.START_DATE, EmployeeHistory.END_DATE FROM EMPLOYEE_HISTORY EmployeeHistory WHERE (EmployeeHistory.HISTORY_ID = :fbkKy__0) AND (:SysEffectiveDateBindVar BETWEEN EmployeeHistory.START_DATE AND EmployeeHistory.END_DATE)"); // JBO-JDBC-INTERACT
    [358] Bind params for ViewObject: [com.test.sdo.dateeffective.employee.history.EmployeeHistoryView]EmplHistoryAppModule.EmployeeHistoryView_0_findByKey_
    [359] Binding param "SysEffectiveDateBindVar": 2010-10-01
    [360] // ERROR: Unknown data type oracle.jbo.domain.Date // JBO-JDBC-INTERACT
    [361] pStmt.setObjectAtName(SysEffectiveDateBindVar, "2010-10-01"); // JBO-JDBC-INTERACT
    [362] Binding param "fbkKy__0": 3
    [363] // ERROR: Unknown data type oracle.jbo.domain.Number // JBO-JDBC-INTERACT
    [364] pStmt.setObjectAtName(fbkKy__0, "3"); // JBO-JDBC-INTERACT
    Environment successfully binds today date to :SysEffectiveDateBindVar.
    But if I try to invoke updateEmployeeHistoryView1 method environment binds already the variable that doesn't presents in SQL query, so I have an exception:
    [606] EmployeeHistoryView_1_findByKey_ ViewRowSetImpl.doSetWhereClause(-1, SysEffectiveDateBindVar, 2010-10-01)
    [607] EmployeeHistoryView_1_findByKey_ ViewRowSetImpl.doSetWhereClause(-1, Bind_SysEffectiveDate, 2010-10-01 00:00:00.0)
    [608] EmployeeHistoryView_1_findByKey_ ViewRowSetImpl.doSetWhereClause(-1, fbkKy__0, 3)
    [609] executeQueryForCollection ViewObject:EmployeeHistoryView_1_findByKey_, RowSet:EmployeeHistoryView_1_findByKey_
    [610] ViewObject: [com.test.sdo.dateeffective.employee.history.EmployeeHistoryView]EmplHistoryAppModule.EmployeeHistoryView_1_findByKey_ close prepared statements...
    [611] ViewObject: [com.test.sdo.dateeffective.employee.history.EmployeeHistoryView]EmplHistoryAppModule.EmployeeHistoryView_1_findByKey_ Created new QUERY statement
    [612] EmployeeHistoryView_1_findByKey_>#q computed SQLStmtBufLen: 403, actual=380, storing=410
    [613] SELECT EmployeeHistory.HISTORY_ID,         EmployeeHistory.POSITION,         EmployeeHistory.WAGE,         EmployeeHistory.EMPL_ID,         EmployeeHistory.START_DATE,         EmployeeHistory.END_DATE FROM EMPLOYEE_HISTORY EmployeeHistory WHERE (EmployeeHistory.HISTORY_ID = :fbkKy__0) AND (:SysEffectiveDateBindVar BETWEEN EmployeeHistory.START_DATE AND EmployeeHistory.END_DATE)
    [614] pStmt = conn.prepareStatement("SELECT EmployeeHistory.HISTORY_ID, EmployeeHistory.POSITION, EmployeeHistory.WAGE, EmployeeHistory.EMPL_ID, EmployeeHistory.START_DATE, EmployeeHistory.END_DATE FROM EMPLOYEE_HISTORY EmployeeHistory WHERE (EmployeeHistory.HISTORY_ID = :fbkKy__0) AND (:SysEffectiveDateBindVar BETWEEN EmployeeHistory.START_DATE AND EmployeeHistory.END_DATE)"); // JBO-JDBC-INTERACT
    [615] Bind params for ViewObject: [com.test.sdo.dateeffective.employee.history.EmployeeHistoryView]EmplHistoryAppModule.EmployeeHistoryView_1_findByKey_
    [616] Binding param "SysEffectiveDateBindVar": 2010-10-01
    [617] // ERROR: Unknown data type oracle.jbo.domain.Date // JBO-JDBC-INTERACT
    [618] pStmt.setObjectAtName(SysEffectiveDateBindVar, "2010-10-01");  // JBO-JDBC-INTERACT
    [619] Binding param "Bind_SysEffectiveDate": 2010-10-01 00:00:00.0
    [620] // ERROR: Unknown data type java.sql.Timestamp // JBO-JDBC-INTERACT
    [621] pStmt.setObjectAtName(Bind_SysEffectiveDate, "2010-10-01 00:00:00.0");  // JBO-JDBC-INTERACT
    [622] ViewObject: [com.test.sdo.dateeffective.employee.history.EmployeeHistoryView]EmplHistoryAppModule.EmployeeHistoryView_1_findByKey_ close single-use prepared statements
    [623] pStmt.close(); // JBO-JDBC-INTERACT
    [624] QueryCollection.executeQuery failed...
    [625] java.sql.SQLException: Attempt to set a parameter name that does not occur in the SQL: Bind_SysEffectiveDate
         at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
         at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:199)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:263)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:271)
         at oracle.jdbc.driver.OraclePreparedStatement.setObjectAtName(OraclePreparedStatement.java:11178)
         at oracle.jdbc.driver.OraclePreparedStatementWrapper.setObjectAtName(OraclePreparedStatementWrapper.java:815)
         at weblogic.jdbc.wrapper.PreparedStatement_oracle_jdbc_driver_OraclePreparedStatementWrapper.setObjectAtName(Unknown Source)
         at oracle.jbo.server.OracleSQLBuilderImpl.bindParamValue(OracleSQLBuilderImpl.java:4655)
         at oracle.jbo.server.BaseSQLBuilderImpl.bindParametersForStmt(BaseSQLBuilderImpl.java:3645)
         at oracle.jbo.server.ViewObjectImpl.bindParametersForCollection(ViewObjectImpl.java:19288)
    In Fusion Developer's Guide for Oracle Application Development Framework 11g Release 1 (11.1.1) at chapter 5.2 says that environmnet uses :Bind_SysEffectiveDate bind variable for passing effective date for Date Effective Business Components. But I see that in my case :SysEffectiveDateBindVar bind variabe is used for get method and both variables are used in update method.
    Why environment trying to bind :Bind_SysEffectiveDate if only :SysEffectiveDateBindVar is present in the query ? How can I solve this problem ?
    I'm using
    Oracle JDeveloper Studio Edition Version 11.1.1.3.0
    WebLogic Server Version: 10.3.3.0
    Oracle SOA Suite 11.1.1.
    Edited by: user2975420 on 01.10.2010 6:26

    As I understood ApplicationModule.EFF_DT_PROPERTY_STR is used to pass the value of SysEffectiveDate. This means that this value will bind to variable that present in query filter (:Bind_SysEffectiveDate).
    If this property is not set, the current date value binds to :Bind_SysEffectiveDate variable.
    But the reason of my problem is another.
    When I create date effective entity and date effective view object for this entity the query of VO is next (I see this query in query editor in JDeveloper):
    SELECT EmployeeHistory.HISTORY_ID,
    EmployeeHistory.POSITION,
    EmployeeHistory.WAGE,
    EmployeeHistory.EMPL_ID,
    EmployeeHistory.START_DATE,
    EmployeeHistory.END_DATE
    FROM EMPLOYEE_HISTORY EmployeeHistory
    WHERE (:Bind_SysEffectiveDate BETWEEN EmployeeHistory.START_DATE AND EmployeeHistory.END_DATE)
    But when I invoke getEmployeeHistoryView1 method of view object service interface, the query which I see in log is next:
    SELECT EmployeeHistory.HISTORY_ID,
    EmployeeHistory.POSITION,
    EmployeeHistory.WAGE,
    EmployeeHistory.EMPL_ID,
    EmployeeHistory.START_DATE,
    EmployeeHistory.END_DATE
    FROM EMPLOYEE_HISTORY EmployeeHistory
    WHERE (EmployeeHistory.HISTORY_ID = :fbkKy__0)
    AND (:SysEffectiveDateBindVar BETWEEN EmployeeHistory.START_DATE AND EmployeeHistory.END_DATE)
    Bind variable for SysEffectiveDate has *:SysEffectiveDateBindVar* name now instead of *:Bind_SysEffectiveDate*. But method invokes successfully.
    When I invoke updateEmployeeHistoryView1 environmet already tryes to bind *:Bind_SysEffectiveDate* variable that doesn't present in query. So I have exception:
    java.sql.SQLException: Attempt to set a parameter name that does not occur in the SQL: Bind_SysEffectiveDate
    I'm not understanding why environment binds :Bind_SysEffectiveDate parameter which doesn't present in query.

  • Is there a way the user can change the equation in the formular node from the front panel on the fly, dynamically?

    Is there a way the user can change the equation in the formular node from the front panel on the fly, dynamically?

    Sorry, I don't think so. That would be pretty cool if you could create a property node for a formula node and then enter a formula on the front panel and use it to update the formula. But you can't create a property node for a formula node and the only way of modifying the formula is by typing it into the formula node on the diagram. And you can't modify a diagram of a running VI.
    You could create a VI which is only a formula node with the maximum number of inputs and outputs you expect. Have a button on the calling VI to Edit Formula. When the button is pressed, use a VI server to display the front panel on the formula VI, display a dialog box telling the user how to display the diagram of the formula VI, then stop the calling VI. (You can't edit a sub-VI while t
    he calling VI is running). The user will then need to rerun the calling VI to use the new formula.
    You might be able to do something by calling MatLab or something like that to get an interactive formula window.

  • Is there a way the user to change the equation in the formular node from the front panel on the fly, dynamically?

    Is there a way the user to change the equation in the formular node from the front panel on the fly, dynamically?

    Try the Parser VIs (also known as LV Mathematics VIs, or simply GMath VIs) located under the Analyze>>Mathematics palette (not in the Base package). You might want to start with the "Eval Formual Node.vi" located in the Analyze>>Mathematics>>Formula palette. There are many differences between these G-based, dynamic formula VIs and the LabVIEW formula node, but these VIs often prove quite useful when your formula changes on the fly. For more detail on the differences, see the LabVIEW Help file (Cntrl-Shift-? from within LabVIEW) under the topic "Mathematics VIs, parser differences with Formula Node".

  • Same Oracle Bind Variable Name in 2 VOs not permitted?

    Hi,
    JDeveloper Studio Edition Version 10.1.3.3.0.4157
    I have 2 different Entity based VOs, those VO's use similar Entities but their WHERE is clause is different, one VO doesn't extend the other one.
    I have used Oracle (first time use for me) named bind type variables with identical names in both where clause.
    When I try to define a bind variable ex. TariffIdParam in the second VO the wizard shows me an error:
    Variable name is a reserved word or a variable or attribute of the given name already exists ...
    Does that mean that an Oracle Bind Variable Name must me unique in the whole application?
    Partial where clause:
    VO1
    DeliveryDetailGroup.DELIVERY_TARIFF_ID = :TariffIdParam
    VO2
    DeliveryDetailGroup.DELIVERY_TARIFF_ID = :TariffIdParam
    Thanks
    Fred

    I created the second VO by using "File save as".
    To resolve the problem in the new xml file I replaced the references to the other VO.
    Regards
    Fred

  • Report failed to parse SQL query:ORA-01745: invalid host/bind variable name

    Hi,
    We are currently upgrading from v2.2.0.00.32 to v4.0.0.00.46.
    I have copied the applications onto our test server along with the various database objects and data etc.
    When I am running a report in v4, it is failing with the following error: "failed to parse SQL query: ORA-01745: invalid host/bind variable name".
    When I copy the SQL that builds the report into TOAD (on out test server) it runs OK so really cant see why it would fail in APEX. It works fine when I run the query in our APEX v2 and in TOAD in our live server.
    The query is as follows:
    SELECT
    aea.ALTERATION_ID
    ,aea.ALTERATION_ID "ALTERATION_ID_DISPLAY"
    ,aea.assembly_name "Revised BOM"
    ,assembly.description "Revised BOM Description"
    ,assembly.INVENTORY_ITEM_STATUS_CODE "Revised BOM Status"
    ,aea.BEFORE_CHANGE_QTY
    ,flv.MEANING "Alteration Type"
    ,aea.component_name "Part No"
    ,component.description "Part No Description"
    ,component.INVENTORY_ITEM_STATUS_CODE "Part No Status"
    ,aea.AFTER_CHANGE_QTY
    ,TO_CHAR(aea.last_update_date,'DD-MM-YYYY HH24:MI:SS')"Last Update Date"
    ,aea.LAST_UPDATE_BY
    ,aea.COMMENTS
    ,aea.ORACLE_CHANGE_NOTICE
    ,AEA.SELECTION_CRITERIA
    FROM XXMEL_APEX_ECO_ALTERATIONS aea
    , fnd_lookup_values flv
    , (SELECT INVENTORY_ITEM_STATUS_CODE
    ,segment1
    ,description
    FROM mtl_system_items_b
    WHERE 1=1
    AND organization_id = 26) component
    , (SELECT INVENTORY_ITEM_STATUS_CODE
    ,segment1
    ,description
    FROM mtl_system_items_b
    WHERE 1=1
    AND organization_id = 26) assembly
    WHERE 1=1
    AND aea.COMPONENT_NAME = component.segment1 (+)
    AND aea.assembly_NAME = assembly.segment1 (+)
    AND flv.lookup_code = aea.acd_type
    AND aea.eco = :P13_ECO
    AND flv.lookup_type = 'ECG_ACTION'
    AND modify_flag = 'Y'
    ANy help would be great,
    Thanks
    Chris
    Edited by: Cashy on 22-Nov-2010 04:13
    Edited by: Cashy on 22-Nov-2010 04:14

    For some reason, the updatable fields (this is a updateable report) where not connecting to the database properly. Whn I changed them to a report columns and removed the database field reference, the report rendered

  • How to execute a function and return the result into a bind variable

    Hi,
    I am trying to calculate the sum of salaries of all persons with a particular JOB_ID using a function TOTAL_INCOME(v_job_id).
    create or replace function total_income
    +(v_job_id IN varchar2)+
    RETURN number IS
    v_total number(6);
    cursor get_sal is
    select salary from employees
    where job_id = v_job_id;
    BEGIN
    v_total := 0;
    for emp in get_sal
    loop
    v_total := v_total emp.salary;+
    end loop;
    dbms_output.put_line('Total salary of '||v_job_id||' is: '|| v_total);
    return v_total;
    END;
    Now I woud like to execute this function and assign the returned value into a bind variable test_sal
    variable test_sal number(6)
    SELECT total_income('AD_VP') into :test_sal FROM DUAL;
    dbms_output.put_line('Total Sal:'||:test_sal);
    This is returning the below errors:
    SELECT total_income('AD_VP') into :test_sal FROM DUAL
    *+
    Error at line 0
    ORA-01036: illegal variable name/number
    dbms_output.put_line('Total Sal:'||:test_sal);
    Error at line 3
    ORA-00900: invalid SQL statement
    Could someone help me what could be the problem?? Thanks for your time...

    Dear,
    If everything you will do will be done inside PL/SQL (stored procedure or stored function) then you don't have to care about bind variable.
    When using PL/SQL (static SQL) you will never encounter issues related to bind variables. PL/SQL itself takes care of your code and uses bind variables behind the scene.
    The only situation where you have to look carefully to the use of bind variables within PL/SQL is when you use Dynamic sql into stored procedures or functions.
    So, see in the light of the above comment, if you have to care about returning your function into a bind variable?
    Best regards
    Mohamed Houri

  • Dynamic default bind variable

    Hi!
    I have a bind variable in a view object, where i want the default variable to be a text version of now (timestamp) in the format 'dd-mm-yyyy HH:mm'.
    I have tried to look at a solution using Groovy Expression, but I cannot figure out how to do it.
    Please HELP!!!! :-)
    /Casper

    Hi,
    You can create a method in your viewObject implementation class and retrieve the value from there, using groovy.
    I have used something similar to retrieve a dynamic parameter in an Entity validator.
    Have a look here: http://www.gabrielsideras.com/2010/10/03/groovy-display-dynamic-error-message-in-validator/
    and here: http://formattc.wordpress.com/2010/04/02/custom-java-bind-variable-in-a-where-clause-of-an-adf-view-object/
    Gabriel.

  • How to compare the value of a binding variable with a string "HOLD" ......?

    Hi All,
    I have two tables - TABLE1 & TABLE2 and both the tables are having STATUS column. The requirement is like if the STATUS column of TABLE1 is updated as "HOLD" then the same value has to be updated to the STATUS column of TABLE2.
    create or replace trigger "TEST_TRG"
    BEFORE
    update of "STATUS" on "TABLE1"
    for each row
    begin
    if(:new.STATUS ='HOLD')then
    insert into TABLE2 (STATUS)
    value (:new.STATUS);
    end if;
    end;
    COMPILATION ERROR:
    Compilation failed, line 3 (02:40:14) The line numbers associated with compilation errors are relative to the first BEGIN statement. This only affects the compilation of database triggers.
    PLS-00103: Encountered the symbol "{" when expecting one of the following: ( begin case declare exit for goto if loop mod null pragma raise return select update while with <an identifier> <a double-quoted delimited-identifier> <a bind variable> << continue close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe purge The symbol "{" was ignored. Compilation failed, line 7 (02:40:14) The line numbers associated with compilation errors are relative to the first BEGIN statement. This only affects the compilation of database triggers.
    PLS-00103: Encountered the symbol "}" when expecting one of the following: ( begin case declare else elsif end exit for goto if loop mod null pragma raise return select update while with <an identifier> <a double-quoted delimited-identifier> <a bind variable> << continue close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe purge The symbol "}" was ignored.
    I am getting the compilation errors as above when the trigger is compiled. Can anyone please help me to correct it.
    Thanks and Regards,
    Suhas

    CREATE OR REPLACE TRIGGER "TEST_TRG"
       BEFORE UPDATE OF "STATUS"
       ON "TABLE1"
       FOR EACH ROW
    BEGIN
       IF (:NEW.status = 'HOLD')
       THEN
          INSERT INTO table2
                      (status
               VALUES (:NEW.status
       END IF;
    END;You should learn how to write PL/SQL code.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    http://apex.oracle.com/pls/apex/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • Change the description dynamically for formula variable in Bex

    Hi Everyone ,
    I need to change the description of my formula variable that i have created in coulmns.
    My requirement is as follows:
    Depending on the date it must show for next 5 days . So i have created 5 formulas and i need to change the description dynamically.
    22 july 2013
    23 july 2013
    24 july 2013
    25 july 2013
    26 july 2013
    XXX
    XXX
    XX
    XXXX
    XXXX
    Please help me in this.
    Thanks in Advance.
    JC

    Hi,
    Please follow this doc to create text variables to display texts dynamically.
    http://scn.sap.com/docs/DOC-11187
    Regards,
    Suman

  • About dynamically setting bind variable in LOV View

    Hi,
    I have a LOV VO for an af:SelectOneChoice field in the page.
    The LOV is depended on an SQL statement in which there is a bind variable in the where clause.
    When I open the page, I set the bind variable by using VO.setNamedWhereClauseParam in the prepareSession method in the application module, followed by VO.executeQuery();
    The problem is, the af:SelectOneChoice is blank. Why?
    If I do not use the bind variable in the SQL, I can see rows in the af:SelectOneChoice field.
    When is the proper time to populate the LOV? And where should I put the code for populating the LOV?
    I am sure that the VO is populated, because after I executeQuery, there are many rows in the VO.
    Thanks
    Stephen
    null

    Hi Franky,
    Yes, when I set a default value for the bind variable, everything is OK.
    But I want the bind variable dynamically be set when the AM is initiated. Is there a way to do that?
    Stephen

  • Create on-the-fly menu in JSC 2

    Hi everyone,
    How to create an on-the-fly menu in JSC 2? the on-the-fly menu is something like the menu bar on this Sun Developer Netowork page. When you move a mouse over a link such as APIs, Downloads, and Technologies, there is a menu shown up.
    A sample code would be perfect.
    Thanks in advance,

    The Sun Developer Network page uses javascript to display on-the-fly menus.
    Browsers usually provide ways to view the source code of any HTML page. The instructions to view them will of course vary for different browsers. For mozilla1.4, You can do 'View | Page Source' to see which javascripts are used. You can also select the 'View | Page Info' menuitem, select the 'Privacy' tab and expand 'Scripts' to get the URLs of the scripts used in that page.
    The menucode used in Sun Developer Network page is http://forum.sun.com/jive/js/menucode.js.
    The following are the resources suggested by mozilla.org for javascript:
    http://www.mozilla.org/js/
    http://www.mozilla.org/js/scripting/
    You can of course obtain a lot of free javascripts from the web; for dynamic menus you might want to check out 'http://www.softcomplex.com/products/tigra_menu/'

  • ProC: DESCRIBE INPUT not generating the correct no of bind variables

    Hi
    I'm having an issue with ProC using the ANSI dynamic SQL where after using DESCRIBE INPUT to full the descriptor with the bind variable information, the subsequent call to GET DESCRIPTOR... :bind_count = COUNT returns 0. The SQL statement is a select along the lines of: select col_01 from tab_01 where col_02 = :bind_var.
    Any idea on what the issue could be?
    Dale

    Forgot to add:
    If I attempt to OPEN the CURSOR, I get ORA-01008: not all variables bound. If I force the code to assume there is 1 bind variable (as the select in question has one), when I then assign the c variable to the DESCRIPTOR I get SQL-02122: Invalid OPEN or PREPARE for this database connection.
    The AT command has been used where it is required and the correct connection is specified for each occurance of the AT in the various embedded EXEC SQL statements.
    Dale

  • Please create "on-the-fly change search engine" option ALSO for when we mark [word] in a text, then right-click, then choose "Search [engine x] for [word]"?

    In Firefox 34, you have changed the search bar.
    The new style is perfect for those who always starts by typing in, letter for letter, the search term.
    People such as myself, we almost never type in the search term,
    but instead we mark a [word] in a text, right-click this marked [word], then select "Search [engine x] for [word]".
    Speaking for myself, I have now a total of 36 search engine providers, but I usually only use 7 of those.
    I use "Wikipedia (English)" most of the time..
    - but then I will switch to e.g. "AniDB" and use that one for 1 hour..
    - or switch to "Google" and use that one for 30 minutes..
    - or switch to "Wikipedia (Norwegian)" and use that one for 2 hours..
    - or switch to "Wiktionary (English)" and use that one for 15 minutes..
    ..and then I will switch back to "Wikipedia (English)" again.
    The way the search bar was in Firefox 33 and earlier, I could very easily switch the default search engine.
    Just one click to open the drop-down menu, then choose one.
    In Firefox 34, I have to choose "Tools" -> "Options", the "Search" tab..
    - before I can THEN click to open the drop-down menu.
    4 clicks instead of 1, that's like 400% more work..!
    Also, the fact that I have to go into "Options".. make this..
    ..I don't know how to put it, it's a kind of psychological barrier that I have to overcome each time.
    I mean, before Firefox 34, I went to the "Options" window like maybe 4 times each YEAR,
    now, I have to go there 4 times each DAY..!
    I am not saying you should revert to the old style Search bar,
    as I feel that those you are typing search terms are indeed very happy for this new style..
    Instead, I think of 2 possible ways to create happiness also for us that do mark text and choose "Search.."
    1) An "on-the-fly change search engine" option ALSO for when we mark [word] in a text, then right-click, then choose "Search [engine x] for [word]".
    This could work as a cascading menu option, where it says..
    Search for [word] in -> [engine x]
    ..and where [engine x] was the current default engine, and all the other engines was listed underneath,
    just like the drop-down menu when you switch the default engine.
    Additionally, you could have an on / off checkbox in the "Options" "Search" tab, where you had this option:
    "Change default search engine when choosing another from the drop-down menu"
    THIS would actually be PERFECT.. It would be even much BETTER than in Firefox 33 and earlier..! :-)
    2) If there are things with the first option that don't work (something I've missed etc),
    then maybe you could have an on / off checkbox in the "Options" "Search" tab, where you had this option:
    "Use old-style search bar"
    This would be off by default, but when switched on, it would give us the old Firefox 33 style Search bar.

    Strongly recommend Context Search extension which will solve your problem
    - https://addons.mozilla.org/en-US/firefox/addon/context-search/?src=search

Maybe you are looking for

  • Edit Polygon Path in Acrobat 9 Pro

    Can I edit a pre-existing polygon path in Acrobat 9 Pro (add/delete points)   I cannot find the menu which would alloe me to do this.

  • Making an HTML email in iMail?

    Hello, Does anyone know if any of the Apple programs will allow for creating an HTML email and sending thru iMail? For instance, I tried to create a "pretty" document in Pages (like a newsletter) and can only get it to attach as a PDF. I'd like to id

  • Dependents in Benefits

    Hi All, I am new to benefits, I have to develop an interface in which i need to send employee as well as dependents data for the plans for which they are enrolled on a particular date, Can anyone please tell me how to fetch the dependents(in infotype

  • Cp-1251 utf-8 converting: problems with russian letters

    Hello every one! I have faced a major problem in cp-1251 to utf8 string convertion (in Windows): String result2 = new String(result.getBytes("utf8"), Charset.forName("cp-1251"));Everything works fine, but there is a problem with russian letter И (10t

  • DPM 2010 agent installation on Domain Controller

    Hello all, recently I tried to install the agent from my DPM 2010 server onto a Win2K8 Domain controller which failed (used a Domain Admin's credientials for the install, and on trusted domain). I remember in DPM 2007 you needed to install the agent