2012年11月8日
摘要: CREATE OR REPLACE FUNCTION concat(character varying, character varying)RETURNS character varying AS$BODY$ DECLARE t varchar; BEGIN IF character_length($1) > 0 THEN t = $1||','|| $2; ELSE t = $2; END IF;RETURN t;END;$BODY$LANGUAGE plpgsql VOLATILECOST 100;ALTER FUNCTION concat(character va 阅读全文
posted @ 2012-11-08 15:55 赖侨杰 阅读(3879) 评论(1) 推荐(0) 编辑
  2012年10月31日
摘要: /* * testlibpq.c * * Test the C version of libpq, the PostgreSQL frontend library. */#include <stdio.h>#include <stdlib.h>#include <libpq-fe.h>static voidexit_nicely(PGconn *conn){ PQfinish(conn); exit(1);}intmain(int argc, char **argv){ const char *conninfo; PGconn *conn; PG... 阅读全文
posted @ 2012-10-31 17:27 赖侨杰 阅读(5688) 评论(0) 推荐(0) 编辑
摘要: SELECT a.attname 字段名 ,format_type(a.atttypid, a.atttypmod) 字段类型,d.adsrc 缺省值,a.attnotnull 非空,f.description 描述FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnumLEFT JOIN pg_description f ON a.attrelid = f.objoid AND a.attnum = f.objsubid WHERE a.att... 阅读全文
posted @ 2012-10-31 17:20 赖侨杰 阅读(215) 评论(0) 推荐(0) 编辑
  2012年9月11日
摘要: SELECT null,s._room_name 包厢,a._session 账单号,COALESCE(s._amount_receivable,0)-COALESCE(s._flower_charge,0) 应收金额, a.amount 实收金额,a.xianjin 现金,a.bank 银行卡,a.qiandan 签单,a.zhaodai 招待,a.zhuguazhang 主挂账,a.fuguazhang 副挂账,s._value_discount 折率,_charged_by_name 埋单员工,_copy_count 打印次数, CASE s._check_out_mode WHEN . 阅读全文
posted @ 2012-09-11 15:19 赖侨杰 阅读(469) 评论(0) 推荐(0) 编辑
  2012年8月24日
摘要: The following code defines a structure type of TMyRec and a pointer type of PMyRec.typedef struct MyRec{ AnsiString FName, LName;} TMyRec;typedef TMyRec* PMyRec;Assuming these types are used, the following code adds a node to TreeView1 as the last sibling of a specified node. A TMyRec record is... 阅读全文
posted @ 2012-08-24 13:54 赖侨杰 阅读(805) 评论(0) 推荐(0) 编辑
  2012年8月23日
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Text;using System.Reflection;using System.Collections;using System.Data;using System.Data.Common;/// <summary>/// Summary description for FormatToJson/// </summary>public class FormatToJson{publ 阅读全文
posted @ 2012-08-23 11:01 赖侨杰 阅读(984) 评论(0) 推荐(0) 编辑
  2012年8月2日
摘要: select pg_constraint.conname as pk_name,pg_attribute.attname as colname,pg_type.typname as typename from pg_constraint inner join pg_class on pg_constraint.conrelid = pg_class.oid inner join pg_attribute on pg_attribute.attrelid = pg_class.oid and pg_attribute.attnum = pg_constraint.conkey[1]inner j 阅读全文
posted @ 2012-08-02 17:47 赖侨杰 阅读(1931) 评论(2) 推荐(0) 编辑
  2012年7月10日
摘要: 第一步:TcxGridDBColumn 的 Properties 属性选中ComboBox第二步:TcxComboBoxProperties *com_key=(TcxComboBoxProperties *)c_roomQDBGrid1DBTableView1Column1->Properties;for(int i=0;i<=32;i++){ com_key->Items->Add(IntToStr(i));} 阅读全文
posted @ 2012-07-10 12:53 赖侨杰 阅读(657) 评论(0) 推荐(0) 编辑
摘要: //C++ Buildertry {tvCustomers->DataController->DeleteSelection();} catch(Exception &e){ShowMessage("Cannot delete selected records due to the exception: " + e.Message);} 阅读全文
posted @ 2012-07-10 12:50 赖侨杰 阅读(420) 评论(0) 推荐(0) 编辑
摘要: ExtractFileName(OpenDialog1->FileName) 阅读全文
posted @ 2012-07-10 11:53 赖侨杰 阅读(1612) 评论(0) 推荐(0) 编辑