金蝶EAS,代码创建临时表,参考代码

来源:互联网 发布:网络连接服务器失败 编辑:程序博客网 时间:2024/06/07 05:51

临时表创建之后,系统会自动回收。

建表语句中的表名可以随意指定,创建临时表成功之后,返回的表名才是真实的,与建表语句中的表名无关。

/** * 创建临时表,用于后台 * 建表语句中的表名可随意指定,方法会返回真实的临时表表名 * @param ctx 上下文 * @param createSql 建表语句 *  */public static String temp(Context ctx, String createSql) throws BOSException{String tableName = null; //临时表表名TempTablePool pool = TempTablePool.getInstance(ctx);try {tableName = pool.createTempTable(createSql); //创建临时表} catch (Exception e) {throw new BOSException(e);}return tableName;}/** * 创建临时表,用于后台 * 建表语句中的表名可随意指定,方法会返回真实的临时表表名 * @param ctx 上下文 * @param createSql 建表语句 *  */public static String temp(Context ctx, StringBuffer createSql) throws BOSException{String tableName = null; //临时表表名TempTablePool pool = TempTablePool.getInstance(ctx);try {tableName = pool.createTempTable(createSql.toString()); //创建临时表} catch (Exception e) {throw new BOSException(e);}return tableName;}


原创粉丝点击