Query on VO's parameter

Hi everyone,
I've created a VO similar to script below. Problem is I just can't execute the query.
SELECT xx.full_name
      ,xx.employee_number
      ,xx.person_id
From xx
START WITH xx.person_id       = :1
CONNECT BY PRIOR xx.person_id = xx.supervisor_idAn oaexception occured saying not all variables bound when I try to use it as LOV.
Thanks for any assistance,
Elmer

Hi Elmer,
I don't find any error in it. However i tried to do the same on my system and I am able to execute the query and getting no error at all.
Here is what I did in process request of the controller by creating VO at runtime and setting its whereclause dynamically.
ViewObject viewobject = pageContext.getApplicationModule(webBean).findViewObject("ObtainScoDetails");
if(viewobject == null)
String s14 = " SELECT papf.full_name, papf.employee_number, papf.person_id From per_all_people_f papf START WITH papf.person_id =:1 CONNECT BY PRIOR papf.employee_number = papf.person_id";
viewobject = am.createViewObjectFromQueryStmt("ObtainScoDetails", s14);
String person_id ="21";
viewobject.setWhereClauseParams(null);
viewobject.setWhereClauseParam(0, person_id);
pageContext.writeDiagnostics("Anil", "Above Query Executed of New VO", 1);
viewobject.executeQuery();
viewobject.reset();
viewobject.next();
pageContext.writeDiagnostics("Anil", "Query Executed of New VO"+viewobject.getQuery(), 1);
pageContext.writeDiagnostics("Anil", "Query Executed of New VO"+viewobject.getCurrentRow().getAttribute(0), 1);
pageContext.writeDiagnostics("Anil", "Query Executed of New VO"+viewobject.getCurrentRow().getAttribute(1), 1);
pageContext.writeDiagnostics("Anil", "Query Executed of New VO"+viewobject.getCurrentRow().getAttribute(2), 1);
Thanks
--Anil                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • How to pass mysql query id through url parameter to a detail page

    Hi there,
    I am a newbie to JSP and I am trying to pass a url parameter to a detail page so that it will query a mysql data query to show the details of that query. How can I write the query on the details page so that it will display the query results on the page. eg select * From data Where = "passed_url parameter_ value". Please i need urgent help on this please.

    <Acknowledged>
    which should be strongly cautioned against even for "newbies".
    </Acknowledged>
    Right, but the code you posted will "work" in a very harmful wayNot always, I used normal Statements last year and I had no problems.
    Even with pretty capible code brakers trying to cause $h!t with my application.
    Just check for invalid datatypes, and for SQL Injections remove stuff like ' or replace with `
    But yes PStat... are the better way.

  • Count number of columns in query passed as PLSQL parameter

    Hi All,
    I am using a PLSQL package to generate excel file in a Database directory, to generate file i am passing sql query and number of columns manually in a parameter.
    Now i want to automate it and do not want to pass "Number of Columns" as parameter.
    HOW CAN I CALCULATE NUMBER OF COLUMNS IN PASSED QUERY.
    Note: query can contain functions ( to get description or any other data)
    Many Thanks in advance

    http://saubbane.blogspot.com/2011/01/how-to-find-column-count-of-query.html
    Along with Re: Dynamic Fetch on dynamic Sql and just below this post, Blushadow's original run_query (from which I nicked!).

  • Query on File() constructor parameter

    I have a query on the File(String pathname) constructor.
    Could anyone advise me why its parameter is the pathname? Is the pathname has included the file's name?
    String mypahtname = "c:\\folder\\";
    String myfilename = "abc.txt";
    String mystring = mypathname + myfilename;
    File myfile = new File(mystring);The above is working. However, the parameter is not the pathname. Why is it working?

    A File object in Java may point to either an actual file, or a directory. So the final member of the path String parameter may be either a file or directory.
    Read the first paragraph here
    http://java.sun.com/javase/6/docs/api/java/io/File.html

  • Using "Object from this query" as a filter parameter

    Hi Folks,
    I am looking to find a solution to a requirement where I need to filter data in a report based on the current year. I do not want to use the BEx functionality for filtering and want to leverage the BObj query filters. My idea was to create a "variable" in the BObj query to get the current year and hopefully use that as a filter parameter for 'Object in this query". But The options "Object in this query" and "Result from another query" are greyed out. I am using BObj 4.0 patch 12.
    Do any of you have suggestions on how to accomplish this.
    Regards,
    Doniv

    Hi,
    prerequisite to using the operators you mention is to have 2 dataproviders queries first.
    However, it might be that those kind of operators aren't implemented for the current BICS interface, same goes with Unions, OR operator.
    I know you can do this with Relational UNX, but BEX direct access has shortcomings in the query panel.
    might be worth to try this again if you can get your hands on FP03 ramp up.  things change again , for the better, there.
    Regards,
    H

  • Named Query / MaxRows-Value as Parameter?

    Hello!
    Í'm using Toplink 10.1.2 with named queries.
    How can I set "maxRows" as additional parameter for a named query?
    eg.
    ReadAllQuery raq = new ReadAllQuery(MyBean.class);
    ExpressionBuilder eb = new ExpressionBuilder();
    raq.addArgument("searchString")
    raq.setMaxRows( ... ) ==> should be an int - value.
    regards
    Harald.

    Query arguments can only be used in the selection criteria, not as maxRows or other query properties.
    It may be best to use a dynamic query for this operation, or define multiple named queries for the query with different maxRow options if there are a fixed amount.
    You can also define a QueryRedirector on the named query to allow execution of a dynamic query in place of the name query.

  • HR Create Standalone Query Integrator - LOV as parameter type?

    Hi
    Our customer wants to download data from a view with filters on various fields. We accomplished this using a download integrator and created restrictions via Standalone Query with various where clause parameters to the view(using HR Create Standalone Query Integrator). While this addressed customer's requirement they are seeing lot of users entering wrong data for the parameter value and causing bad SQLs hitting the database. Customer wants to make sure they dont let end users enter the wrong values in the run time parameter and requesting to make the parameter prompt value to be a LOV type where they are forced to choose one of the valid value.
    Example:
    Integrator Name - AP_INVOICE
    SQL Where Clause – where invoice_type=$PARAM$.invoice_type
    1st Parameter Name – invoice_type
    1st Parameter Type – Varchar2
    1st Parameter Prompt– Invoice Type Equals
    Customer wants this Invoice type parameter values to be shown in a drop down list so that end user is forced to pick the valid value and download the data. How to accomplish this? Appreciate your guidance.
    Thank you.

    DECLARE
    ln_number NUMBER := 1;
    BEGIN
    BNE_PARAM_DEFNS_PKG.UPDATE_ROW (
      X_APPLICATION_ID => 800,
      X_PARAM_DEFN_CODE =>'PER_BUS_GRP_ID',
      X_OBJECT_VERSION_NUMBER => ln_number,
      X_PARAM_NAME => 'PER:BUS_GRP_ID',
      X_PARAM_SOURCE =>'HR:Download',
      X_PARAM_CATEGORY => 5,
      X_DATATYPE =>1,
      X_ATTRIBUTE_APP_ID => NULL,
      X_ATTRIBUTE_CODE => NULL,
      X_PARAM_RESOLVER => NULL,
      X_DEFAULT_REQUIRED_FLAG => 'N',
      X_DEFAULT_VISIBLE_FLAG =>'Y',-- changed from 'Y' to 'N'
      X_DEFAULT_USER_MODIFYABLE_FLAG =>'Y',
      X_DEFAULT_DATE => NULL,
      X_DEFAULT_NUMBER => NULL,
      X_DEFAULT_BOOLEAN_FLAG => NULL,
      X_DEFAULT_FORMULA => NULL,
      X_VAL_TYPE => 2,
      X_VAL_VALUE =>'XXC_HR_ALL_BG',
      X_MAX_SIZE => 240,
      X_DISPLAY_TYPE => 3,
      X_DISPLAY_STYLE =>1,
      X_DISPLAY_SIZE => 240,
      X_HELP_URL => NULL,
      X_FORMAT_MASK => NULL,
      X_USER_NAME => 'APPS',
      X_DEFAULT_STRING => NULL,
      X_DEFAULT_STRING_TRANS_FLAG =>NULL,
      X_DEFAULT_DESC => NULL,
      X_PROMPT_LEFT => 'Business Group Name',
      X_PROMPT_ABOVE => 'Business Group Name',
      X_USER_TIP => 'Enter Business Group Name',
      X_ACCESS_KEY => NULL,
      X_LAST_UPDATE_DATE => SYSDATE,
      X_LAST_UPDATED_BY => -1,
      X_LAST_UPDATE_LOGIN => -1
    dbms_output.put_line('Value of Object Version Number is : '|| ln_number);
    exception
    when others then
    dbms_output.put_line(SQLERRM);
    end;Edited by: 936671 on Jul 4, 2012 10:51 AM

  • Sub Query selection based on parameter value selected

    I have a parameter, and based on the value selected, I want to run one of two queries. I thought I could do either an IF THEN ELSE, or a CASE, but neither seem to be working.
    What I'm trying to do is this:
    IF parameter_value = 338 THEN
    (RUN THIS SELECT QUERY)
    ELSE
    (RUN THIS SELECT QUERY)
    END IF
    or
    SELECT CASE WHEN parameter_value = 338 THEN (RUN THIS SELECT QUERY)
    ELSE (RUN THIS SELECT QUERY)
    END X
    I'm getting errors with both. For the CASE statement, it says "too many values". For the IF statement, it just says "invalid SQL statement".
    Any suggestions would be appreciated.
    Thanks.

    Looks like this is what you want
    SQL> WITH T
      2       AS (SELECT LEVEL col
      3             FROM DUAL
      4           CONNECT BY LEVEL <= 5)
      5  SELECT *
      6    FROM T;
           COL
             1
             2
             3
             4
             5
    SQL>
    SQL> VARIABLE parameter_value    NUMBER
    SQL> EXEC    :parameter_value := 338;
    PL/SQL procedure successfully completed.
    SQL>
    SQL> WITH T
      2       AS (SELECT LEVEL col
      3             FROM DUAL
      4           CONNECT BY LEVEL <= 5)
      5  SELECT col
      6    FROM T
      7   WHERE col = DECODE (:parameter_value, 338, col, :parameter_value);  --- If 338 then select all if not 338 select only the one with parameter_value.
           COL
             1
             2
             3
             4
             5
    SQL>
    SQL> EXEC :parameter_value := 2;
    PL/SQL procedure successfully completed.
    SQL>
    SQL> WITH T
      2       AS (SELECT LEVEL col
      3             FROM DUAL
      4           CONNECT BY LEVEL <= 5)
      5  SELECT col
      6    FROM T
      7   WHERE col = DECODE (:parameter_value, 338, col, :parameter_value);
           COL
             2
    SQL>
    SQL> EXEC :parameter_value := 3;
    PL/SQL procedure successfully completed.
    SQL>
    SQL> WITH T
      2       AS (SELECT LEVEL col
      3             FROM DUAL
      4           CONNECT BY LEVEL <= 5)
      5  SELECT col
      6    FROM T
      7   WHERE col = DECODE (:parameter_value, 338, col, :parameter_value);
           COL
             3
    SQL> You need to use following where clause in your query
    WHERE column_name = DECODE (parameter_value, 338, col, parameter_value); -- replace the column_name with name of the column you are comparing against.G.
    Edited by: G. on Mar 8, 2011 3:36 PM
    formatted and added comments

  • Query option in report parameter

    I've created a report with a bind variable.
    When I run the parameter form, I see "Query options" and the filed for my bind variable.
    Obviously I'm missing something, but where can I change the font (color and typeface) of the text "Query options"
    Ton

    What values are you passing for &p_emp?
    SQL> select * from hr.employees where &p_emp;
    Enter value for p_emp: rownum <=5
    old   1: select * from hr.employees where &p_emp
    new   1: select * from hr.employees where rownum <=5
    EMPLOYEE_ID FIRST_NAME           LAST_NAME                 EMAIL                     PHONE_NUMBER         HIRE_DATE           JOB_ID   
            100 Steven               King                      SKING                     515.123.4567         17-06-1987 00:00:00 AD_PRES
            101 Neena                Kochhar                   NKOCHHAR                  515.123.4568         21-09-1989 00:00:00 AD_VP    
            102 Lex                  De Haan                   LDEHAAN                   515.123.4569         13-01-1993 00:00:00 AD_VP    
            103 Alexander            Hunold                    AHUNOLD                   590.423.4567         03-01-1990 00:00:00 IT_PROG
            104 Bruce                Ernst                     BERNST                    590.423.4568         21-05-1991 00:00:00 IT_PROG
    5 rows selected.
    SQL> select * from hr.employees where &p_emp;
    Enter value for p_emp: 1
    old   1: select * from hr.employees where &p_emp
    new   1: select * from hr.employees where 1
    select * from hr.employees where 1
    ERROR at line 1:
    ORA-00920: invalid relational operatorKeep in mind:
    Report Builder-related questions can be posted @ the Reports forum: Reports

  • How to query from view with parameter, only  when the JSP-page loading

    I use JSF/ADF BC, create two viewes:view1 and view2, in the JSP page the user press a button to query from the view1, but I hope the view2 can be queried only when the page loading, it have no relation with user-operator, and pass the column value of view2 into some variables, the view2 return one record.

    Hi -
    You may want to have a look at this other thread:
    Re: Execute ViewObject with Parameters at JSF Page Load?  JSF/ADF/BC 10.1.3
    John

  • Error while trying to choose query parameter Inconsistent input paramete

    I got error on PRD while trying to choose parameter before executing BEX query:
    101 Inconsistent input parameter (parameter: <unknown>, value <unknown>)
    100 Program error in class SAPMSYY1 method: UNCAUGHT_EXCEPTION
    Notes:
    the same functionality works fine in DEV environment.
    the other parameters on query in PRD work fine
    the parameter  with error based on custom hierarchy
    P.S. I heart BEx :]

    Hello,
    This problem has been solved before with notes 1236774, 1151320 & 1264213.
    Please check.
    Thanks,
    Michael

  • OWL with Default Set containting Current Date as query parameter

    Hello Everybody,
    I have a custom BO which mainly consists of a name and a time period (start and end date).
    Now I'd like to create a Default set like
    "Give me all objects with today between start and end date."
    I already tried the following:
    Filling a field using UI-Scripting:
    $data.UIState.Today = $controller.DateTimeUtils.DateNow;
    Copy the field into the search parameter
    executing the query with this search parameter.
    However, I using this approach, I only managed to search for objects matching exactly todays date, but not using greater/lower comparators.
    Furthermore I also searched for a field transformation giving me the current date but did not succeed.
    Does anyone have any ideas how to achieve this or how to get one of the above ideas to work?
    Best regards,
    Ludger

    Hello Ludger,
    That`s what I expected: The fields do not define the interval.
    Therefore you need to define it by yourself via this "less or equal".
    What you can do in the UI Designer at the query definition is to provide an interval
    For the field "CurrentDate" provide
    - SelectOption = "between"
    - Low Value = your start date
    - High Value = your end date
    - Select Option = "include"
    HTH,
        Horst

  • SQL query editor and "like" with a parameter (can't get it to work).

    I've been following all sorts of directions on how to use mysql a table and modifying the query to accept a parameter, funny thing is no matter how I try to construct the simplest query, the query editor does not parse the query properly when using the "LIKE" statement.
    Using 3.11 and/or 3.12 of the J/connector with no success.
    I am using a query that resembles the following:
    select all table.fieldname, table.fieldname2 from tablename where table.fieldname like '%?%'
    It parses correctly but the code when run can not find the parameter as it reports the number of paramenters as being incorrect.
    I have tried these varriations of the "like" statement.
    '%?%' - expected this to work, it parses correctly but errors out claiming invalid number of parameters.
    %?% - without quotes causes parsing errors.
    '?' - parses correctly but isn't the correct query.
    ? - again without quotes causes parsing errors,even if it did it isn't the correct query.
    If I set the query to use a value instead of a parameter - it works fine.
    Hints? Suggestions? Bug?
    Thanks in advance.

    Hmm, try use
    select ... like ?
    And path this kind of string as the parameter to your query
    String findCriteria = "what you are looking for";
    String parameter = "'%" + findCriteria + "%'";Roman.

  • Pass parameter to Bex Query via Query String

    Hello,
    I am trying to pass a parameter into a Bex Query from a 7.0 portal. I created a Bex query iView and I have tried various permutations with the Bex Query String property of the iview but nothing seems to work. The query runs but the parameter is not passed in.
    For example I have tried: cmd=ldoc&TEMPLATE=Z_TEMPLATE&QUERY=Z_QUERY&Z_QUERY_VARIABLE=12345678 and several other variations of doing this.
    Thanks,
    Bert

    Hi Satish,
    I had already tried that but it did not work.
    Thanks,
    Bert

  • Parameter in Query manager running stored procedure

    Hi Experts!
    I have a stored procedure, which is waiting a parameter.
    I would like to write a query in sap with parameter using sap language:
    exec sp_leltar [%0]
    The parameter is numeric, but when running the query above, it is giving an error:"Userdefined errors".
    Any idea?Thats not a way to write the parameter value on editor field.

    I have tried to run the following:
    select from dbo.omaleltfej t0/
    declare @leltid numeric OUTPUT
    /* where*/
    set @leltid = /* t0._leltfejid */ [%0]
    exec omaleltareredmeny2 @leltid
    Error message:"...Can not use the output option in declare or create function statement..."
    I gave up to solve it, because this is not an SAP table, it is not possibble to do.
    Thank you for your effort.

Maybe you are looking for

  • GPS in Ethiopa

    Hello -- I'm an American living in Ethiopa. I've just ordered a Lumia 710 and joined this group. Does Lumia have any GPS support in Ethiopia?

  • Flex session

    Hi, I have 2 mxml files. One is Order Entry screen. When a user enters the order and submits. It goes to the other page to show the m their order, totals etc. But when I come back from the page the main page doesn't hold the sorting , filtering etc..

  • How to install mountain lion for free because of new mac

    I choosed mountain lion in app store and got 19.99$ decrease of my account. My mac is among the latest group and promised of free updating. What should I do?

  • Sleep issue on windows 8.1: pc doesn't wake once it's in sleep mode

    I just bought a new pc, an acer aspire E1-572G, and today I installed windows 8.1. But now I am having a problem that seems to be general, from what I am readind. The problem is with the sleep mode, which once activated, I can't return to windows, un

  • Smartforms transport problem

    My program (smartforms) shows different result between DEV and QA I added an export parameter when I called smartforms in abap program, and add an import parameter to smartforms. It works fine on DEV but short dump on QA server due to a parameter was