Page 1 of 1

how get parameter wise view

Posted: Tue Jun 20, 2006 9:29 am
by mfa786
hi mastere
sir i use this stetment for parameter view but it not proive result

create view fahm as select * from emp where deptno=&externalvariable

sir i need &externalvariable value from form

such as
externalvariable=sysdate

and run view then view give me only related date record

please give me idea

thank aamir

Posted: Wed Jun 21, 2006 12:36 am
by admin
You should create the fiew first then use where while selecting data from the view.

create view emp_v as select * from emp

select * from emp_v where deptno = 12

You can also use if conditions if required to have multiple different where for the query.

Posted: Wed Aug 02, 2006 5:39 am
by mfa786
thanks for reply

sir how i use if condition in view or query

please give me any sample

thanks

aamir

Posted: Thu Aug 03, 2006 8:35 am
by najm
Here is a Sample Query of If Else by this query i got the result like this

SELECT EMPNO,ENAME FROM
(SELECT EMPNO,ENAME, ROWNUM SI
FROM EMP ORDER BY EMPNO DESC
) ORDER BY CASE WHEN SI=2 THEN 0 ELSE SI END

4 B --- Second Last is on Top in Desc order
5 A
3 C
2 D
1 E

Cheers

Najm