strTemp:=strTemp||','||'to_char('''||strdbcursor2||''')';
解决方案 »
- 关于job的建立
- 关于Oracle
- 非常郁闷的问题:oracle服务突然不响应
- 请问在pl/sql如何捕捉出现错误的位置(源文件代码行的位置)
- sql 连接查询问题
- oracle中為何對long型字段進行union操作時會報錯
- 如何给一个表增加一个系统自己生成的流水ID,谢谢
- 为何启动ManagementServer 老是报错!!!!!!! 现在很痛苦
- 急救一段SQL的转换,本人不胜感激......
- TNS-04415:文件I/O错误 caused by:java.io.FileNotFoundException:D:\app\123\product\1
- 怎么写这个存储过程?
- 请问大虾:不借助第三方软件,如何把oracle的数据导入到informix中??????
set serveroutput on size 1000000;
declare
strdbcursor1 varchar2(50);strdbcursor2 varchar(50);strdbcursor3 varchar(5000);
strTemp varchar2(500);
cursor dbcursor1 is select 表编码 from testmis.zbm_dict,testmis.zfl_dict
where 保密级别>1 and testmis.zbm_dict.分类编码=testmis.zfl_dict.分类编码
and testmis.zfl_dict.数据库编码='FXHY';
cursor dbcursor2(strp varchar2) is select COLUMN_NAME from user_col_comments where upper(TABLE_NAME)=upper(strp);
begin
open dbcursor1;
fetch dbcursor1 into strdbcursor1;
while dbcursor1%found
loop /* 读取表字段 */
strTemp:='';
open dbcursor2(strdbcursor1);
fetch dbcursor2 into strdbcursor2;
while dbcursor2%found
loop
if strTemp='' then
strTemp:='to_char('||strdbcursor2||')';
else
strTemp:=strTemp||','||'to_char('''||strdbcursor2||''')';
end if; fetch dbcursor2 into strdbcursor2;
end loop;
close dbcursor2;
DBMS_OUTPUT.PUT_LINE(strTemp); fetch dbcursor1 into strdbcursor1;
end loop;
close dbcursor1;
end;
strTemp:='convert('||strTemp||','||strdbcursor2||')';
其中
strdbcursor2 varchar(50);
strTemp varchar2(500);