Solved

Adding/Modifying SQL query to an Oracle's table views

Posted on 2013-01-02
4
469 Views
Last Modified: 2013-01-02
Dear Experts,

I have an Oracle's table view named "HOURLY_DATA" with the following query:


  CREATE OR REPLACE FORCE VIEW "MISSION"."HOURLY_DATA" ("DAY", "TIME", "TAGID", "TURBINE", "VALUE", "CNT", "UP_CNT", "PEAK", "MINIMUM") AS
  select a.day, a.time, a.tagid, a.turbine, a.value, a.cnt, a.up_cnt, a.peak, a.minimum
from HOURLY_1301 a union all
select a.day, a.time, a.tagid, a.turbine, a.value, a.cnt, a.up_cnt, a.peak, a.minimum
from HOURLY_1302 a  union all
select a.day, a.time, a.tagid, a.turbine, a.value, a.cnt, a.up_cnt, a.peak, a.minimum
from HOURLY_1303 a  union all
select a.day, a.time, a.tagid, a.turbine, a.value, a.cnt, a.up_cnt, a.peak, a.minimum
from HOURLY_1304 a union all
select a.day, a.time, a.tagid, a.turbine, a.value, a.cnt, a.up_cnt, a.peak, a.minimum
from HOURLY_1305 a union all
select a.day, a.time, a.tagid, a.turbine, a.value, a.cnt, a.up_cnt, a.peak, a.minimum
from HOURLY_1306 a union all
select a.day, a.time, a.tagid, a.turbine, a.value, a.cnt, a.up_cnt, a.peak, a.minimum
from HOURLY_1307 a union all
select a.day, a.time, a.tagid, a.turbine, a.value, a.cnt, a.up_cnt, a.peak, a.minimum
from HOURLY_1308 a union all
select a.day, a.time, a.tagid, a.turbine, a.value, a.cnt, a.up_cnt, a.peak, a.minimum
from HOURLY_1309 a union all
select a.day, a.time, a.tagid, a.turbine, a.value, a.cnt, a.up_cnt, a.peak, a.minimum
from HOURLY_1310 a union all
select a.day, a.time, a.tagid, a.turbine, a.value, a.cnt, a.up_cnt, a.peak, a.minimum
from HOURLY_1311 a union all
select a.day, a.time, a.tagid, a.turbine, a.value, a.cnt, a.up_cnt, a.peak, a.minimum
from HOURLY_1312 a union all
select a.day, a.time, a.tagid, a.turbine, a.value, a.cnt, a.up_cnt, a.peak, a.minimum
from hourly_1212 a;

When I validated it, there were couple of tables that weren't created at the time, so it failed.  After I cancelled out the query validation, everything is gone.  I'd like to put the above query back into that "HOURLY_DATA" table view using Oracle SQL Developer.  Could you please let me know how this can be done?  Thanks.
0
Comment
Question by:swgit
  • 2
  • 2
4 Comments
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 38737968
I'm not a SQL Developer expert but can you not just paste that create statement into the SQL worksheet and execute it?

Also, you should not use double quotes around Oracle object names.  It forces case sensitivity and will cause you problems in the future if you have a lower case character in the name.
0
 
LVL 1

Author Comment

by:swgit
ID: 38737987
I guess I can, but I don't know how.  How do I access the "worksheet"?  Please advise.  If it's easier for you to instruct via command, I can do that as well.  I'm running Oracle 11g, and am very new to Oracle.  Hence, the detail steps would be greatly appreciated.
0
 
LVL 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 500 total points
ID: 38738009
>>How do I access the "worksheet"?  

Check out this small how-to tutorial.

http://www.oracle.com/technetwork/developer-tools/sql-developer/query-intro-1-161240.html

>>via command, I can do that as well

When you installed Oracle on the server or if you installed the client on your worksatation, you should have sqlplus.  This is the command line access to Oracle.
0
 
LVL 1

Author Closing Comment

by:swgit
ID: 38738040
@slightwv - you rock!!  thanks so much!  got it :)
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question