Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > PostgreSQL > store procedure with to table

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-06-08, 08:00
chapter chapter is offline
Registered User
 
Join Date: Jul 2008
Posts: 1
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.
Reply With Quote
  #2 (permalink)  
Old 07-07-08, 17:22
loquin loquin is offline
Super Moderator
 
Join Date: Jun 2004
Location: Arizona, USA
Posts: 1,354
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

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On