判断字段是否存在: 1 DROP PROCEDURE IF EXISTS schema_change; 2 DELIMITER // 3 CREATE PROCEDURE schema_change() BEGIN 4 DECLARE CurrentDatabase VARCHAR(100)...
分类:
数据库 时间:
2014-09-12 19:04:33
阅读次数:
181
举个例子:import csvimport ospath='/tmp/'file='test.csv'def generate_csv(path,file): if not os.path.exists(path): os.mkdir(path) files=os.path...
分类:
编程语言 时间:
2014-09-12 16:51:53
阅读次数:
235
DECLARE @what varchar(800) SET @what='lll' --要搜索的字符串DECLARE @sql varchar(8000)DECLARE TableCursor CURSOR LOCAL FOR SELECT sql='IF EXISTS ( SELECT 1 FR...
分类:
数据库 时间:
2014-09-12 14:49:53
阅读次数:
258
#若已存在该表,就将其删除;否则创建新的表。DROP table IF EXISTS users;CREATE TABLE users( `user_name` varchar(5) DEFAULT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8;#若已存在该存.....
分类:
Web程序 时间:
2014-09-12 13:13:33
阅读次数:
283
问题:使用游标遍历时,发现使用select var into tmp where var=?然后判断if tmp is null时,不能走完所有的遍历。经debug发现,当var为空时,则跳出游标的遍历。解决方式:使用if not exists(select var into tmp where v...
分类:
数据库 时间:
2014-09-12 13:11:43
阅读次数:
249
--查看某个对象的依赖对象EXEC sp_MSforeachdb 'use ? ; IF EXISTS(SELECT top 1 1 FROM sys.syscomments WHERE text LIKE ''%test%'')SELECT ''?'' as dbname,object_name(...
分类:
数据库 时间:
2014-09-12 10:05:33
阅读次数:
219
public void DownLoad( ){ string filePath = Server.MapPath( @"\UserFile\" );//这里注意了,你得指明要下载文件的路径. if ( System.IO.File.Exists( filePath ) ) ...
分类:
Web程序 时间:
2014-09-11 18:44:12
阅读次数:
195
Given a graph G(V, E), a clique is a sub-graph g(v, e), so that for all vertex pairs v1, v2 in v, there exists an edge (v1, v2) in e. Maximum clique is the clique that has maximum number of
vertex.
...
分类:
其他好文 时间:
2014-09-11 08:47:58
阅读次数:
260
// 创建文件上传路径 public static void mkdir(String path) { File fd = null; try { fd = new File(path); if (!fd.exists()...
分类:
编程语言 时间:
2014-09-11 07:39:51
阅读次数:
195
比如在Northwind数据库中有一个查询为SELECT c.CustomerId,CompanyName FROM Customers cWHERE EXISTS(SELECT OrderID FROM Orders o WHERE o.CustomerID=c.CustomerID)这里面的EX...
分类:
数据库 时间:
2014-09-10 17:35:40
阅读次数:
221