• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1766
  • Last Modified:

oracle d2k- reports using lexical parameters

can any one help me how to create lexical parameters in oracle d2k reports for writing dynamic where condition during run time.

I have tried by creating a user parameter called p_where.

Then i have written a Query as follows.
 select deptno,dname from dept
        where &p_where

But i am getting the error Invalid SQL statement
  where ==>

So Please tell me what else i have to write after creating the parameter.
ie Any Validations, any Libraries or any Before & after form triggers, I am unable to find a correct article regarding this,  Thanking u in advance.
1 Solution
Helena Markováprogrammer-analystCommented:
You have to correct your query:

select deptno,dname from dept

This is a little explanation from http://www.dulcian.com
Lexical parameters can replace all parts of the query on which the report is based

SELECT empno,ename
FROM emp

In the example above, the lexical parameter  p_where can replace the WHERE or ORDER BY clauses or a combination of them. The lexical parameter can be built either by the application that calls the report, or by the report itself in a program unit like an AFTER-PARAMETER-FORM trigger or a formula column.


Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now