1

This might be a very basic question but I can't find the correct command for it.

I can list the datafields in a table using the command

select * from cat where table_name='mytable';

How do I check the data that has been inserted in this table using sqlplus?

user1439090
  • 792
  • 5
  • 12
  • 33
  • 2
    Can you try `select * from mytable`? – Nitzle Jul 05 '12 at 04:28
  • I tried that. But it gives me an error saying that 'invalid table name'. However I can see the table when I execute the query that I mentioned in the question. – user1439090 Jul 05 '12 at 04:44
  • 1
    Are you putting the table name in quotes when you try to select? Oracle treats table names in quotes as case-sensitive; you might have better luck if you leave out the quotes. See [this answer](http://stackoverflow.com/a/563126/1303955). – Nitzle Jul 05 '12 at 04:48
  • possible duplicate of [ORA-00904: invalid identifier](http://stackoverflow.com/questions/6027961/ora-00904-invalid-identifier) – APC Jul 05 '12 at 05:14
  • yes I was using quotes with the table name. Leaving the quotes out allowed me to access the data. Thank you for your help. – user1439090 Jul 05 '12 at 05:36

2 Answers2

3

You can get all the data from a table by using the simple statement:

select * from <table name>;

so if you want to get all the data from the table cat, try:

select * from cat;

if you'd like to get all the data from mytable, try:

select * from mytable;

any where clause that you define in the statement is used to filter the results that this simple 'select everything from' statement would return.

akf
  • 38,619
  • 8
  • 86
  • 96
1

connect to the desired user in which you want to see tables SQL QUERY: select table_name from user_tables;

Omer
  • 39
  • 5