why not all tables are displayed in SQuirrel-SQL - oracle

Using Oracle DB 10 and SQuirrel 3.7.1
Not all tables are displayed in 'Objects-tab -> schemeName -> table' list.
If I write in the SQL tab select * from tableName I get a result, but the table is not displayed on the list above.
How can it be fixed ?

tableName might not be a table. It can be e.g. a view, synonym, materialized view so it would then be displayed under its node (i.e. not for "tables" but for "views" etc.).

Related

How to get the CREATE query of an existing materialized view in Hive?

I want to extract the entire create query of a materialized view present in Hive. How can I do that? I have the underlying query for data but I want the create query to include storage characteristics, etc.
Two options -
use describe formatted mv_name anad then refer to the 'view original text' line for view SQL.
xx is the name of materialized view
if you are using hue, then you can use table browser to check MV definition/SQL used to create it.
Here is a screenshot on how to get the SQL - xx is the name of materialized view. Create statement below.
CREATE MATERIALIZED VIEW xx AS SELECT * FROM activity;
2.1 Click on 'i' and then click on 'Table Browser'.
2.2 Click on 'view sql' to see view query.

Oracle context index: doesn't work over dblink

There are two db's, table test_table on db1 with context index by field a. Query:
select *
from test_table t
where contains(t.a, 'str') > 0
It works fine on db1. But when I try execute same query over dblink from other database:
select *
from test_table#db1 t
where contains(t.a, 'str') > 0
I get this error:
ora-20000: Oracle Text Error:
DRG-10599: column is not indexed
You have to add dblink to function.
https://docs.oracle.com/cd/E11882_01/text.112/e24436/csql.htm#CCREF0104
The CONTAINS operator also supports database links. You can identify a
remote table or materialized view by appending #dblink to the end of
its name. The dblink must be a complete or partial name for a database
link to the database containing the remote table or materialized view.
(Querying of remote views is not supported.)
select *
from test_table#db1 t
where contains(t.a, 'str')#db1 > 0.

Why does SQL Developer think there's an error in my materialized views?

I created some materialized views and Oracle SQL Developer puts a little red 'x' next to each of them. At the moment they are returning the correct information when I query them and running the following query in SQL Plus suggests that there are no errors:
SELECT * FROM USER_SNAPSHOTS
The ERROR column in this returns 0 for the materialized views in question.
Does anyone know why SQL Developer thinks there is an error? Is there anywhere else I can check?
UPDATE
Taking Patrick's advice I ran the following query:
SELECT * FROM ALL_MVIEWS
The COMPILE_STATE is 'NEEDS_COMPILE' for each view in question. What does this mean? Why would it need to be recompiled? None of the underlying tables have been changed.
To fix 'red' cross icon on views (actually it is a white cross over red background) due to NEEDS_COMPILE run the ALTER VIEW COMMAND.
ALTER VIEW MY_VIEW COMPILE;
Check ORACLE SQL Reference about ALTER VIEW.
http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_4004.htm
For some reason, simply refreshing the materialized views made the 'error' go away. So not a true error, more of a reminder that the data isn't up to date. I guess you can ignore it if the table structure hasn't actually changed then...
This can be caused by modifications to an underlying table that the materialized view is based on. For example: increasing the max size of a column in the table which is included in the materialized view.
To refresh the materialized view you can do the following:
BEGIN
DBMS_SNAPSHOT.REFRESH('Name of materialized view');
END;

can not see table in tree view of sql developer

I can not see table in tree view of sql developer
but I can execute select statement for that table.
I logged in with 'carspgm' user and I executed below query then i can see the data but when I expand the carsdb table tree I can not see this below table.
I want to find out why I can not see and I want to find what all trigger are there on this table
select * from carsdb.COMAPNY_STATE
Please Help
Try selecting the "Other USers" treenode, and you should see "CARSDB" schema under which you will see objects owned by that user/schema.
check with the following
select * from user_tables where table_name='COMAPNY_STATE';
--the above query will return the data of table
desc COMAPNY_STATE;
--the above statement will describes the tables with columns and their data typed
If the first statement was executed then return a row then table was created.
If second statement was executed and table was exist.

No results when querying wwv_flow_files

Oracle SQL Developer 3.0.03
Why do I not see any results when I run the following query in SQL Developer?
select * from wwv_flow_files;
Yet, if I run the same query in APEX SQL Commands, I see results.
It may be because
WWV_FLOW_FILES is view top of table WWV_FLOW_FILE_OBJECTS$. From
WWV_FLOW_FILES
view you can access files only associated to your workspace.

Resources