database.sarang.net
UserID
Passwd
Database
DBMS
MySQL
ㆍPostgreSQL
Firebird
Oracle
Informix
Sybase
MS-SQL
DB2
Cache
CUBRID
LDAP
ALTIBASE
Tibero
DB 문서들
스터디
Community
공지사항
자유게시판
구인|구직
DSN 갤러리
도움주신분들
Admin
운영게시판
최근게시물
PostgreSQL Q&A 4377 게시물 읽기
No. 4377
황치영님 감사합니다. 그런데, Error가...
작성자
김선혁
작성일
2002-10-10 13:33
조회수
1,147

안녕하세요...

 

답변주셔서 감사합니다. 이해가 잘 갑니다. 그런데 치영님께서 말씀하신 것을 기간으로 제 상황에 맞게 TRIGGER하고 FUNCTION을 만들었는데 ERROR가 생기고 있습니다.

 

제가 reservation table을 update 하면 function을 불러 실행을 시키는데

다음과 같은 error가 나오는 데요,

"parse: parse error near at 'radd1'""

무슨 문제지 도통....모르겠습니다.

 

밑에는 제가 작성한 trigger과 function이고 시간이 나시면 한번 봐주셨으면 감사하겠습니다. 죄송합니다. DB를 다루는 것은 이번이 처음이라서요...

 

행복한 하루되십시요, 그럼 이만.

 

====================================================================

CREATE TRIGGER create_placement_record

BEFORE INSERT OR UPDATE

ON reservation

FOR Each ROW

EXECUTE PROCEDURE fnc_create_placementRecord();

 

CREATE OR REPLACE FUNCTION fnc_create_placementRecord() RETURNS OPAQUEAS '

DECLARE

 

registration_id text; -- X_rrecnum

R_Address_1 text;

R_Address_2 text;

R_Age text;

R_City text;

R_district text;

R_Email text;

R_ESL text;

R_Ethnicity text;

R_Free_Lunch text;

R_FullName text;

R_Gender text;

R_location text;

R_Member_Type text;

R_PF_ID text;

R_Phone text;

R_Regis_Create_Date DATE;

R_Regis_Edit_Date DATE;

R_School text;

R_Special_Needs text;

R_SSchCode text;

R_State text;

R_Talented_Gifted text;

R_URL text;

R_ZipCode text;

user_code text;

 

BEGIN

reserv_status := new.resrvation_status;

 

IF (reserv_status = ''Congratulations!'') OR (reserv_status = ''Place

Applicant'') OR (reserv_status = ''Registration Complete'') THEN

 

registration_id := new.xrrecnum;

SELECT INTO user_code rusercode, R_Address_1 RAdd1, R_Address_2 RAdd2, R_Age RAge, R_City RCity, R_district RExtra2,

R_Email REmail, R_ESL RESL, R_Ethnicity REthnicity, R_Free_Lunch RFreeLunch, R_FullName RFullName, R_Gender RGender, R_location RExtra3, R_Member_Type RMembType, R_PF_ID RYPathID, R_Phone RPhHome, R_Regis_Create_Date RCreation, R_Regis_Edit_Date

REdit, R_School RSchool, R_Special_Needs RSpecialNeeds, R_State

RState, R_Talented_Gifted RTalentedG, R_URL RURL, R_ZipCode RZip FROM registration WHERE rrecnum = registration_id; INSERT INTO web_evaluation (X_related_usercode, R_Address_1, R_Address_2, R_Age, R_City, R_district, R_Email, R_ESL,

R_Ethnicity, R_Free_Lunch, R_FullName, R_Gender, R_location, R_Member_Type, R_PF_ID, R_Phone, R_Regis_Create_Date, R_Regis_Edit_Date, R_School, R_Special_Needs, R_State, R_Talented_Gifted, R_URL RURL, R_ZipCode, R_SSchCode) VALUES (user_code, R_Address_1, R_Address_2, R_Age, R_City, R_district, R_Email, R_ESL, R_Ethnicity, R_Free_Lunch, R_FullName, R_Gender, R_location, R_Member_Type, R_PF_ID, R_Phone, R_Regis_Create_Date, R_Regis_Edit_Date,

R_School, R_Special_Needs, R_State, R_Talented_Gifted, R_URL RURL,

R_ZipCode, R_SSchCode);

 

END IF;

END;LANGUAGE 'plpgsql';

이 글에 대한 댓글이 총 1건 있습니다.

단순히 신택스 에러일거같네요

 

게시판특성때문인지 모르겠지만

 

returns opaque as 에서 칸이 안띄어져있고

 

맨뒤 language앞에 홑따옴표 하나빠져있고,,

 

어쨌든 위에러는 파싱에러니까 우선 띄어쓰기나 따옴표가 제대로 됬는지 확인을..

황치영님이 2002-10-10 14:36에 작성한 댓글입니다.
[Top]
No.
제목
작성자
작성일
조회
4381[질문] 답변이 없으셔서 재질문 ^^; [1]
이근호
2002-10-11
796
4396┕>Re: [질문] 답변이 없으셔서 재질문 ^^;
이근호
2002-10-22 16:40:05
721
4380count(count(*))를 대체할 수 있는 함수가 있나요? [2]
강희정
2002-10-11
1874
4378[질문] Ant를 어떻게 설치해야 하는지요...==; [1]
이근호
2002-10-10
841
4377황치영님 감사합니다. 그런데, Error가... [1]
김선혁
2002-10-10
1147
4376[질문]JDBC 드라이버 설치하기.
이근호
2002-10-10
1024
4375Invalid EUC_KR character sequence found(0xc000) [1]
장승현
2002-10-10
960
4379┕>Re: Invalid EUC_KR character sequence found(0xc000)
어떤생각
2002-10-10 23:28:06
1328
4373pg 에서 ODBC 연결 에러 [2]
yosiah
2002-10-10
1109
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2024 DSN, All rights reserved.
작업시간: 0.018초, 이곳 서비스는
	PostgreSQL v16.2로 자료를 관리합니다