[英]I am struggling with migrating the temp tables (SQL server) to oracle
I am struggling with migrating the temp tables (SQL server) to oracle. 我正在努力将临时表(SQL Server)迁移到oracle。 Mostly, oracle don't consider to use temporary table inside the store procedure but in sql server, they are using temp tables for small fetching record and also manipulate same.
通常,oracle不考虑在存储过程中使用临时表,但在sql server中,他们使用临时表来获取较小的记录并对其进行操作。 How to overcome this issue.
如何克服这个问题。 I am also searching some online articles about migrating temp table to oracle but they are not clearly explained for my expectations.
我也在搜索一些有关将临时表迁移到oracle的在线文章,但对于我的期望并没有明确解释。 i got information like using inline view, WITH clause, ref cursor instead of temp table.
我得到了诸如使用内联视图,WITH子句,ref游标而不是临时表的信息。 I am totally confused.
我很困惑。 Please suggest me, in which case may use Inline view, WITH clause, ref cursor.
请建议我,在这种情况下,可以使用内联视图,WITH子句,引用游标。 This may be helpful for improve my knowledge and also doing job well.
这可能有助于提高我的知识并做好工作。
As always thank you for your valuable time in helping out the newbies. 与往常一样,感谢您宝贵的时间来帮助新手。 Thanks Alsatham hussain
感谢Alsatham hussain
Like many questions, the answer is "it depends". 像许多问题一样,答案是“取决于”。 A few things
一些东西
As others have said, using a CTE Common Table Expression) could potentially work, buy it depends on the motivation for using the TEMP table in the first place. 就像其他人所说的那样,使用CTE公用表表达式可能会起作用,是否购买它取决于首先使用TEMP表的动机。 One of the advantages of the temp table is it provides a "checkpoint" in a series of steps, and allows for stats to be gathered on intermediate temporary data sets;
临时表的优点之一是它在一系列步骤中提供了“检查点”,并允许在中间临时数据集上收集统计信息。 it what is a complex set of processing.
它是一套复杂的处理过程。 The CTE does not provided that benefit.
CTE没有提供该好处。
Others "intermediate" objects such as collections could also be used, but they have to be "managed" and do not really provide any of the advantages of being able to collect stats on them. 也可以使用其他“中间”对象(例如集合),但是必须对其进行“管理”,并且不能真正提供能够收集其统计信息的任何优势。
So as I said at the beginning, you choice of solution will depend somewhat on the motivation for the original temp table in the first place. 因此,正如我在开始时所说的那样,您对解决方案的选择首先将取决于原始临时表的动机。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.