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

xiaoxiao2021-02-28  84

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

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

/** * 创建临时表,用于后台 * 建表语句中的表名可随意指定,方法会返回真实的临时表表名 * @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; }

转载请注明原文地址: https://www.6miu.com/read-43465.html

最新回复(0)