how get parameter wise view

All the discussion which is not possible in the above forums should be posted here.
Post Reply
mfa786
Posts: 51
Joined: Thu Jun 01, 2006 4:37 am
Location: Pakistan

how get parameter wise view

Post 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
admin
Posts: 2063
Joined: Fri Mar 31, 2006 12:59 am
Location: Pakistan
Contact:

Post 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.
mfa786
Posts: 51
Joined: Thu Jun 01, 2006 4:37 am
Location: Pakistan

Post by mfa786 »

thanks for reply

sir how i use if condition in view or query

please give me any sample

thanks

aamir
najm
Posts: 74
Joined: Wed Apr 05, 2006 8:04 am
Location: Pakistan

Post 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
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests