Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2013-01-02
4
Medium Priority
?
474 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
Via a live example, show how to take different types of Oracle backups using RMAN.

718 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