Passing where clause  to lexical parameter in report

I have a requirement to send the values of lexical parameters in reports from Forms 6i , like i have written one query in report builder with lexical clause being where.Now i want to pass this where clause as a whole from forms 6i, for example.
select asset_code,asset_name from fix_asset @p_status
now i want to pass this p_status from forms 6i which has 1 radio group with 3 values , if i select value 1 then where nvl(at_status,'X') = 'X' ,if i select value 2 or radio button 2 then where nvl(at_status,'X')='Y' and if i select 3 then both x and y should come together.Edited by: 998476 on Jun 5, 2013 12:01 AM

I have a Before trigger Function to which the parameters will be passed.
Suppose if User selects multiple values for a parameter then how to pass these multiple Values to that parameter?
eg:In first Workbook Before Trigger is fired and the paramters for the trigger are
'par1','par2','par3' etc.
If User selects multiple values for a parameter 'par1' from the list of values displayed then how to pass all these values to 'par1' in Function?
After firing the trigger rows are inserted in a temp_table .My second Workbook will
fetch the rows inserted in this Temp Table.
I hope u understood what my requirement is...
Thanks in advance

Similar Messages

  • Passing where clause with spaces from forms to reports

    Hi,
    Has anybody passed where clause as lexical parameter with spaces from forms to preports..
    I have seen people mention that, we can replace the spaces with special characters and then replace it again in the before trigger report..does anyone have a working example of that??
    Thanks.

    i solved the issue..
    i had written the procedure in the before report
    trigger instead of writing it in the before parameter
    form trigger..
    it works perfecto now..
    Thanks.We had removed the spaces and used commas to delimit each item.
    So you are saying spaces are not a problem in 10g?

  • How to use lexical parameter in report

    i want to use lexical parameter in report and pass parameter from form how it is possible in detail
    A.R

    Hi,
    typically you fill your lexical paramter in the after-paramform-trigger out of the values of your bind-parameters (giving end users directly control over lexical parameters might not be a good idea). Inside PL/SQL a lexical parameter is referenced like bind parameters with ":". In the query it's referenced via "&" and represents a part of the query.
    A simple example.
    - p_deptno as bind parameter
    - p_where as lexical paramter
    - end user choose value for p_deptno (10,20,... or nothing)
    - Trigger: if :p_deptno is not null then
    :p_where := 'WHERE deptno = :p_deptno'
    else
    :p_where := null;
    end if;
    - Query select ... from emp &p_where
    Regards
    Rainer

  • Pass column-name as a parameter to reports

    Hello,
    the code below calls a report. But now I want to sort the rows in the report. For example I have a text-item in my form-modul. If I type a column-name and press the button then the rows should be sorted in the report. Is it possible tp pass column-names as parameter to reports?
    DECLARE
    repid REPORT_OBJECT;
    v_rep VARCHAR2(100);
    rep_status VARCHAR2(20);
    BEGIN
    repid := find_report_object('STATIONSTOPOLOGIE');
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_EXECUTION_MODE,RUNTIME);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_COMM_MODE,SYNCHRONOUS);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,CACHE);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'html');
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_SERVER,'rep_oracle-dev');
    -- SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no pdeptno='||:dept.deptno);
    v_rep := RUN_REPORT_OBJECT(repid);
    rep_status := REPORT_OBJECT_STATUS(v_rep);
    WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
    LOOP
    rep_status := report_object_status(v_rep);
    END LOOP;
    IF rep_status = 'FINISHED' THEN
    WEB.SHOW_DOCUMENT('http://oracle-dev:8888/reports/rwservlet/getjobid'||
    substr(v_rep,instr(v_rep,'_',-1)+1)||'?'||'server=rep_oracle-dev','_blank');
    ELSE
    message('Error when running report');
    END IF;
    END;

    Hi,
    the work has been done in reports. You can use a lexical parameter in reports to add a condition for sorting to the query like:
    select .. from .. where ... &p_order.
    Then add another parameter to the report (for example p_param). Fill p_param via your interface in forms (SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER, ....) with the column name. Then build a report trigger like:
    if :p_param is null
    then
    :p_order:= null;
    else
    :p_order:= 'order by '||:p_param;
    end if;
    But have a look, that p_param can only get correct values.
    Rainer

  • Lexical Parameter in report 10g

    i want to call a report with few fields on my form. i create 2 user parameter which works fine. now i want to create a lexical parameter so that if null no problem report should appear with 2 user parameters but if has values then report should be called according to those parameter values.
    I use this in my form:
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'PBRANCHCODE='||:txtBranchCode||' PPERIOD='||:cmbPeriod||' CLASSCONDITION='||'cla_class_id between 1 and 2'||' paramform=no');
    CLASSCONDITION is a lexical parameter which is called in report sql:
    and periodic_branch_id = :pBranchCode
    and periodic_period_from = :pPeriod
    &ClassCondition
    it says unable to run report
    when i test using paramform=no then it shows in classcondition parameter only and and nothing after space assuming parameter list ended.
    Please help me in passing a lexical parameter to report
    Thanx in advance.

    I want to append the where condition of the report. if values inputed from Form in the class ids from and to text boxes appended as a where condition in the report query otherwise excluded
    Report Query
    select *
    from ...
    where
    and .....
    and ....
    &ClassCondition
    and i want to pass &classcondition parameter the below condition
    and class_id between :fromclass and :toclass
    Hope you understand.

  • Passing where clause of cursor

    my requirement is that i want to declare a cursor but the problem is that where clause of sql statement of cursor is dynamically generated according to user clicks........ e. g. number of conditions in where clause may change.....
    so..... how can i declare the cursor...how do i pass where clause to any procedure if i write procedure or function......

    u can use for-loop cursors like this,
    for v_rec in 'select * from emp where' || ur_conditions ||'
    see oracle documentation for further help and examples

  • Run Report with Pass Number and Varchar Lexical Parameter values

    Dear Sir/Madam
    Due to an urgent change required to a report I would most appreciate it if you can please advise me if it is possible to get this report working by either passing in multiple lexical parameters or one signle lexical parameter when calling the SRW.RUN_REPORT command with the following methods:
    Firstly: When calling report with a run_no and spr_cd passed in through one lexical:
    cmd_line: REPORT=D:\DEV\REMITTANCE.rdf BACKGROUND=YES BATCH=NO DESFORMAT=PDF DESTYPE=FILE DESNAME=D:\DEV\REMITTANCE.pdf
    CP_L_PARAM=RUN_NO=TO_NUMBER(28) AND SPR_CD=SUPP1
    Both with a TO_NUMBER and without, whereby I attempt to do a SUBSTR within the query of the called report to derive the RUN_NO Oracle Reports fails to accept the SUBSTR.
    Secondly: I am now trying to call the with passing two lexical parameters into the report as follows:
    cmd_line: REPORT=D:\DEV\REMITTANCE.rdf BACKGROUND=YES BATCH=NO DESFORMAT=PDF DESTYPE=FILE DESNAME=D:\DEV\REMITTANCE.pdf
    CP_L_RUN_NO=||TO_CHAR(lv_run_no)|| CP_L_SPR_CD=||lv_spr_cd;          
    NOTE: The above is an output of the actual command line and not what is passed into the command line, thus the quotes are missing. Please also note that the report is running fine with the only a hard coded RUN_NO value PASSED without the SPR_CD.
    Unfortunately this is also causing issues as the RUN_NO is a number and as you know you can only pass in strings.
    Your urgent help is required on this matter please as our client is expecting a solution this afternoon.
    Hope to hear form you soon.
    Kind regards
    Andrew Mason

    Dont Worry I've worked it out...

  • Passing values to Dynamic where clause as IN parameter - ADF

    Hi,
    I am trying to get the Dynamic where clause query output something like below,
    select * from EMP where emp_id IN(200,203,204)
    How to pass values from setWhereCluase(emp_id,????)
    Thanks,

    I'd go about this a little differently (probably not the best way):
    1. Create view object lk_department (lookup). In the query add a union with something like "select null as ID, 'All' as name' from dual;". This adds a null value that they can select by leaving the combo box on "All". Add a 'order by id" so the null value is the first one. When creating the combo box you want it set to navigation mode, so select the whole viewobject from the data palette rather a specific field.
    2. Create a jTextField for the "Jobs" field.
    3. Create an application module method that does something like:
    public void filterEmployees(String job){
    ViewObject vo_departments = findViewObject("lk_departments");
    ViewObject vo_employees = findViewObject("employees");
    String wc = "1 = 1 ";
    String wc = " and job like '%"+job+"%'"
    if (vo_departments.getCurrentRow().getAttribute("Id") != null) {wc += "and department_id = "+vo_departments.getCurrentRow().getAttribute("Id");}
    vo_employees.setWhereClause(wc);
    vo_employees.executeQuery();
    this.sync;
    4. In your Jclient app, you just need to call the method of your appmodule and insert the string from the textbox, using code similar to this:
    AppModule b = (AppModule)panelBinding.getApplicationModule();
    b.filterEmployees(jTextField.getText());
    I didn't test this code, but that's how I go about the same thing.

  • Lexical Parameter in Reports 6i Program Unit

    A report I'm writing requires me to use the lexical parameter in a program unit rather than a query in the data model. Lexical parameters in a query have always worked with the example "WHERE &my_parameter". But using "WHERE :my_parameter" or "WHERE &my_parameter" in a program unit gave me the error "expression is of wrong type" so the code wouldn't compile in the editor.
    The parameter returns "segment1 = '8675309' AND segment2 = 'Jenny'I was able to resolve it by using the first column of the expression and the replace function on the parameter so the program unit editor thinks it's a valid expression and the resulting line is a valid predicate that gets the correct data. Here's my example:
    WHERE segment1 = replace(:my_parameter, 'segment1 = ')The replace function strips off the "segment1 = " from the lexical parameter so the resulting line that gets passed to the server is:
    WHERE segment1 = '8675309' AND segment2 = 'Jenny'This solution will not work where the parameter could return something other than "segment1 = " at the beginning of the parameter string like "segment1 BETWEEN " or a different column name to compare other than segment1. Anyway, this is working but if there are better ways to do it I'd like to try them. Using Reports 6i with EBS 11.5.10.2.

    Hello,
    You'll find explanations and examples here :
    http://www.oracle.com/webapps/online-help/reports/10.1.2/topics/htmlhelp_rwbuild_hs/rwwhthow/whatare/dmobj/sq_a_lexical_references.htm
    This documentation is for Reports 10.1.2 but is valid for Reports 6i too ...
    Regards

  • Passing multiple values to a parameter in report

    Can anyone help me how to pass multiple parameters to a parameter in my report.
    As user is able to select multiple values from list of values , can I pass the selected values to calling function.
    Suppose if User selects Value1,Value2,Value3 from list of values of a parameter P_Org,
    I need to pass all these values to parameter P_Org in my Before Trigger Function in Discoverer reproting tool.
    Thanks in advance

    I have a Before trigger Function to which the parameters will be passed.
    Suppose if User selects multiple values for a parameter then how to pass these multiple Values to that parameter?
    eg:In first Workbook Before Trigger is fired and the paramters for the trigger are
    'par1','par2','par3' etc.
    If User selects multiple values for a parameter 'par1' from the list of values displayed then how to pass all these values to 'par1' in Function?
    After firing the trigger rows are inserted in a temp_table .My second Workbook will
    fetch the rows inserted in this Temp Table.
    I hope u understood what my requirement is...
    Thanks in advance

  • Passing of userid as a parameter for report viewing in Flex portal

    Hi,
    We are using flex application and Business Objects reports are integrated with it. We had created one service id which is used to access reports from application. Also we want to implement Data Access in Business Object's Reports. and for the same we want to pass UserID as a parameter internally from Flex code to the reports. We cannot use @BOUserID as we are using single service id. We want to pass "UserID" as a parameter (which we can get from Flex application) and pass this to Report OR Universe which internally filter out the data accessible to the respective user. Kindly advise on the same.
    Thanks,
    Eswar

    I've resolved this issue by creating a prompt in universe and inserting the security table in the universe structure

  • How to pass where clause in lov's

    Dear all
    i have creation page in that three lov's are there
    1.customername
    2,person name
    3.address
    my requirement is person name and adress will come based on customername(companyid) and also orgid
    in my case i taken 3 lov vo's for lov's
    whet should i do
    my lov query is
    1.SELECT comp_companyid, comp_name
    FROM xxcrm_company_t
    2.SELECT pers_companyid, pers_personid, pers_firstname, pers_lastname
    FROM xxcrm_person_t
    3.SELECT comp_companyid, addr_addressid,
    addr_address1
    || ' '
    || DECODE (addr_address2,
    NULL, COALESCE (addr_address3, addr_address4),
    addr_address2
    || ' '
    || DECODE (addr_address3,
    NULL, COALESCE (addr_address4, addr_country),
    addr_address3
    || ' '
    || NVL (addr_address4, addr_country)
    || ' '
    || DECODE (addr_address4, NULL, NULL, addr_country) address
    FROM xxcrm_company_address_t
    except first query remaining 2 queries orgid is there i need to compare orgid as well as first query companyid
    i hope u understand my question
    Regards
    Sreekanth

    You can use dependent lov concept for this. Go through the development guide for the same.

  • Where clause is not being passed to the report

    I just upgraded my crystal reports from 10.0 to 11 R2. Reports were working fine in 10.0 version,
    Reports are called from vb.net (vissual studio 2005). When I was running this reports using crystal 10.0 and visual studio 2005, it was working fine, After the upgrade report runs but I am noticing that where clause is not being passed to the reports.It generates report as there is no where clause and produces multiple pages report.

    I believe you are encountering an issue documented in [this|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bip/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes.do] note.
    Ludek

  • Calling report from form with lexical parameter

    hi
    DECLARE
         repid REPORT_OBJECT;
         v_rep VARCHAR2(1000);
         rep_status VARCHAR2(20);
    BEGIN
              repid := FIND_REPORT_OBJECT( 'REPORT34' );
              set_report_object_property(repid,report_other,'p_SEASON_YEAR='||:SALE_ORDER.SEASON_YEAR
              ||' &sort='||:sale_order.sort1);
              --set_report_object_property(repid,report_other,'p_g_id =20');
              v_rep := RUN_REPORT_OBJECT(repid);
              rep_status := REPORT_OBJECT_STATUS(v_rep);
    WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
    LOOP
    rep_status := report_object_status(v_rep);
    END LOOP;
    IF rep_status = 'FINISHED' THEN
    --Display report in the browser
    WEB.SHOW_DOCUMENT('http://127.0.0.1:8889/reports/rwservlet/getjobid'||
    substr(v_rep,instr(v_rep,'_',-1)+1)||'?'||'server=repserver90','_blank');
    ELSE
    message('Error when running report');
    END IF;
    PAUSE;
    END;i had made a lexical parameter in reports the reports code is
    SELECT s.season_year,sd.prod_id,P.PROD_NAME,sum(sd.total_qty)
    FROM sale_order s,sale_order_detail sd,PRODUCT P,CUSTOMER_MASTER cm,CUSTOMER_DETAIL cd
    where s.id=sd.id and P.PROD_ID=SD.PROD_ID AND s.season_year = :p_season_year
    AND CD.CUST_ID=CM.CUST_ID AND CD.CUST_ID=S.CUST_ID AND CD.COUNTRY NOT LIKE 'SPA%' AND Sd.PROD_ID LIKE  'CA%'
    group by s.season_year,sd.prod_id,P.PROD_NAME
    &sortthanks and regards
    vikas

    Vikas,
    So, is your code producing an error when your report is called? Also, it would be helpful to know your Forms and Reports versions. Is ":p_season_year" set up as a USER_PARAMETER (UP) in your report or is it a true lexical parameter (meaning you should reference it with '&' instead of ':')? If it is a UP, the typical way to pass a value to this UP from Forms is to use a ParamList object instead of the REPORT_OTHER parameter of the Set_Report_Object_Property built-in. For example:
    DECLARE
       pl_id    ParamList;
       pl_name  VARCHAR2(10) := 'REPORT34';
       v_rep VARCHAR2(1000);
       rep_status VARCHAR2(20);
    BEGIN
       pl_id := Get_Parameter_List(pl_name);
       IF id_null(pl_id) THEN
          pl_id := Create_Parameter_List(pl_name);
       END IF;
       Add_Parameter(pl_id, 'P_SEASON_YEAR', TEXT_PARAMETER, :SALE_ORDER.SEASON_YEAR);
       repid := FIND_REPORT_OBJECT( 'REPORT34' );
       v_rep := RUN_REPORT_OBJECT(repid, pl_id);
       ...  rest of your code here  ...
    END;Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • Passing where cluase as parameter for cursor

    I want to pass where clause of cursor as parameter.... how can I do that?
    say I want cursor as,
    cursor c1 is select fname, mname from person where :param;
    where :param is a value I want to pass in declare section

    I want to pass where clause of cursor as parameter.... how can I do that?Yes.
    cursor c1 is select fname, mname from person where :param;
    where :param is a value I want to pass in declare sectionYou can also shoot yourself in the foot using a 357 Magnum.
    Neither is recommended - unless you are a professional idiot. Which I doubt as these are typically your Darwin Award Winners.
    Why is it bad to to have "+WHERE :param+"?
    Bind variables. If the WHERE clause is passed as a dynamic string. this will usually be implemented in the following fashion:
    SQL> create or replace procedure smellyFoo( filterClause varchar2, refCur in out sys_refcursor ) is
      2  begin
      3          open refCur for
      4          'select owner, object_id, object_name from all_objects where owner != ''SYS'' and '||filterClause||' order by 1,2';
      5  end;
      6  /
    Procedure created.
    SQL>
    SQL> var c refcursor
    SQL> exec smellyFoo( 'object_type=''TABLE'' and rownum <11', :c );
    PL/SQL procedure successfully completed.
    SQL>
    SQL> print c
    OWNER       OBJECT_ID OBJECT_NAME
    OUTLN             452 OL$
    OUTLN             453 OL$HINTS
    OUTLN             456 OL$NODES
    SYSTEM           3621 MVIEW$_ADV_WORKLOAD
    SYSTEM           3624 MVIEW$_ADV_BASETABLE
    SYSTEM           3626 MVIEW$_ADV_SQLDEPEND
    SYSTEM           3628 MVIEW$_ADV_PRETTY
    SYSTEM           3630 MVIEW$_ADV_TEMP
    SYSTEM           3632 MVIEW$_ADV_FILTER
    SYSTEM           3634 MVIEW$_ADV_LOG
    10 rows selected.
    SQL>What's wrong with this? The filter clause contains literals. Not bind variables. Which means that non-sharable SQL will be created. This means more cursors (for same SQLs with different literal values) in the shared pool. Different sizes SQLs that leads to fragmentation of the shared pool memory. More hard parsing. Bigger delay in parsing as there are more cursors to scan in the shared pool (useless exercise) as there are no existing cursors that are sharable and can be re-used.
    So what would the correct way be? The client passing a filter clause as a proper bind variable string, and also passing (separately) the values for those bind variables. But this is not easy to code, especially when dealing with filter clauses that may contain no bind variables. or a 100 bind variables.
    Also, the call interface the client needs to use will become a lot more complex as the client now not only needs to build a proper string containing bind variables, it also need to make sure it pass the values for those variables in the correct order.
    So why? Why do any of this? What is the requirement that lead you to this "solution" where the client can dynamically decide on what the filter criteria is?
    Surely, there must be a reason to this madness of the client wanting to throw any filter clause at a SQL cursor... and surely, that is what needs to be identified and analysed and resolved - instead of wanting to create hacks like the above. Causing performance issues. Not to mention opening a security hole that is ideal for SQL injection.

Maybe you are looking for

  • Creation of New Custom Development Object in Solar02

    Hi, We are trying to create an object type of Form for a new custom development object in solar02 under tab Development,and for this I get an error that the object doesn't exist in development environment.  Based on my analysis, it looks like Solutio

  • Cost of replacing the Rear Display.

    hi, how much will be the cost of replacing the Rear Display? thanks.

  • How to restore default OS X Lion theme?

    Recently, I downloaded an app named "Cloak" which changes the color of your Finder, but it didn't work so I uninstalled it. After I did that, it changed the buttons around. For example on Safari, when I press the red exit button it goes full screen i

  • Error when splitting events in iMovie11

    I imported video from my hard drive into iMovie.   The video clips all imported and play perfectly.  I now want to split the clips into multiple events.   I was able to do this with some of the clips, but with a few others I get the following error:

  • TS3276 all my apps load information slowly

    can someone help me with my imac, running mountain lion, all seemed well after initial setupbut then all programs are slow to respond especially loading new information and even recieving mail takes forever. any suggestions? Ihave check all my incomi