大家好,sqlserver转oracle,大家帮忙这怎么改啊 本帖最后由 baofengyingyinaaa 于 2012-04-13 11:49:39 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这个是sqlserver已这个为准private static String SQL_SUB_ID = " declare @module varchar(20) " + " declare @comp_code varchar(20) " + " declare @copy_code varchar(3) " + " set @module = ? " + " set @comp_code = ? " + " set @copy_code = ? " + " declare @copy_type int " + " select @copy_type = copy_type from sys_copy where comp_code = @comp_code and copy_code = @copy_code " + " declare @sql varchar(1000) " + " create table #tmp(mod_code varchar(20), copy1sql varchar(100)) " + " set @sql = 'insert into #tmp(mod_code, copy1sql) select mod_code, copy1sql from sys_mod where copy' + convert(varchar(1), @copy_type) + ' = 1 and mod_code like dbo.getModuleCodeByPermId(''' + @module + ''') + ''%''' " + " exec(@sql) " + " if(@copy_type = 1) " + " begin " + " declare @del_sql varchar(200) " + " declare @mod_code varchar(20) " + " declare @copy1sql varchar(100) " + " DECLARE list CURSOR FOR " + " select mod_code, copy1sql from #tmp where copy1sql is not null " + " OPEN list " + " FETCH NEXT FROM list INTO @mod_code, @copy1sql " + " WHILE @@FETCH_STATUS = 0 " + " begin " + " set @del_sql = 'delete from #tmp where mod_code = ''' + @mod_code + ''' and (select count(1) from sys_copy where comp_code = ''' + @comp_code + ''' and copy_code = ''' + @copy_code + ''' and (' + @copy1sql + ')) = 0' " + " exec(@del_sql) " + " FETCH NEXT FROM list INTO @mod_code, @mod_code " + " end " + " CLOSE list " + " DEALLOCATE list " + " end " + " select mod_code from #tmp order by mod_code " + " drop table #tmp "; 以前的库是sqlserver现在替为oracle的,请大家帮忙 求oracle增量备份的方法 存储过程转换,急求高手帮助!谢谢!! 触发器批量导入数据库的问题 ora-04021 锁问题求解! 实在搞不定了 求救 去掉外连接(+)影响速度吗? 存储过程与触发器性能比较 请各位老大详细描述windows下SID,Instance,Service的关系!多谢了 求一sql语句 静态和动态PL/SQL的问 在IMP時,怎樣修改EXP時USER的默認TABLESPACES? 一个存储过程提示语法错误 请教 oracle10g 行列数据转换问题
private static String SQL_SUB_ID =
" declare @module varchar(20) " +
" declare @comp_code varchar(20) " +
" declare @copy_code varchar(3) " +
" set @module = ? " +
" set @comp_code = ? " +
" set @copy_code = ? " +
" declare @copy_type int " +
" select @copy_type = copy_type from sys_copy where comp_code = @comp_code and copy_code = @copy_code " +
" declare @sql varchar(1000) " +
" create table #tmp(mod_code varchar(20), copy1sql varchar(100)) " +
" set @sql = 'insert into #tmp(mod_code, copy1sql) select mod_code, copy1sql from sys_mod where copy' + convert(varchar(1), @copy_type) + ' = 1 and mod_code like dbo.getModuleCodeByPermId(''' + @module + ''') + ''%''' " +
" exec(@sql) " +
" if(@copy_type = 1) " +
" begin " +
" declare @del_sql varchar(200) " +
" declare @mod_code varchar(20) " +
" declare @copy1sql varchar(100) " +
" DECLARE list CURSOR FOR " +
" select mod_code, copy1sql from #tmp where copy1sql is not null " +
" OPEN list " +
" FETCH NEXT FROM list INTO @mod_code, @copy1sql " +
" WHILE @@FETCH_STATUS = 0 " +
" begin " +
" set @del_sql = 'delete from #tmp where mod_code = ''' + @mod_code + ''' and (select count(1) from sys_copy where comp_code = ''' + @comp_code + ''' and copy_code = ''' + @copy_code + ''' and (' + @copy1sql + ')) = 0' " +
" exec(@del_sql) " +
" FETCH NEXT FROM list INTO @mod_code, @mod_code " +
" end " +
" CLOSE list " +
" DEALLOCATE list " +
" end " +
" select mod_code from #tmp order by mod_code " +
" drop table #tmp ";