Lexical parameter report in oracle reports

Hello
      I am new in oracle forms and reports.I am using oracle weblogic 10.3.5 with oracle forms and reports 11g at windows 7.
I have need to create a lexical parameter report In which I have query as:
select &P_1 ename,sal from emp
this works well but here I have to give the default value with lexical parameter which is ename but i do not want it.
Here If I give the value to P_1 --> empno
then It returns all data but there is column heading  is ename for data empno from emp table.
Is there any way so that to eliminate the default value for lexical parameter.Actually I want the sql data source query like
select &P_1 ,sal from emp
But flashes error ORA 00936 of missing expression.
Please suggest me
Thank You
regards aaditya

Hi,
Check the datatype of the USERNAME and width value assigned for it. Because the cause for this error is:
An arithmetic, numeric, string, conversion, or constraint error occurred. For example, this error occurs if an attempt is made to assign the value NULL to a variable declared NOT NULL, or if an attempt is made to assign an integer larger than 99 to a variable declared NUMBER(2).
Change the data, how it is manipulated, or how it is declared so that values do not violate constraints.
Thanks,
Vidya Viswanathan.

Similar Messages

  • Lexical Parameter in Oracle Reports . . .

    Hi all,
    I am trying to pass a value to a query in oracle reports . . .
    the use of the parameter is to add 2 additional columns to an existing query, if a bind parameter is set to 'Yes' else the parameter carries a value NULL;
    Here is the code I have written in After Parameter Form:
    if :P_ROLL_DETAIL_PRN='Yes' then
    :P_CUSTOM_CODE:=NULL;
    :P_CUSTOM_CODE:=:P_CUSTOM_CODE||'wdd.LOT_NUMBER' ||','||'wdd.SUBLOT_NUMBER';
    else
    :P_CUSTOM_CODE:='';
    end if;
    P_Roll_detail is the bind parameter . . and P_CUSTOM_CODE is the Lexical Parameter . ..
    It works for value 'No' of P_ROLL_DETAIL .. . but for Value 'Yes' I get an error . . .
    REP-0499: Column '' selected by the query is incompatible with report defination
    Kindly help...
    Regards
    Jagan

    Lexical parameters can not be used to change the number of selected columns. Consider selecting max number of columns always, but populating last two columns with either NULL values or table columns based on the parameter. Also, manipulations can be done in the layout model using format triggers.

  • How to define Lexical Parameter in Oracle report.

    Dear all,
    I need to know that how i will define lexical parameter in query of report builder
    i have like this
    SELECT R.EXCEPTION_MESSAGE EXP_MESSAGE,
    ER.PROD_ID PRODUCT,
    ER.TNAME SEGMENT1 ,
    DECODE(R.STATUS,'Y','ROW',
    'L','TABLE',
    'Z','CIB LEVEL',
    NULL) STATUS,
    NVL(COUNT(*),0) CNT
    FROM EXCEPTION_RECORDS ER,CIB_PROC_TABLES_RULES R
    WHERE ER.TABLE_ID=R.CIB_TABLE_ID
    AND ER.EXP LIKE '%'||R.EXCEPTION_MESSAGE||'%'
    AND ER.BRWR=:v_brwr
    &v_where
    GROUP BY R.EXCEPTION_MESSAGE,ER.PROD_ID,ER.TNAME,R.STATUS
    ORDER BY 2
    It is giving an error

    V_WHERE should be defined same way as regular parameter. It should acquire certain value that makes the query syntaxically correct bofore the sql is run, usually in the After Param Form trigger, e.g.
    v_where := 'WHERE 1=1';
    ...

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

  • 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

  • Report are not working using lexical parameter

    Hi !
    i am using oracle 10g and i my query i have laxical parameter as follow
    &to_date
    in after paramform we have
    IF :P_DATE_TO IS NOT NULL THEN
         :TO_DATE := 'AND to_date(head.updated_date,'||chr(39)||'DD/MM/RRRR'||chr(39)||') between TO_DATE(t2.term_start_date,'||chr(39)||'DD/MM/RRRR'||chr(39)||') AND TO_DATE('||CHR(39)||:P_DATE_TO||CHR(39)||','||chr(39)||'DD/MM/RRRR'||chr(39)||')';
    --ELSE
         --:TO_DATE := NULL;
    END IF;
    after compile this report when i run this report then i have following error
    REP-304: '&' in SELECT statement was not followed by a valid lexical parameter.
    any body can tell me how can i resove it.

    What denis is trying to say that change the TO_DATE parameter to any other name because TO_DATE is actually reserve word. So instead of TO_DATE try for example P_TO_DATE or any other name.
    -Ammad

  • 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

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

  • Parameter Form in Oracle Report!!

    Dear Oracle Users' Group:
    I have problem with "Parameter Form" in Oracle Report.
    The Report that I created has the SQL:
    "SELECT A.FIELD1, A.FIELD2
    FROM MYDATABASE.MYTABLE A
    WHERE
    A.FIELD1 = :P_1";
    When the report is run, it asks for the parameter
    and generates the report based on the runtime
    parameter. Works perfect on Oracle8i database's
    Report front end.
    The PROPERTY PALETTE for the FIELD (Field that
    takes the runtime parameter) is:
    ====================
    General Information
    Name: PF_P_1
    Comments:
    Parameter Form Field
    Source: P_1
    Parameter
    Datatype: Character
    Width: 40
    Initial Value:
    Validation Trigger:
    List of Values:
    (For the list of values, I have put the SQL:
    "SELECT DISTINCT A.FIELD1 from
    MYDATABASE.MYTABLE A", Also I had
    tried with list of fixed values like A, B, C)
    Web Setting
    Additional Attributes (HTML):
    ================
    But the report does NOT work when called from the Web.
    (This is only because of the problem with this Parameter
    Form in my report. If I get rid of the parameter form by
    changing the last line of my SQL to: "A.FIELD1 = 'Chicago'",
    it works fine from the Web).
    When accessed the report from the Web, the error I get
    is:
    Oracle Reports Server CGI - Report Job has terminated with this error.
    Reports Server Replies:
    REP-0788: Warning: The value of restricted LOV parameter P_1 is not among the selectable values.
    I do not know what is the error with this simplest Parameter Form based Report!!
    In the Property Palette (above) of the Field, there was a field named "Additional Attributes (HTML)"
    under "Web Setting" heading.
    Do I need to write something there!!
    Please help!!
    thanks.
    kimmy

    Hi, Kimmy
    Try: &paramform=yes]http://webserver.com:80/dev60cgi/rwcgi60.exe?server=repserver&report=rep1&userid=scott/tiger@orcl&destype=cache&desformat=htmlcss&paramform=yes
    I've also sent you an email about key maps.
    Enjoy! Web Reporting is a great feature.
    Pedro.

  • Lexical parameter in bi report

    Hi All,
    I have a requirement as below :
    I have a select query in my XML file which is returning two rows for a order
    ex: select email,fax,order_number from
    oe_order_headers_all
    hz_contact_points,
    My requirement is i need to pass 3 parameters such as order_number, email, fax to the report in that case it should take only the parameters what i am passing, and it should not take the hz_contact_points table from the query
    so i need to achieve this through lexical parameter, any one please help me on this.
    Thanks

    i think you didn't read that i'm mentioned
    in datatemplate
    <parameters>
    <parameter name="P_YOUR_PARAM" dataType = "number" defaultValue="0"></parameter>
    </parameters>
    <sqlStatement name="Q_DATA">
    <![CDATA[
    select &your_columns
    from  &your_tables
    where &your_where_clause
    ]]>
    </sqlStatement>
    </dataQuery>
    <dataTrigger name="beforeReportTrigger" source="XX_YOUR_PKG.BeforeReport"/>
    <dataStructure>
    ...in package
    FUNCTION BeforeReport RETURN BOOLEAN IS
    BEGIN
    IF P_YOUR_PARAM = 'some_value' THEN
      your_columns := 'column1, column2';
      your_tables := 'table1, table2';
      your_where_clause := 'table1.id = table2.id';
    ELSE
      your_columns := 'column3, column4';
      your_tables := 'table2, table3';
      your_where_clause := 'table2.id = table3.id';
    END IF;
    END;you can use another way - create your xml output by package like
    fnd_file.put_line(fnd_file.output, '<ROWSET>');
    fnd_file.put_line(fnd_file.output, '<ROW>');
    fnd_file.put_line(fnd_file.output, '<DAT>' || some_value || '</DAT>');
    fnd_file.put_line(fnd_file.output, '</ROW>');
    fnd_file.put_line(fnd_file.output, '</ROWSET>');in package you can use all that you want

  • 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 single quotes in a lexical parameter from forms11g to reports 11g

    Hi,
    We've upgraded our forms and reports from 10.1.2.3 to 11.1.2.1 and this has broken a number of reports where we pass a string of single quoted variables to reports as a lexical parameter.
    v_string := ''''||:block.item1||''''||','||''''||:block.item2||''''
    select *
    from emp
    where emp_id in (&p_string)
    where v_string is simply passed as a text parameter to the report.
    I'm not clear why this should break now (its worked since 6i) and whether anyone is aware of it and/or a solution.
    Any help much appreciated as always
    Thank you

    Hi,
    Thanks for the suggestion I will try and give it a go.
    Do you mean for example in the form:
    v_string := $$dq||:block.item1||$$dq||','||$$dq||:block.item2||$$dq
    And in the report
    Begin
    replace(p_where_string,'$q','''');
    end;
    I would say that this even if this works it will prove painful to be updating every form AND report where this is used as we have a lot! I do really appreciate anyone taking the time to reply though!
    It would appear that there are several bugs recorded against this type of problem when moving to reports 11...
    Bug 11840698 - SIMPLE QUOTE REMOVED WHEN USING RUN_REPORT_OBJECT WITH PARAMLIST
    Status 11 - Code/Hardware Bug (Response/Resolution
    I will continue to update with responses from my SR.
    Thanks

  • Lexical Parameter in Matrix Report

    Hi ,
    I am faced a problem when i used lexical Parameter in Matrix Report.
    I design Query and Report in Group Above Mode The Lexical Parameter
    Show the Values in the Field but when I make This Report in Matrix then
    This Lexical Parameter Showes The Value Null I try many Solution
    But it shows null value in the Output
    Thanks

    i think you didn't read that i'm mentioned
    in datatemplate
    <parameters>
    <parameter name="P_YOUR_PARAM" dataType = "number" defaultValue="0"></parameter>
    </parameters>
    <sqlStatement name="Q_DATA">
    <![CDATA[
    select &your_columns
    from  &your_tables
    where &your_where_clause
    ]]>
    </sqlStatement>
    </dataQuery>
    <dataTrigger name="beforeReportTrigger" source="XX_YOUR_PKG.BeforeReport"/>
    <dataStructure>
    ...in package
    FUNCTION BeforeReport RETURN BOOLEAN IS
    BEGIN
    IF P_YOUR_PARAM = 'some_value' THEN
      your_columns := 'column1, column2';
      your_tables := 'table1, table2';
      your_where_clause := 'table1.id = table2.id';
    ELSE
      your_columns := 'column3, column4';
      your_tables := 'table2, table3';
      your_where_clause := 'table2.id = table3.id';
    END IF;
    END;you can use another way - create your xml output by package like
    fnd_file.put_line(fnd_file.output, '<ROWSET>');
    fnd_file.put_line(fnd_file.output, '<ROW>');
    fnd_file.put_line(fnd_file.output, '<DAT>' || some_value || '</DAT>');
    fnd_file.put_line(fnd_file.output, '</ROW>');
    fnd_file.put_line(fnd_file.output, '</ROWSET>');in package you can use all that you want

  • Maximum size - Lexical Parameters - Report 2.5

    Hi
    We are using Oracle Reports 2.5 .
    Want to know what is the maximus size we can have for a lexical parameter .
    Is it 2000 chars ?
    We have 3 lexical parameters in our where clause of the query .
    What is the maximum Length of the 3 lexical parameters (combined) we can have ?
    Thanks

    Post Author: Aravind
    CA Forum: Older Products
    Hi Kai,Thanks for the reply.I can see that the maximum cache size has been set to 10000KB.Does this govern the number of records that is returned by a report?The idle jobs get closed in 20 minutes. Could you please provide me a pointer of where do we set up this parameter of limitting the number of records that a report returns? Thanks again,Aravind.   

  • Packages oracle not recognized lexical parameter that passed from BIP

    Dear all,
    My name is Rizal, i've a problem when passing lexical parameter from BIP to Oracle Packages. Below is my data template in BI Publisher that call function f_where_clause on packages :
    <dataTemplate name="dtTemplate1" description="dtTemplateTest" dataSourceRef="prodin" defaultPackage="pkg_rep_bip">
    <dataTrigger name="cobaTrigReport" source="pkg_rep_bip.f_where_clause(:P_SD)"/>
    <dataQuery>
    <sqlstatement name="Q1">
    <![CDATA[SELECT CODE, SPPD_CODE FROM PRO_SPD01 &amp;v_where_clause]]>
    </sqlstatement>
    </dataQuery>
    </dataTemplate>
    and P_SD is one parameter that i created in BI Publisher.
    and below is my packages (Spec and Body) :
    SPEC :
    CREATE OR REPLACE package PRODIN.pkg_rep_bip
    as
    v_where_clause varchar2(10000);
    function f_where_clause (p_sd varchar2)return boolean;
    end pkg_rep_bip;
    BODY :
    CREATE OR REPLACE package body PRODIN.pkg_rep_bip as
    function f_where_clause (p_sd varchar2)return boolean is
    begin
    if p_sd = 'Y' then
    v_where_clause := ' where re=11';
    else
    v_where_clause := ' where re=24';
    end if;
    return true;
    end f_where_clause;
    end;
    More detail problem is when parameter P_SD = Y (i assigned in BI PUblisher) the result always go to (v_where_clause := ' where re=24'). Any help/answer really appreciate.. Many thanks..

    It seems that Reports help is wrong ( or imprecise).
    Eg. if we have:
    select &p_select
      from dept
    where &p_where
    and the initial values for the parameters are:
    p_select: deptno, dname
    p_where: 1 = 2
    and the code in the Before Reports trigger is the following:
    function BeforeReport return boolean is
    begin
      :p_select := 'deptno, ''abcde'' ';
      :p_where := '1 = 1';
      return (TRUE);
    end;
    we get all the rows (where 1 = 1) and we get the value 'abcde' in the field "dname".
    However, try to move your code from the Before Report trigger to After Parameter Form trigger.
    Regards,
    Zlatko

Maybe you are looking for

  • Setting Up a WRT54GS Inside a Firewalled Network

    Hi hi! Aaargh!! I hate these little things sometimes. I'm the IT Director for a small refining company. I'm running a Windows 2000 network workgroup. We're behind a Watchguard Firebox, so I use static IPs to access the outside world. A standard hard

  • Aso mdx issue !!!!!

    ([Jan],(Actual),(LOB]) verify's ([Jan],[SC_Actual],[LOB])=([lob1]*(.75))+[lob2]*(.25)); Error(1260052) - Syntax error in input MDX query on line 1 at token '=' CombinedLOB please advise Edited by: Next Level on Jul 8, 2012 4:43 AM Edited by: Next Lev

  • How to read value from Key flexfield added on to the newly created SIT

    Hi Experts, I have a requirrment to display a new structure in the Special Information Types (SIT) screen in SSHR. The data entered into the segment needs to be validated using PL/SQL function. I have performed below steps to display the structure/fi

  • [BUG] Sort - Capture Time doesn't work, movies?

    I found a strange bug: when set on Capture Time order, all my Nikon D300 photos are correctly sorted, however some movies I took with an old Canon bridge camera are placed in the wrong spot. As you can see from the date and hours, they are presented

  • Very annoying IE problem

    I have an application that is almost entirely rich forms. Now that IE requires users to "click to activate the control" this whole application is a little annoying to navigate. I read this article for dealing with the problem with flash content: http