Advertisement

08.13.2004 at 01:09AM PDT, ID: 21092483
[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!

8.2

[HELP] Stored Procedure, Trigger, Trigger Function

Asked by engtat in PostgreSQL Database

Tags: , ,

Platform: Postgre 7.x and PgAdmin III

tbltest table
Code:
CREATE TABLE public.tbltest
(
  test_id int2 NOT NULL DEFAULT 0,
  name text,
  CONSTRAINT tbltest_pkey PRIMARY KEY (test_id)
) WITH OIDS;

tblresult table
Code:
CREATE TABLE public.tblresult
(
  result_id int2 NOT NULL DEFAULT 0,
  name text,
  found bool,
  position int8,
  CONSTRAINT tblresult_pkey PRIMARY KEY (result_id)
) WITH OIDS;

trigger
Code:
CREATE TRIGGER tr_log_update
  BEFORE INSERT
  ON public.tbltest
  FOR EACH ROW
  EXECUTE PROCEDURE public.log_update();

trigger function
Code:
CREATE OR REPLACE FUNCTION public.log_update()
  RETURNS trigger AS
'BEGIN
      UPDATE tblresult SET found = TRUE WHERE name = NEW.name;
RETURN NULL;
END;
'
  LANGUAGE 'plpgsql' VOLATILE;

Here is what I want,
1. Insert a new entry to table tbltest with id and name
2. Trigger started, run stored procedure.
3. If the name on table tblresult is found and match, the flag(boolean) will set to true.

Error when run this SQL
INSERT INTO tbltest VALUES (123, 'beta');

Code:
WARNING:  Error occurred while executing PL/pgSQL function log_update
WARNING:  line 2 at SQL statement
ERROR:  parser: parse error at or near "$1" at character 23

Thanks in advanceStart Free Trial
[+][-]08.13.2004 at 03:57AM PDT, ID: 11791632

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

 
[+][-]08.15.2004 at 08:47PM PDT, ID: 11806887

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

 
[+][-]08.17.2004 at 08:58AM PDT, ID: 11821983

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

 
[+][-]08.17.2004 at 07:19PM PDT, ID: 11827081

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

 
[+][-]08.17.2004 at 09:10PM PDT, ID: 11827429

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

 
[+][-]08.17.2004 at 11:17PM PDT, ID: 11827828

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

 
[+][-]08.18.2004 at 01:11AM PDT, ID: 11828220

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

 
[+][-]08.18.2004 at 02:52AM PDT, ID: 11828837

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

 
[+][-]08.19.2004 at 05:52PM PDT, ID: 11848263

View this solution now by starting your 14-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: procedure, stored, trigger
Sign Up Now!
Solution Provided By: earthman2
Participating Experts: 2
Solution Grade: A
 
 
[+][-]08.19.2004 at 07:37PM PDT, ID: 11848830

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

 
[+][-]08.20.2004 at 09:30AM PDT, ID: 11852941

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

 
[+][-]08.20.2004 at 10:03AM PDT, ID: 11853304

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

 
[+][-]08.22.2004 at 06:25PM PDT, ID: 11866716

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

 
[+][-]08.22.2004 at 09:00PM PDT, ID: 11867163

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

 
 
Loading Advertisement...
20081112-EE-VQP-43