Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2008
    Posts
    1

    Unanswered: store procedure with two table

    anyone can help me, i want make a store procedure to validate a date using two table example:

    CREATE OR REPLACE FUNCTION arrange_tgl()
    RETURNS "trigger" AS
    $BODY$
    declare
    id_category1 integer;
    birth_date1 date;

    begin
    select id_category from as_bintang into id_category1 where id_category=new.id_category;

    select birth_date from as_member into birth_date1 where birth_date=new.birth_date;


    if birth_date1 >= substring ('1900-01-21',6) and birth_date1 >= substring ('1900-01-21',6)
    birth_date1 :='1';


    end if;


    return new;
    insert into as_member values (birth_date1);



    end;
    $BODY$
    LANGUAGE 'plpgsql' VOLATILE;

    but when i insert data to database i found error msg. anyone please help me
    Edit/Delete Message
    Last edited by chapter; 07-06-08 at 08:13.

  2. #2
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    what was the error message?
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •