oracle11g ora 00933,ORA-00933:SQL命令未正确结束ORA-06512:

博客内容涉及Oracle数据库连接错误,具体为'ORA-00933: SQL命令未正确结束',以及在执行复杂查询时遇到的问题。作者建议通过逐步添加和测试SQL语句来定位错误。博客提供了详细的查询代码,并提到了如何使用子查询和联接操作。
摘要由CSDN通过智能技术生成

OLE DB provider "OraOLEDB.Oracle" for linked server "hades" returned message "ORA-00933: SQL command not properly ended

ORA-06512: at "SAAP.EDI", line 1416".

OLE DB provider "OraOLEDB.Oracle" for linked server "hades" returned message "ORA-00933: SQL command not properly ended

ORA-06512: at "SAAP.EDI", line 1416".

Msg 7320, Level 16, State 2, Line 2

Cannot execute the query "select * from table(edi.ftCustomerCatalog('010','145','000164'))" against OLE DB provider "OraOLEDB.Oracle" for linked server "hades".

代码:

function ftCustomerCatalog(comno varchar2,cpls varchar2, cuno varchar2) return tblCustomerCatalog pipelined

is

c sys_refCursor;

r recCustomerCatalog;

sq varchar2(3000);

begin

sq:='select

a.comno

,a.t$cpls

,coalesce(a.t$cuno,b.t$cuno) as t$cuno

,a.t$cpgs,a.t$item

,a.t$Upcd

,a.t$dsca

,a.t$wght

,a.t$ship

,coalesce(b.t$stdt,c.t$stdt,d.t$stdt,e.t$stdt,f.t$stdt) as T$STDT

,coalesce(b.t$tdat,c.t$tdat,d.t$tdat,e.t$tdat,f.t$tdat) as t$tdat

,coalesce(b.t$qanp,c.t$qanp,d.t$qanp,e.t$qanp,f.t$qanp) as t$qanp

,a.t$pric

,coalesce(b.t$disc,c.t$disc,d.t$disc,e.t$disc,f.t$disc) as t$disc

,coalesce(b.source,c.source,d.source,e.source,f.source) as Source

from table(edi.ftAllPlCatalogs(:comno,cpls)) where t$cuno=:cuno a

left join table(edi.ft30ciDiscounts(:comno,:cpls,:cuno)) b on a.t$item=b.T$item and a.t$cuno=b.t$cuno

Left Join table(edi.ft31CPGDiscounts(:comno,:cpls,:cuno)) c on a.t$cpgs=c.t$cpgs

left Join table(edi.ft31Cdiscounts (:comno,:cpls,:cuno)) d on d.t$cpgs is null

left join table(edi.ft33plpgDiscounts(:comno,:cpls)) e on d.t$disc is null and a.t$cpgs=e.t$cpgs

left join table(edi.ft33PlDiscount(:comno,:cpls)) f on e.t$disc is null

Order by A.T$CPGS, a.t$item;';

Open c for SQ using

comno,cpls,cuno

,comno,cpls,cuno

,comno,cpls,cuno

,comno,cpls,cuno

,comno,cpls

,comno,cpls;

LOOP

fetch c into r;

exit when c%notfound;

pipe row(r);

END LOOP;

close c;

end;

2014-06-22

TonyP

+2

您收到默认的错误消息来自oracle。在很长的查询中有一处语法错误。我建议重新开始并采取婴儿步骤。写一行并运行它。然后再添加一点点并运行它。每次出现错误时,您都会知道这是由您添加的最后一件事引起的。 –

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值