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 3003 게시물 읽기
No. 3003
Number of affected rows
작성자
정재익
작성일
2001-06-22 08:01
조회수
1,932

Submitted on: 04-24-2001

Description:

Demonstrates how to return the number of records affected by an update in a plpgsql function. (Function actually searches a table looking for opportunities to guess someone's gender. It actually relies on gender_guess, not included, which looks up into a table of American first names and their usual gender.)

Code:

 

-- author: joel burton (jburton@scw.org)

-- public domain

 

CREATE FUNCTION "gender_assign" () RETURNS int AS '

declare

rec_affected int;

 

begin

update tblPers set gendercode=gender_guess(fname,mname) where gendercode=''?'';

GET DIAGNOSTICS rec_affected = ROW_COUNT;

return rec_affected;

end;

' LANGUAGE 'plpgsql';

[Top]
No.
제목
작성자
작성일
조회
3006PostgreSQL and iODBC
정재익
2001-06-22
2644
3005pgMail -- TCL-based scripts
정재익
2001-06-22
2229
3004가장 근접한 ZIP code 찾기
정재익
2001-06-22
2545
3003Number of affected rows
정재익
2001-06-22
1932
3002eval() for PostgreSQL
정재익
2001-06-22
1959
3001Retrive comma separated PK attributes
정재익
2001-06-22
1906
3000Delete duplicate records in a table
정재익
2001-06-22
1910
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2024 DSN, All rights reserved.
작업시간: 0.025초, 이곳 서비스는
	PostgreSQL v16.2로 자료를 관리합니다