Home » SQL & PL/SQL » SQL & PL/SQL » Return data from select table or View (n/a)
Return data from select table or View [message #277808] Wed, 31 October 2007 14:23 Go to next message
alexaoracle
Messages: 36
Registered: October 2007
Member
hi,
when you execute SELECT * FROM table_name,
how do you know you are getting the data directly from the real table or from a view?
Even knowing that you could create a view by selecting all from this table
Re: Return data from select table or View [message #277809 is a reply to message #277808] Wed, 31 October 2007 14:26 Go to previous messageGo to next message
BlackSwan
Messages: 25036
Registered: January 2009
Location: SoCal
Senior Member
>how do you know you are getting the data directly from the real table or from a view?
Why does it matter?
Re: Return data from select table or View [message #277812 is a reply to message #277809] Wed, 31 October 2007 14:32 Go to previous messageGo to next message
alexaoracle
Messages: 36
Registered: October 2007
Member
I want to know that I´m dealing directly with it.
I have to databases, and I have to do some developings.
When I make a query to both tables the data returned is different. So I really need to know perhaps one is a view, but how do I know this, since I didn´t create them
Re: Return data from select table or View [message #277815 is a reply to message #277808] Wed, 31 October 2007 14:36 Go to previous messageGo to next message
BlackSwan
Messages: 25036
Registered: January 2009
Location: SoCal
Senior Member
>When I make a query to both tables the data returned is different.
The data may very well be different.
SELECT COUNT(*) FROM USER_VIEW WHERE VIEW_NAME = 'YOUR_TABLE_NAME';
Re: Return data from select table or View [message #277819 is a reply to message #277815] Wed, 31 October 2007 14:47 Go to previous messageGo to next message
alexaoracle
Messages: 36
Registered: October 2007
Member
Smile thanks
FROM USER_VIEWs
and is not a view, hmmmm....
Re: Return data from select table or View [message #277824 is a reply to message #277808] Wed, 31 October 2007 15:36 Go to previous messageGo to next message
MarcL
Messages: 455
Registered: November 2006
Location: Connecticut, USA
Senior Member
Whoever said user_views wasn't a view ?
select object_type from user_objects where object_name='YOUROBJECTNAME';
Re: Return data from select table or View [message #277826 is a reply to message #277808] Wed, 31 October 2007 16:00 Go to previous messageGo to next message
alexaoracle
Messages: 36
Registered: October 2007
Member
Smile thanks for that
Re: Return data from select table or View [message #277849 is a reply to message #277808] Wed, 31 October 2007 19:49 Go to previous messageGo to next message
Kevin Meade
Messages: 2101
Registered: December 1999
Location: Connecticut USA
Senior Member
There is also

dbms_utility.name_resolve

it may be of some service to you. It is an ugly thing. However, if you are writing a production piece of code, it is usually best to avoid directly querying the data dictionary, if there is an API offered by the database to get what you want.

its just a thought.

good luck, Kevin
Re: Return data from select table or View [message #279532 is a reply to message #277849] Thu, 08 November 2007 22:50 Go to previous message
alexaoracle
Messages: 36
Registered: October 2007
Member
hey, thanks
Previous Topic: Need help with Date format
Next Topic: Regarding append a 2 digit value to product value (merged)
Goto Forum:
  


Current Time: Sun Dec 04 23:11:19 CST 2016

Total time taken to generate the page: 0.08068 seconds