• 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.
0
sun_ora_hpt
Asked:
sun_ora_hpt
1 Solution
 
Helena Markováprogrammer-analystCommented:
You have to correct your query:

select deptno,dname from dept
&p_where

This is a little explanation from http://www.dulcian.com
(Conferences,Papers&Presentations):
Lexical parameters can replace all parts of the query on which the report is based

SELECT empno,ename
FROM emp
&p_where

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.

Henka
0

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