Oracle SQL 开发人员中的有效查询在 SSIS 中无效

Valid Query in Oracle SQL developer is invalid in SSIS

我的查询如下所示:

编辑(我有接近 none 的 PLSQL 经验,我只是阅读了一些 post 如果你在你的脚本中使用 Begin/End,你不再可以使用普通 select,您应该将该结果插入某个地方!)这可能是查询在 SSIS 中不起作用的原因吗? )

   Variable x1 Number
   Variable x2 Number
   Variable x3 Number




   Variable x20 Number


   Begin  select user_defined_function(parameters) into x1 from dual; 
    select user_defined_function(parameters) into x2 from dual; 
    select user_defined_function(parameters) into x3 from dual; 


    select user_defined_function(parameters) into x20 from dual; 

   End;
    / 

    with Q1 as (....) 
    , Q2 as (....)
    , Q3 as (...)

    Select * from Q1,Q2,Q3 joining together 

查询在 SQL 开发人员中有效,但我必须使用执行脚本而不是 f5。否则会提示输入变量值。

如我所料,当前格式的查询在 SSIS 中不起作用。我收到错误 INVALID SQL STATEMENT 900

您可以使用额外的 CTO 将 user_defined_function 的结果传递到主查询中,例如

with  
x1 as (
   select user_defined_function(parameters) as x1 from dual), 
x2 as (
   select user_defined_function(parameters) as x2 from dual),  
...

在你的主查询中而不是使用

column1 = x1

你会写

column1 = (select x1 from x1)

这种方法消除了对变量和PL/SQL的需要,并使用纯SQL