PostgreSQL中调用存储过程并返回数据集实例

这里用一个实例来演示PostgreSQL存储过程如何返回数据集。

1、首先准备数据表

//member_category

create table member_category(id serial, name text, discount_rate real, base_integral integer);

alter table member_category add primary key(id);

alter table member_category add check(name<>'');

//member

create table member(id serial, member_num text, name text, category_id integer, account numeric(16,2), integral integer, phone text, birthday date, qq integer, email text, status integer, address text, tip text, start_date date, valid_date integer, password text, creator integer, store_name text);

alter table member add primary key(id);

alter table member add foreign key(creator) references employee;

alter table member add foreign key(category_id) references member_category;

alter table member add  onaccount int;

alter table member add &nbsp;onaccount int;

alter table member add &nbsp;store_name text;

以上是 PostgreSQL中调用存储过程并返回数据集实例 的全部内容, 来源链接: utcz.com/z/325990.html

回到顶部