1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Lexical Parameter and Bind Variable in Oracle Reports

Discussion in 'Other Development Tools' started by bobbyiiit, Nov 19, 2010.

  1. bobbyiiit

    bobbyiiit Active Member

    Messages:
    15
    Likes Received:
    1
    Trophy Points:
    85
    Lexical parameter

    These are used to replace a value dynamically at run time. Lexical parameters can dynamically replace clauses in the Select statement in the data model and even the whole select statement. It replaces any part of a SELECT statement, such as column names, the FROM clause, the WHERE clause, the ORDER BY clause.

    To create a lexical reference in a query, prefix the parameter name with an ampersand (&)


    Bind parameter

    We can create lexical parameter & bind parameter in the report in the data model query. The bind parameter is used as well and lexical parameter used for ex:

    Code (SQL):
    SELECT &deptno,ename,deptno FROM emp WHERE empno=:empno
    Code (Text):
    Lexical parameter has a PREFIX ampersand (&)
    Code (Text):
    Bind parameter has a PREFIX colon (:)
    Hope this was useful... :)
     
  2. chandresh

    chandresh Active Member

    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    75
    Location:
    India
    hhi
    klhnfdkjshfkjdsfhduskjfb
     
  3. Dayakark

    Dayakark Starter

    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    10
    Location:
    chennai
    Lexical parameters are used to substitute multiple values at run time and identified by a preceding ‘&’. Lexical can consist of as little a one line where clause to an entire select statement
    Lexical Parameters are used to execute query dynamically.

    Example: An example of a lexical parameter usage in a select statement is as follows
    Select * from XX_table, XX_table 2 &where.

    In the properties of the ‘where’ user parameter, make sure that the data type of the ‘where’ user parameter is set as character. If you know the maximum length that your where clause is going be, you can set the width of the where parameter to be slightly greater than that number. Otherwise, set it to some number like 100.

    Create Oracle Report with Lexical Parameter
    http://www.oraappdata.com/2017/02/create-oracle-report-with-lexical-parameter.html