Solved

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

Posted on 2013-01-02
4
468 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 76

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 76

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
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.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

813 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now