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 893 게시물 읽기
No. 893
Re: Re: Re: procdure 생성 및 실행에서..
작성자
sojins
작성일
2001-07-24 15:44
조회수
5,324

>>바람 님께서 쓰시길<<

 

::

:: 요건 새로 수정한겁니당..

:: create procedure count_page(p_code char(2))

:: define v_num integer;

:: select count(num) into v_num from counter

:: where to_char(visit_date,'%m%d%Y') = to_char(current, '%m%d%Y') ;

::

:: if(v_num > 0) then{

:: update counter set num = num+1

:: where to_char(visit_date,'%m%d%Y') = to_char(current, '%m%d%Y')

:: and code=p_code;

:: }else{

:: insert into counter(p_code,visit_date,num)

:: values(p_code,current,1);

:: }

:: end if

:: end procedure;

::

 

제어문을 보니 약간 다르네요.

IF-ELIF-ELSE-END IF

 

이런 식으로 되어있는데요

중간에 condition부분에 ()를 사용하지 않네요.

그리고... 블럭문을 처리할때도...{}를 사용하지 않구요.

 

if v_num > 0 then

update counter set num = num+1

where to_char(visit_date,'%m%d%Y') = to_char(current, '%m%d%Y')

and code=p_code;

else

insert into counter(p_code,visit_date,num)

values(p_code,current,1);

 

end if

 

프로시저 만들어서 해보니 잘 되네요.

그럼 수고하세요.

[Top]
No.
제목
작성자
작성일
조회
907[질문]sign(durtime-60)문에 해당하는 informix 함수는 무엇인지요??
조잉
2001-07-26
4429
905문자열에서 특정 문자의 위치값을 알수 없나요?
백수종
2001-07-26
5494
908┕>Re: 문자열에서 특정 문자의 위치값을 알수 없나요?
조잉
2001-07-26 14:00:34
6110
910 ┕>Re: Re: 문자열에서 특정 문자의 위치값을 알수 없나요?
백수종
2001-07-26 16:45:41
5536
912  ┕>Re: Re: Re: 문자열에서 특정 문자의 위치값을 알수 없나요?
조잉
2001-07-26 19:52:18
5324
896group by 조건에서...
바람
2001-07-24
4917
897┕>Re: group by 조건에서...
정재익
2001-07-24 17:09:40
5302
898 ┕>Re: Re: group by 조건에서...
sojins
2001-07-24 17:32:44
6362
899  ┕>Re: Re: Re: 두분 답변 감사드립니다.
바람
2001-07-24 22:12:06
4789
889procdure 생성 및 실행에서..
바람
2001-07-24
5050
890┕>Re: procdure 생성 및 실행에서..
sojins
2001-07-24 14:28:32
5443
891 ┕>Re: Re: procdure 생성 및 실행에서..
바람
2001-07-24 14:50:03
5343
893  ┕>Re: Re: Re: procdure 생성 및 실행에서..
sojins
2001-07-24 15:44:38
5324
895   ┕>Re: Re: Re: Re: procdure 생성 및 실행에서..
바람
2001-07-24 16:08:57
5652
886데이터를 파일로 , 파일을 DB 로 load, unload 명령이..
바람
2001-07-23
5595
887┕>Re: 데이터를 파일로 , 파일을 DB 로 load, unload 명령이..
정해숙
2001-07-24 08:23:51
5903
888 ┕>Re: Re: 데이터를 파일로 , 파일을 DB 로 load, unload 명령이..
바람
2001-07-24 10:43:18
5638
900  ┕>Re: Re: Re: 데이터를 파일로 , 파일을 DB 로 load, unload 명령이..
신호
2001-07-25 00:20:02
6150
901┕>Re: 언로드와 로드. (예제포함)
sojins
2001-07-25 03:43:01
8121
885dbload 에러..
바람
2001-07-23
4853
892┕>Re: dbload 에러..
sojins
2001-07-24 15:19:27
6425
883EAServer 관련 질문
이재환
2001-07-20
4341
884┕>Re: EAServer 관련 질문
이윤석
2001-07-21 16:10:13
4717
922 ┕>Re: Re: EAServer 관련 질문
이재환
2001-07-31 08:23:35
4713
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2024 DSN, All rights reserved.
작업시간: 0.019초, 이곳 서비스는
	PostgreSQL v16.2로 자료를 관리합니다