PL/SQL的矛盾!PL/SQL开发高手请进!

jyq686 2004-12-17 05:39:42
declare
ls_Hesxl varchar2(255):='';
begin
.../*这里一系列的PL/SQL语句,使得ls_Hesxl=('0925','0867','0035')*/

declare
CURSOR cur_KePLX_DL IS
select distinct keplx,piaoj,xianldm from aaa where xianldm in ls_Hesxl;
begin
.../*一系列的SQL语句*/
end;
end;


CURSOR cur_KePLX_DL IS
select distinct keplx,piaoj,xianldm from aaa where xianldm in ls_Hesxl这一句根本行不通,为什么呢?该怎么解决呢?

PL/SQL在declare申明块里不能写实现语句,在begin end;实现语句里不能写申明语句,实现太笨了!
...全文
83 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
yingqing 2004-12-17
  • 打赏
  • 举报
回复
ls_Hesxl是在程序中定義的,無法在SQL語句中靜態使用,要動態使用select distinct keplx,piaoj,xianldm from aaa where xianldm in ls_Hesxl語句

ATGC 2004-12-17
  • 打赏
  • 举报
回复
http://community.csdn.net/Expert/topic/3637/3637565.xml?temp=.163479
qiaozhiwei 2004-12-17
  • 打赏
  • 举报
回复
动态sql

17,086

社区成员

发帖
与我相关
我的任务
社区描述
Oracle开发相关技术讨论
社区管理员
  • 开发
  • Lucifer三思而后行
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧