sql_select_updatetime := 'SELECT min(updatetime) into V_updatetime FROM '||V_tablename||
' WHERE fltno = '''||P_flightno||'''
and buydate = '''||V_buydate||'''
and godate = '''||V_godate||'''
and orgcity = '''||P_orgcity||'''
and descity = '''||P_descity||'''
and router = '''||P_router||'''';此动态语句测试后的sql语句是正确的,但在执行的时候报 缺失关键字错误。
' WHERE fltno = '''||P_flightno||'''
and buydate = '''||V_buydate||'''
and godate = '''||V_godate||'''
and orgcity = '''||P_orgcity||'''
and descity = '''||P_descity||'''
and router = '''||P_router||'''';此动态语句测试后的sql语句是正确的,但在执行的时候报 缺失关键字错误。
解决方案 »
- 求请教。今天考试,考的是我门没怎么学过的oracle数据库的知识。
- oracle怎样知道是锁表还是锁记录
- 如何删除一张有800万条记录的表中的部分数据
- Oracle 安装好后,不知道在哪里运行sql语句?????????????
- deletetime这列是时间类型的数据 2008-11-11 12:20:45,如何做条件。
- 除了使用视图的instead of触发器,还有其他办法满足这个需求吗?
- 初学者的问题,请帮忙,谢谢。
- 如何把oracle中的表导出为EXCEL格式请大家帮忙,急啊!!先谢谢了.
- 连接总断的问题
- 关于oracle方向大学生就业难易,薪资问题。
- Oracle 模糊查询问题
- 谁做过c#操作oracle数据库的类或者动态库神马的
应该是execute immediate sql_select_updatetime Into V_updatetime而不是把into写到sql的字符串中
sql_select_updatetime := 'SELECT min(updatetime) FROM '||V_tablename||
' WHERE fltno = '''||P_flightno||'''
and buydate = '''||V_buydate||'''
and godate = '''||V_godate||'''
and orgcity = '''||P_orgcity||'''
and descity = '''||P_descity||'''
and router = '''||P_router||'''';
execute immediate sql_select_updatetime into V_updatetime;
select into 是plsql写法,就是执行动态plsql,就得加上plsql块。
sql_select_updatetime := 'begin SELECT min(updatetime) into :1 FROM '||V_tablename||
' WHERE fltno = '''||P_flightno||'''
and buydate = '''||V_buydate||'''
and godate = '''||V_godate||'''
and orgcity = '''||P_orgcity||'''
and descity = '''||P_descity||'''
and router = '''||P_router||'''' || ';' || 'end;';
EXECUTE IMMEDIATE sql_select_updatetime USING OUT V_updatetime;
where fltno='''||P_flightno||'''
and buydate = '''||V_buydate||'''
and godate = '''||V_godate||'''
and flightflag = '''||P_flightflag||'''
and fltclass = '''||V_fltclass||'''
and router = '''||P_router||'''
and orgcity = '''||P_orgcity||'''
and descity = '''||P_descity||'''';那这个动态sql拼接的对吗
test时 看看出来的SQL,直接放到sql窗口运行,就明白那里有错了。