Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 22nd, 2004, 01:28 PM
mrgreenfur mrgreenfur is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 18 mrgreenfur User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
oracle view's and stored procedures

Hello,

I have a number of small tables I need to get bits of information from and put them all into a view. There is fairly intricate logic to decide which info comes from which table. Is it posisble to write a procedure/function that does all the logic and returns a table; then I'd like to use this table to define the view.

If so, can anyone point me in the right direction of how to return a table from a stored procedure?

I've worked with sql a lot, but this is my first attempt at pl/sql.

Thanks!

Reply With Quote
  #2  
Old November 22nd, 2004, 05:01 PM
jim mcnamara jim mcnamara is offline
......@.........
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jun 2004
Posts: 1,308 jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 5 h 20 m 49 sec
Reputation Power: 48
Oracle 9i SQL supports case statements which let you put conditional logic in a view.

Otherwise, you have to write a SQLPLUS callable function (PRAGMA RESTRICT_REFERENCES) that returns every 'view' column all the time, and allows only a small amount of filtering. Which is not very view-like.

See http://www.orafaq.com for some PL/SQL help with this kind of function.

Reply With Quote
  #3  
Old November 25th, 2004, 11:25 PM
mrgreenfur mrgreenfur is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 18 mrgreenfur User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks for the info/advice. I'll post my solution here if I ever get one

Thanks again!

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > oracle view's and stored procedures


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT