[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

11/02/2009 at 08:38PM PST, ID: 24866136
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.0

what's wrong with this pl sql procedure?

Asked by Hoboly in Oracle CRM, PL / SQL

Tags: Oracle, pl sql

I don't know what's wrong:
eg: where to put declare, why can't have two into, etc

Thanks!
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
create or replace procedure sp_logontime_examption is
declare
  cursor lan;
  cursor per_month;
  number max_diff;
  number avg_diff;
begin 
  update logontime_dailytemp t set examption_part = 'N', examption_full = 'N';
  
  
  open lan for select t.zonename, t.slr from logontime_ipmap t;
  for lan1 in lan loop
      update logontime_dailytemp t set (examption_full) = ('Y')  
            where exists 
             (    select 1 from logontime_dailytemp s where s.task_id=t.task_id and (abs(t.task_start_datetime-s.task_start_datetime)/ 1.15740740740741E-5 <= 30*60 ) 
                  and t.diff > lan1.slr and s.diff<= lan1.slr and examption_full='N' and rownum<=1
             ) and t.task_id=lan1.zonename;
             
--      select avg(diff) into 
       open per_month for select distinct to_char(task_start_datetime, 'YYYY-MM') from logontime_dailytemp;
       max_diff := 99999;
       for month1 in per_month loop
                  select ad into avg_diff, md into max_diff from 
                  (select avg(diff) ad, max(diff) md
                         from logontime_dailytemp 
                  where to_char(task_start_datetime, 'YYYY-MM')=month1 and examption_part='N' and diff<max_diff and task_id = lan1.zonename group by 1);
       end loop;    
             
  end loop;  
  
      update logontime_dailytemp t set examption_full = 'Y'
            where exists 
             (    select 1 from logontime_dailytemp s where s.task_id=t.task_id and (abs(t.task_start_datetime-s.task_start_datetime)/ 1.15740740740741E-5 <= 30*60 ) 
                  and t.diff > 30 and s.diff<= 30 and rownum<=1
             ) and t.task_id='KAH'; 
 
end sp_logontime_examption;
[+][-]11/02/09 08:45 PM, ID: 25726115

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Oracle CRM, PL / SQL
Tags: Oracle, pl sql
Sign Up Now!
Solution Provided By: rrjegan17
Participating Experts: 3
Solution Grade: A
 
 
[+][-]11/02/09 08:48 PM, ID: 25726128

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]11/02/09 10:11 PM, ID: 25726404

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/02/09 10:13 PM, ID: 25726414

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/02/09 10:16 PM, ID: 25726428

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]11/03/09 12:06 AM, ID: 25726842

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]11/03/09 12:23 AM, ID: 25726908

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
 
Loading Advertisement...
20090824-EE-VQP-74 - Hierarchy / EE_QW_3_20080625