Home » SQL & PL/SQL » SQL & PL/SQL » CREATE VIEW (Oracle 10g)
CREATE VIEW [message #340886] Thu, 14 August 2008 15:31 Go to next message
prashanthgs
Messages: 89
Registered: May 2005
Location: chennai
Member
Hi,

I need to create a view. In the view can I use If conditions to retrieve the results as required.

Is that possible to do that? Pls advice

Thanks and Regards,
Prashanth.g.s.
Re: CREATE VIEW [message #340888 is a reply to message #340886] Thu, 14 August 2008 15:40 Go to previous messageGo to next message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
No, but you can use decode functions or case expressions
Re: CREATE VIEW [message #340889 is a reply to message #340886] Thu, 14 August 2008 15:40 Go to previous messageGo to next message
BlackSwan
Messages: 25036
Registered: January 2009
Location: SoCal
Senior Member
http://www.orafaq.com/forum/t/88153/0/
Please read & follow posting guidelines as stated in URL above

>can I use If conditions to retrieve the results as required.
You can do anything in a view that you can do in sqlplus.
Re: CREATE VIEW [message #340891 is a reply to message #340889] Thu, 14 August 2008 15:42 Go to previous messageGo to next message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
>You can do anything in a view that you can do in sqlplus.
Well, not really, no. You cannot use sqlplus commands in a view.
Re: CREATE VIEW [message #340892 is a reply to message #340891] Thu, 14 August 2008 15:45 Go to previous messageGo to next message
BlackSwan
Messages: 25036
Registered: January 2009
Location: SoCal
Senior Member
pablolee wrote on Thu, 14 August 2008 13:42
>You can do anything in a view that you can do in sqlplus.
Well, not really, no. You cannot use sqlplus commands in a view.

Yes, I mis-spoke.
I meant any SQL that is valid in sqlplus is valid within a view.
If you can't do it in sqlplus, then you can not do it in a view.
Re: CREATE VIEW [message #340893 is a reply to message #340892] Thu, 14 August 2008 15:51 Go to previous messageGo to next message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
>I meant any SQL that is valid in sqlplus is valid within a view.

Once again I would say, an incomplete picture. What about a create table statement, or an alter tablespace command.

>If you can't do it in sqlplus, then you can not do it in a view.
Trouble is that that covers basically everything (in terms of SQL and PL/SQL and so doesn't really narrow the field much...
Re: CREATE VIEW [message #340896 is a reply to message #340886] Thu, 14 August 2008 15:57 Go to previous messageGo to next message
BlackSwan
Messages: 25036
Registered: January 2009
Location: SoCal
Senior Member
The first rule of holes is as follows:
when you find yourself in a hole, the 1st thing you should do is STOPdigging.

Therefore I am withdrawing from this thread while I am in a hole & behind.

Hopefully, I have learned I should stop multiplexing between trying to build a single physical Data Guard instance where the Primary server is a multi-node RAC and responding on this forum.
Re: CREATE VIEW [message #340898 is a reply to message #340896] Thu, 14 August 2008 16:07 Go to previous message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
LOL. You are clear;y far busier than me. I'm just playing a couple of hands of poker. Good luck on your build (not of course, that you need luck Smile )
Previous Topic: Create table can not be executed in procedure?
Next Topic: Calender for particular year including US holiday names
Goto Forum:
  


Current Time: Mon Dec 05 02:48:29 CST 2016

Total time taken to generate the page: 0.13737 seconds