0

The question is:

List of the DW1_ tables from the USER_OBJECTS with table names, creation date and time in ISO standard.

that's what I have so far, but it does not work.

select table_name, to_char(create_date, 'yyyy-mm-dd') from all_tables 
where table_name like 'DW1%'
group by table_name;

It said create_date is invalid identifier.

Can anyone help me with this question?

5
  • Create Date is not a field in all_tables from my understanding... Commented Mar 15, 2013 at 3:04
  • should be from user_objects not all_tables, but I still dont know which method I could use here. Commented Mar 15, 2013 at 3:06
  • stackoverflow.com/questions/4442323/… Commented Mar 15, 2013 at 3:07
  • select object_name, to_char(created, 'yyyy-mm-dd') "Creation date" from user_objects where object_name like 'DW1%'; thx everyone anyways Commented Mar 15, 2013 at 3:10
  • If you're looking for table names that begin with "DW1_", what you need is: table_name like 'DW1_%' escape '\' Commented Mar 15, 2013 at 8:17

3 Answers 3

7

Is this what you're looking for?

select object_name, created 
from user_objects 
where object_name LIKE 'DW1%' 
    and object_type = 'TABLE';

SQL Fiddle Demo

Sign up to request clarification or add additional context in comments.

1 Comment

Why do I prefer this answer, using user_objects, compared to those using dba_objects? Because often there are no read permissions on dba_objects, but on user_objects.
1
select object_name, to_char(created, 'yyyy-mm-dd') AS created -- 'AS' is optional
  from user_objects 
 where object_name like 'EMP%' -- replace with your table
/

Comments

0

try this

SELECT object_name tablename, created FROM dba_objects
WHERE object_name like 'DW1%'
and object_type = 'TABLE'

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.