Home » SQL & PL/SQL » SQL & PL/SQL » Query to show both tables & sequences (10.2.0.3 running on AIX 5.3)
Query to show both tables & sequences [message #385879] Wed, 11 February 2009 12:47 Go to next message
divroro12
Messages: 105
Registered: March 2008
Location: Laurel, MD USA
Senior Member
Hi All,

Can someone please help me with a query that can show all the tables & associated sequences within the same schema in an Oracle database?

Thanks,

divroro12
Re: Query to show both tables & sequences [message #385880 is a reply to message #385879] Wed, 11 February 2009 12:48 Go to previous messageGo to next message
joy_division
Messages: 4641
Registered: February 2005
Location: East Coast USA
Senior Member
Sequences are not associated with tables in any way. They are independent objects. What makes you think a sequence is associated with a table?
Re: Query to show both tables & sequences [message #385882 is a reply to message #385879] Wed, 11 February 2009 13:02 Go to previous messageGo to next message
divroro12
Messages: 105
Registered: March 2008
Location: Laurel, MD USA
Senior Member
My language is probably misleading. What i'm trying to get here is a single query that can show all tables & all sequences within a schema.

Thanks,

divroro12
Re: Query to show both tables & sequences [message #385883 is a reply to message #385882] Wed, 11 February 2009 13:14 Go to previous messageGo to next message
Michel Cadot
Messages: 64122
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
select 'TABLE' "TYPE", table_name from user_tables
union all
select 'SEQUENCE', sequence_name from user_sequences
/

Regards
Michel

[Updated on: Wed, 11 February 2009 13:16]

Report message to a moderator

Re: Query to show both tables & sequences [message #385884 is a reply to message #385879] Wed, 11 February 2009 13:15 Go to previous messageGo to next message
BlackSwan
Messages: 25042
Registered: January 2009
Location: SoCal
Senior Member
http://www.dbforums.com/oracle/1638203-query-showing-tables-sequences.html
Re: Query to show both tables & sequences [message #385889 is a reply to message #385879] Wed, 11 February 2009 14:04 Go to previous messageGo to next message
divroro12
Messages: 105
Registered: March 2008
Location: Laurel, MD USA
Senior Member
Thanks Michel

divroro12
Re: Query to show both tables & sequences [message #386062 is a reply to message #385883] Thu, 12 February 2009 07:28 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Select object_name
,object_type
from all_objects
where owner = <schema owner>
and object_type in ('TABLE','SEQUENCE')
order by object_type,object_name
Previous Topic: How to delete duplicate rows with reverse data
Next Topic: need solution
Goto Forum:
  


Current Time: Wed Dec 07 05:00:06 CST 2016

Total time taken to generate the page: 0.17369 seconds