像这样的sql语句写成存储过程怎么写?
sql =" select tab1,tab2,tab3 from table where 1=1 ";
if (con1 == "")
{
sql += " and tab1 = '"+con1 +"' ;
}
if (con2 == "")
{
sql += " and tab2 = '"+con2 +"' ;
}
关键是条件怎么写
sql =" select tab1,tab2,tab3 from table where 1=1 ";
if (con1 == "")
{
sql += " and tab1 = '"+con1 +"' ;
}
if (con2 == "")
{
sql += " and tab2 = '"+con2 +"' ;
}
关键是条件怎么写
解决方案 »
- 如何提高oracle模糊查询的性能?
- dbms_java.grant_permission
- 来 都尝尝~~~~~~~~~~~~~~~~plsql 调用返回游标过程
- 怎样获取一个游标的长度?
- oracle分组统计,请高手指点!--分不是问题(100分),关键是解决问题的successful!
- 语句查询问题
- 请教:如何得到当前登陆的用户名?
- 将 *.pdf 文件以数据流的方式放到数据库里面,读出来以后却报错说“文档已损坏,无法修复”。
- 请问set serveroutput on 的作用是什么呀
- 求助!ORACLE权限问题!先谢谢大家
- 最近觉得静不下心来
- 在9i下面使用DBLINK去查询oracle7的某个表的数据,报错ORA-01002,咋办?
if conn1 is not null then
sql:=sql||' and tab1 = '''||con1 ||''' ;
end if;if conn2 is not null then
sql:=sql||' and tab2 = '''||con2 ||''' ;
end if;...
if conn1 is not null then
sql:=sql||' and tab1 = '''||con1 ||'''' ;
end if;if conn2 is not null then
sql:=sql||' and tab2 = '''||con2 ||'''' ;
end if;...