关于数据检索的like 的小问题

string str1,str2,str3,str4
long i

i =messagebox("提示","确定删除?",question!,yesno!,2)
str3=dw_1.object.yhbm[dw_1.getrow()]
str4=dw_1.object.yhjb[dw_1.getrow()]
//str3=str3+"%"
SELECT yhbm,yhjb
into :str1,:str2
FROM cx
where yhbm like '"+str3+"%';

if i = 1 and str1='' then

DW_1.DELETEROW(DW_1.GETROW())
else
messagebox("提示","已存在下级不能删除!")
end if

我想利用SQL的模糊查询,可是取不出str1的值,大家帮个忙,看这个模糊查询like后边该怎么写
而且,我的like后边还要加条件 and yhjb<str4

[569 byte] By [incisive-泡泡随风飘] at [2008-5-20]
# 1
就是说我现在用messagebox(“提示”,STR1)取到的str1的值是空的。怎么能取到我想要的数据?
incisive-泡泡随风飘 at 2007-10-19 > top of Msdn China Tech,PowerBuilder,基础类...
# 2
谁来帮忙看看啊?问题应该不难的啊
incisive-泡泡随风飘 at 2007-10-19 > top of Msdn China Tech,PowerBuilder,基础类...
# 3
str3=str3+"%"

SELECT yhbm,yhjb
into :str1,:str2
FROM cx
where yhbm like :str3;

这样就可以了!
zcm790619-魔鬼代言人 at 2007-10-19 > top of Msdn China Tech,PowerBuilder,基础类...
# 4
s = "SELECT yhbm,yhjb into :str1,:str2 FROM cx where yhbm like '"+ str3 + "%'
EXECUTE s;

不知道行不行.
这样的东西我一般用动态DW完成.
dawugui-潇洒老乌龟 at 2007-10-19 > top of Msdn China Tech,PowerBuilder,基础类...
# 5
或者str3=str3+"%"
SELECT yhbm,yhjb
into :str1,:str2
FROM cx
where yhbm like :str3;
dawugui-潇洒老乌龟 at 2007-10-19 > top of Msdn China Tech,PowerBuilder,基础类...
# 6
where yhbm like '"+ :str3 +"%';
polestarxu-一点星光 at 2007-10-19 > top of Msdn China Tech,PowerBuilder,基础类...
# 7
str3=str3+"%"
SELECT yhbm,yhjb
into :str1,:str2
FROM cx
where yhbm like :str3;
# 8
谢谢大家,问题解决~!
incisive-泡泡随风飘 at 2007-10-19 > top of Msdn China Tech,PowerBuilder,基础类...