Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2013-01-02
4
Medium Priority
?
477 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 78

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 78

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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

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.
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Suggested Courses

916 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