码迷,mamicode.com
首页 > Windows程序 > 详细

c# 对于批量表的统一查询 WM_CONCAT行列转换行数

时间:2015-11-19 18:55:18      阅读:265      评论:0      收藏:0      [点我收藏+]

标签:


                //需要显示的列
                sql = string.Format(@"
                                      SELECT  WM_CONCAT(COL.COLUMN_NAME)
                                      FROM USER_TAB_COLS COL
                                     WHERE COL.TABLE_NAME = ‘{0}‘
                                    ", fromTable);
                string col = "" + dac.ExecuteScalar(CommandType.Text, sql);
                //获取已导入的数据
                sql = string.Format(@"SELECT {2}
                                        FROM {0}
                                       WHERE SUBSTR(SRQ, 1, 5) || CASE INSTR(SUBSTR(SRQ, 6, 2), ‘-‘)
                                               WHEN 2 THEN
                                                ‘0‘ || REPLACE(SUBSTR(SRQ, 6, 2), ‘-‘, ‘‘)
                                               ELSE
                                                SUBSTR(SRQ, 6, 2)
                                             END = ‘{1}‘
                                       ORDER BY TO_NUMBER(SBH, ‘999999‘)", toTable, periodCode, col
                                                    );

                DataTable dt = dac.ExecuteDataTable(sql);

c# 对于批量表的统一查询 WM_CONCAT行列转换行数

标签:

原文地址:http://www.cnblogs.com/yinxingyeye/p/4978266.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!