Home » SQL & PL/SQL » SQL & PL/SQL » SQL (generic)
SQL [message #407430] Wed, 10 June 2009 03:05 Go to next message
gkrishn
Messages: 506
Registered: December 2005
Location: Putty a dark screen
Senior Member
Hi i would need help with oen query.

i want to find the difference in number of records between tables in two different databases, both has same tables.

i tried to just do a select but it doesnt work.

select table_name,num_rows,P.table_name,P.num_rows 
from dba_tables,dba_tables@DB2 P
where owner='SCOTT' and table_name=P.table_name
Re: SQL [message #407431 is a reply to message #407430] Wed, 10 June 2009 03:08 Go to previous messageGo to next message
ThomasG
Messages: 3189
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
Quote:
it doesnt work.


That is not an Oracle error message. Since you don't tell us the actual error, we have to start troubleshooting at the beginning.

Is the computer turned on?
Re: SQL [message #407432 is a reply to message #407430] Wed, 10 June 2009 03:09 Go to previous messageGo to next message
karthick_arp
Messages: 13
Registered: February 2006
Location: hyderabad
Junior Member
>>i tried to just do a select but it doesnt work.

Can you elaborate this and tell us whats not working.
Re: SQL [message #407434 is a reply to message #407430] Wed, 10 June 2009 03:10 Go to previous messageGo to next message
gkrishn
Messages: 506
Registered: December 2005
Location: Putty a dark screen
Senior Member
Yes i turned the computer on.

error is ORA-00918 :column ambiguously defined .
Re: SQL [message #407435 is a reply to message #407434] Wed, 10 June 2009 03:14 Go to previous messageGo to next message
ThomasG
Messages: 3189
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
Then you have to specify which table you mean every time.

select L.table_name,L.num_rows,P.table_name,P.num_rows 
from dba_tables L, dba_tables@DB2 P
where L.owner='SCOTT' and L.table_name=P.table_name
Re: SQL [message #407509 is a reply to message #407434] Wed, 10 June 2009 06:27 Go to previous message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
@gkrishn rather than a completely useless subject header of 'SQL' if you had made the subject something like: "ORA-00918 :column ambiguously defined " then this would make it much, much easier for people who have this issue in the future to find this thread. Please try to use more useful subject lines.
Previous Topic: ORA-00907: missing right parenthesis while creating the table with datatype timestamp
Next Topic: TNS-12513 TNS:service handler found but it has registered for a different protocol
Goto Forum:
  


Current Time: Sat Dec 03 09:45:39 CST 2016

Total time taken to generate the page: 0.09095 seconds