交叉应用给关键字丢失错误 [英] cross apply giving missing keyword error

查看:79
本文介绍了交叉应用给关键字丢失错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面的查询给出了缺少的关键字错误.

Below query is giving missing keyword error..

select * 
  from its_account aac 
 CROSS APPLY its.fnGetAccountIdentifier(aac.account_key) ;

这是我的功能:

create or replace FUNCTION fnGetAccountIdentifier
(
  v_AccountKey IN NUMBER
)
RETURN fnGetAccountIdentifier_pkg.tt_fnGetAccountIdentifier_type PIPELINED
AS
   v_temp SYS_REFCURSOR;
   v_temp_1 TT_FNGETACCOUNTIDENTIFIER%ROWTYPE;

BEGIN
   OPEN v_temp FOR
      SELECT * 
        FROM tt_fnGetAccountIdentifier;

   LOOP
      FETCH v_temp INTO v_temp_1;
      EXIT WHEN v_temp%NOTFOUND;
      PIPE ROW ( v_temp_1 );
   END LOOP;
END;

我不知道我在哪里做错了.我真的很陌生.

I do not know where I am doing wrong. I am really new to this.

推荐答案

  1. APPLY SQL语法,无论是CROSS APPLY还是OUTER APPLY引入的

  1. The APPLY SQL syntax, whether it CROSS APPLY or OUTER APPLY was introduced in

Oracle 12c版本.早期版本的Oracle RDBMS不支持APPLY SQL语法.

Oracle 12c version. Prior versions of Oracle RDBMS do not support APPLY SQL syntax.

话虽如此,您可以按以下方式重写查询:

Having said that, you could rewrite your query as follows:

对于12c ,使用cross apply.

 select * 
   from its_account aac 
  cross apply TABLE(fnGetAccountIdentifier(aac.account_key)) ;

对于9i 及更高版本,请使用cross join.

For 9i and up using cross join.

 select * 
   from its_account aac 
  cross join TABLE(fnGetAccountIdentifier(aac.account_key)) ;

在您的情况下没有区别-使用cross join与使用cross apply可获得相同的结果.

In your case there is no difference - you will get the same result using cross join as you would using cross apply.

这篇关于交叉应用给关键字丢失错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆