OnlyPHP

2013年5月8日

postgresql 存储过程(2)

摘要: postgresql下存储过程的写法 在当前这个项目里(empress),我主要应用到了两种 服务端编程语言:扩展SQL中的查询语言函数(SQL)和PL/pgSQL SQL过程语言。前者仅包括了简单的sql语句,后者还包括了一些条件、循环控制等。这些函数都可以存放在文本中,使用\i命令导入到db中即可。首先是SQL的例子:create or replace function set_relation_done(integer, integer)returns void AS $$update relations set done=TRUE where userid=$1 andfriendid 阅读全文

posted @ 2013-05-08 23:08 OnlyPHP 阅读(284) 评论(0) 推荐(0) 编辑

postgresql 存储过程使用

摘要: 今天学会了用 PL/pgSQL 写 postgreSQL 的存储过程,网上资料实在少得可怜,唯一能搜到的一些还是抄来抄去的;还是翻postgresql的文档吧,把今天解决的问题说一下吧,希望对其他人有帮助。问题是这样的,有一张message表:CREATE TABLE message( id int8 NOT NULL, receiveuserid int8, senduserid int8, receivedelete bool DEFAULT false, senddelete bool DEFAULT false, …… CONSTRAINT usermessage_pke... 阅读全文

posted @ 2013-05-08 22:53 OnlyPHP 阅读(598) 评论(0) 推荐(0) 编辑

Data picker

摘要: Data pickerthe idea is the same as Date Picker but the different is that its generating data from database rather than date.to get this Data Picker working in the form you'll need CJuiDialog and CGridView.maybe the picture below will helps you to understand the idea a little bit. First of all yo 阅读全文

posted @ 2013-05-08 17:07 OnlyPHP 阅读(315) 评论(0) 推荐(0) 编辑

导航