如何在PB的嵌入ORACLE的SQL查询语句
编号:QA002130
建立日期: 1999年11月30日 最后修改日期:1999年11月30日
所属类别:
lichunguang:
操作系统:nt,oracle
编程工具:powerbuilder
问题:请问各位专家,我有如下问题难以解决,请帮忙,我将非常感谢!
环境:数据库服务器为ORACLE8,开发工具为PB6。
问:如何在PB的嵌入SQL查询语句中使用ORACLE的SQL查询语句,例如:
string cxtj //存查询条件表达式
cxtj='name=lcg'
select * from student
where &cxtj;
其中,&符号为PB的后续符,在编译时出错,而在ORACLE中&表示后面的变量为查询条件表达式。
注:
select * from student
where :cxtj;
这样写是通不过的;
回答:
string sele,cxtj //存 查 询 条 件 表 达 式
cxtj="name='lcg'"
sele="select * from student where " + cxtj
execute immediate :sele;
此问题由马静回答。
| |
|
|
| |
|
|