txt_sql:='select a.agentcode, a.otherno,a.paydate,a.EnterAccDate,a.paymoney,
a.StandPrem,substr(a.RISKCODE,3,3) from HZH.H_LJTEMPFEE a,hzh.h_laagent b,
hzh.h_labranchgroup c,hzh.h_ldcom d where a.paydate between ' || to_date(trandate_s,'YYYYMMDD')
||'and'|| to_date(trandate_e,'YYYYMMDD') ||'and a.othernotype in (6) and a.agentcode=b.agentcode
and b.agentgroup=c.agentgroup and d.comcode=b.managecom order by d.name,c.name,a.agentcode';open cur_rp for txt_sql;我这个语句在oracle中无法运行.请各位大侠帮忙
解决方案 »
- oraclemtsrecoveryservice注册表imagepath键值是多少
- oracle 10g里中的listener.ora tnsname.ora和sqlnet.ora三个文件的作用含义是什么?里面的各个变量是怎样解释?
- 请大家帮我拼个SQL,被这个SQL弄郁闷了...
- 求个sql语句!:-)
- 急急急,oracle SQL语句优化 (高手请进)
- 把数据库给删了,怎么能恢复啊?
- ***oracle的存储过程怎么写?****
- 紧急询问:如何定义和实现返回可变数组或嵌套表的函数?如何把可变数组或嵌套表当作函数传递?
- 急,高分,怎样将一个.xml文件导入到数据库中?
- 由于数据文件过大,请问如何要在linux上挂载xfs文件系统?
- 用IMP.EXE 导入DMP文件 一个挺奇怪的问题
- 如何设计J2EE的数据库,后台是oracle 大家畅谈一下。
a.otherno,
a.paydate,
a.EnterAccDate,
a.paymoney,
a.StandPrem,
substr(a.RISKCODE, 3, 3)
from HZH.H_LJTEMPFEE a,
hzh.h_laagent b,
hzh.h_labranchgroup c,
hzh.h_ldcom d
where a.paydate between to_date(trandate_s,'YYYY-MM-DD')
and to_date(trandate_e,'YYYYMMDD')
and a.othernotype in (6)
and a.agentcode = b.agentcode
and b.agentgroup = c.agentgroup
and d.comcode = b.managecom
order by d.name, c.name, a.agentcode
txt_sql:='select a.agentcode, a.otherno,a.paydate,a.EnterAccDate,a.paymoney,
a.StandPrem,substr(a.RISKCODE,3,3) from HZH.H_LJTEMPFEE a,hzh.h_laagent b,
hzh.h_labranchgroup c,hzh.h_ldcom d where a.paydate between to_date(''' || trandate_s ||''',''YYYYMMDD'')'||
' and to_date('''||trandate_e||''',''YYYYMMDD'') and a.othernotype in (6) and a.agentcode=b.agentcode
and b.agentgroup=c.agentgroup and d.comcode=b.managecom order by d.name,c.name,a.agentcode';
txt_sql:='select a.agentcode, a.otherno,a.paydate,a.EnterAccDate,a.paymoney,
a.StandPrem,substr(a.RISKCODE,3,3) from HZH.H_LJTEMPFEE a,hzh.h_laagent b,
hzh.h_labranchgroup c,hzh.h_ldcom d where a.paydate between to_date(:trandate_s,''YYYYMMDD'')
and to_date(:trandate_e,''YYYYMMDD'') and a.othernotype in (6) and a.agentcode=b.agentcode
and b.agentgroup=c.agentgroup and d.comcode=b.managecom order by d.name,c.name,a.agentcode';open cur_rp for txt_sql using trandate_s,trandate_e;
trandate_0:=to_date(i_trandate,'YYYY-MM-DD');--由于直接引用传递变量不行,所以加了些变量
if i_flag2='0' then
trandate_s:=to_char(trandate_0,'YYYY')*10000+to_char(trandate_0,'MM')*100+1;
trandate_e:=to_char(trandate_0,'YYYY')*10000+to_char(trandate_0,'MM')*100+to_char(trandate_0,'DD');
txt_sql:='select a.agentcode, a.otherno,a.paydate,a.EnterAccDate,a.paymoney,
a.StandPrem,substr(a.RISKCODE,3,3) from HZH.H_LJTEMPFEE a,hzh.h_laagent b,
hzh.h_labranchgroup c,hzh.h_ldcom d where a.paydate between to_date(:trandate_s,''YYYYMMDD'')
and to_date(:trandate_e,''YYYYMMDD'') and a.othernotype in ("6") and a.agentcode=b.agentcode
and b.agentgroup=c.agentgroup and d.comcode=b.managecom and b.managecom :agent_kind order by d.name,c.name,a.agentcode';open cur_rp for txt_sql;
我再增加一条 b.mnagecom in (86230201) 把in (86230201)换成变量b.managecom :agent_kind 就报错麻烦大家再帮我一下.多谢!