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
운영게시판
최근게시물
Informix Q&A 1466 게시물 읽기
No. 1466
스토어드 프로시져 에러 좀 봐주세요
작성자
초보
작성일
2002-08-07 14:54
조회수
4,560

테이블을 커서로 읽어 루프를 돌리면서 insert / update하는 프로시져인데

인포믹스를 처음 사용하여 프로시져 문법을 잘 모르겠어요

계속 문법 에러가 나는데 어디가 문제인지 봐주세요

 

[문제의 프로시져]

-- KBP 마스타

Create Procedure KN_MAster (

p_Date integer

)

 

returning integer;

begin Declare Section;

char standcode[12];

char standkorname[40];

int balhaengilja;

int machulilja;

int mangiilja;

float couponiyul;

float balhaengiyul;

float halinyul;

char ijagyesangb[2];

int ijagyesangigan;

char ijahusungb[1];

char gwasegb[1];

char sinyongcode[4];

char sinyongrank[4];

char byunrucode[7];

char byunruname[40];

char companycode[5];

char balhangcode[5];

char balhaenggigwan[40];

char bojungcode[5];

char bojungrank[4];

char bojungname[40];

char saupjacode[10];

char beobincode[13];

char balhaengrank[4];

char gongsagb[1];

char jasanmovegb[1];

end Declare Section;

 

declare Acur Cursor for

select standcode, standkorname, balhaengilja, machulilja, mangiilja, couponiyul,

balhaengiyul, halinyul, ijagyesangb, ijagyesangigan, ijahusungb, gwasegb,

sinyongcode, sinyongrank, byunrucode, byunruname, companycode, balhangcode,

balhaenggigwan, bojungcode, bojungrank, bojungname, saupjacode, beobincode,

balhaengrank, gongsagb, jasanmovegb

from bdKBPsise

where Gijunilja = p_Date;

 

open Acur;

Fetch Acur :standcode, :standkorname, :balhaengilja, :machulilja, :mangiilja, :couponiyul,

:balhaengiyul, :halinyul, :ijagyesangb, :ijagyesangigan, :ijahusungb, :gwasegb,

:sinyongcode, :sinyongrank, :byunrucode, :byunruname, :companycode, :balhangcode,

:balhaenggigwan, :bojungcode, :bojungrank, :bojungname, :saupjacode, :beobincode,

:balhaengrank, :gongsagb, :jasanmovegb;

while (Sqlcode == 0)

[

if Exists(select * from bdknmaster where standcode = :stand)

{

--KBP Insert

insert into bdKNMaster

select standcode, standkorname, balhaengilja, machulilja, mangiilja, couponiyul,

balhaengiyul, halinyul, ijagyesangb, ijagyesangigan, ijahusungb, gwasegb,

sinyongcode, sinyongrank, byunrucode, byunruname, companycode, balhangcode,

balhaenggigwan, bojungcode, bojungrank, bojungname, saupjacode, beobincode,

balhaengrank, gongsagb, jasanmovegb

from bdKBPsise

where Gijunilja = p_Date

and standcode = :standcode;

}

else

{

-- KBP Update

update bdKNMaster set

standkorname = :standkorname,

balhaengilja = :balhaengilja, machulilja = :machulilja,

mangiilja = :mangiilja, couponiyul = :couponiyul,

balhaengiyul = :balhaengiyul, halinyul = :halinyul,

ijagyesangb = :ijagyesangb, ijagyesangigan = :ijagyesangigan,

ijahusungb = :ijahusungb, gwasegb = :gwasegb,

sinyongcode = :sinyongcode, sinyongrank = :sinyongrank,

byunrucode = :byunrucode, byunruname = :byunruname,

companycode = :companycode, balhangcode = :balhangcode,

balhaenggigwan = :balhaenggigwan, bojungcode = :bojungcode,

bojungrank = :bojungrank, bojungname = :bojungname,

saupjacode = :saupjacode, beobincode = :beobincode,

balhaengrank = :balhaengrank, gongsagb = :gongsagb, jasanmovegb = :jasanmovegb

where StandCode = :Standcode;

}

Fetch Acur :standcode, :standkorname, :balhaengilja, :machulilja, :mangiilja, :couponiyul,

:balhaengiyul, :halinyul, :ijagyesangb, :ijagyesangigan, :ijahusungb, :gwasegb,

:sinyongcode, :sinyongrank, :byunrucode, :byunruname, :companycode, :balhangcode,

:balhaenggigwan, :bojungcode, :bojungrank, :bojungname, :saupjacode, :beobincode,

:balhaengrank, :gongsagb, :jasanmovegb;

]

close Acur;

return p_Date;

 

end Procedure;

[Top]
No.
제목
작성자
작성일
조회
1470기존 DATABASE 로그모드 변경
주종두
2002-08-13
3855
1471┕>Re: 기존 DATABASE 로그모드 변경
딧세
2002-08-13 16:57:30
4035
1469페이지 전환을 위한 질문입니다.
정상두
2002-08-09
4564
1467[질문]백업/복구에 대해서..
장준환
2002-08-07
3979
1468┕>>>테이블스키마만 백업하는 방법
딧세
2002-08-07 16:11:34
4954
1466스토어드 프로시져 에러 좀 봐주세요
초보
2002-08-07
4560
1464php연동을 위해서...
정상두
2002-08-06
3694
1465┕>Re: php연동을 위해서...
딧세
2002-08-06 21:48:05
3919
1463현재 날짜 입력시에..
인포믹스
2002-08-05
5552
1462dbimport시 에러 [1]
Core
2002-07-30
4322
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2024 DSN, All rights reserved.
작업시간: 0.027초, 이곳 서비스는
	PostgreSQL v16.4로 자료를 관리합니다