Advertisement

08.19.2008 at 07:07PM PDT, ID: 23661807
[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!

6.6

function is not updating

Asked by mock5c in PostgreSQL Database

Tags:

This is my first function in postgres.  It is supposed to do some simple updating.  I test it like this:

select mf_finalize_run(4293787,4329997,'mygroup',1100,51)

and it runs and returns 1.  But the fields that should be updated are not.

What am I missing in this function?
Start Free Trial
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:
41:
42:
43:
44:
45:
46:
47:
-- Function: mf_finalize_run(integer, integer, character varying, integer, integer)
 
-- DROP FUNCTION mf_finalize_run(integer, integer, character varying, integer, integer);
 
CREATE OR REPLACE FUNCTION mf_finalize_run(integer, integer, character varying, integer, integer)
  RETURNS integer AS
'
declare
   ijob_id alias for $1;
   iset_id alias for $2;
   svgroup alias for $3;
   iotype alias for $4;
   iruntype_id alias for $5;
   
begin
   -- Check that we have valid arguments
   if (ijob_id is null) or (iset_id is null) or (svgroup is null) or (iotype is null) or (iruntype_id is null) then
      raise exception ''None of the arguments can be null'';
   end if;
 
   -- Make the run available
   update run_u set status = ''available''
      where vgroup = ''svgroup'' and job_id = ijob_id and runtype_id = iruntype_id;
 
   -- Link the runlink to the set
   update runlink_u set id_val = iset_id
      where tbl_otype = iotype and vgroup = ''svgroup'' and id in (
         select rl.id from run r
         inner join runlink rl on r.id=rl.run_id
         where rl.vgroup = ''svgroup'' and r.job_id = ijob_id and rl.tbl_otype = iotype
      );
 
   -- Time stamp the run
   update run_u set finish=now()
      where job_id = ijob_id and runtype_id = iruntype_id and job_vgroup = ''svgroup'';
 
   update run_u set failed=false
      where job_id = ijob_id and runtype_id = iruntype_id and job_vgroup = ''svgroup'';
	
   -- Mark run as finished
   update run_u set status = ''finished''
      where job_id = ijob_id and runtype_id = iruntype_id and job_vgroup = ''svgroup'';
 
   return 1;
end;
'
  LANGUAGE 'plpgsql' VOLATILE;
[+][-]08.20.2008 at 08:39AM PDT, ID: 22270823

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

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

 
[+][-]08.20.2008 at 09:37AM PDT, ID: 22271517

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.20.2008 at 10:59AM PDT, ID: 22272236

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

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

 
[+][-]08.20.2008 at 11:13AM PDT, ID: 22272356

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.20.2008 at 11:19AM PDT, ID: 22272423

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

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

 
[+][-]08.20.2008 at 11:42AM PDT, ID: 22272638

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.20.2008 at 02:07PM PDT, ID: 22273940

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.20.2008 at 02:49PM PDT, ID: 22274303

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.20.2008 at 03:31PM PDT, ID: 22274557

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

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

 
[+][-]09.22.2008 at 03:05PM PDT, ID: 22544657

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

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

 
[+][-]09.27.2008 at 06:51AM PDT, ID: 22587027

View this solution now by starting your 7-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

Zone: PostgreSQL Database
Tags: Postgres plpgsql
Sign Up Now!
Solution Provided By: Computer101
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628