摘要: CREATE DOMAIN name [ AS ] data_type [ DEFAULT expression ] [ constraint [ ... ] ]where constraint is:[ CONSTRAINT constraint_name ]{ NOT NULL | NULL | CHECK (expression) }本质用来定义,(可以包换约束的)数据类型。优点在于,如果多处使用该类型,且该类型需要某种约束时,不需每次都重新定义。示例:CREATE DOMAIN us_postal_code AS TEXTCHECK( VALUE ~ '^\\d{5}$... 阅读全文
posted @ 2012-05-30 09:20 友学友 阅读(357) 评论(0) 推荐(0)
摘要: http://www.connectionstrings.com/对主流数据库的连接字都有比较详细的说明。 阅读全文
posted @ 2012-05-30 09:03 友学友 阅读(163) 评论(0) 推荐(0)
摘要: 在baidu和google搜索“用C/C++访问Microsoft Access数据库”,很多时候找到的是用VC访问Access数据库。但我不想引入VC库,想用纯粹的C/C++访问。今天找到了这篇《Developing Access 2007 Solutions with Native C or C++》http://msdn.microsoft.com/en-us/library/cc811599.aspx讲述了如何用C/C++通过Direct DAOATL OLE DBADODirect ODBCMFC ODBC5种方式访问Access数据库 ,相当实用,并且还附有可运行的Sample代码 阅读全文
posted @ 2012-05-30 09:00 友学友 阅读(536) 评论(0) 推荐(0)
摘要: http://www.postgresql.org/docs/9.0/static/lo-interfaces.html1. 使用Bytea直接嵌入大对象--创建对象嵌入函数CREATE OR REPLACE FUNCTION bytea_import(p_path text, p_result out bytea) LANGUAGE plpgsql AS $$DECLARE l_oid oid; rec record;BEGIN p_result := ''; select lo_import(p_path) into l_oid; for rec in ( select d 阅读全文
posted @ 2012-05-30 08:45 友学友 阅读(3755) 评论(0) 推荐(0)
摘要: 当前数据库为Temp;希望从数据库qohdb查询数据,导入表groups中。INSERT INTO groups SELECT * FROM dblink('host=127.0.0.1 user=sfuser password=kaisenmaru dbname=qohdb'::text, 'select * from groups'::text)AS t1(groupid bigint, groupname group_name);CREATE VIEW qohdbClient ASSELECT groupid, clientid fromdblink(&# 阅读全文
posted @ 2012-05-30 08:40 友学友 阅读(274) 评论(0) 推荐(0)