SQL的语句查询(在线等待)

hj12 2002-12-19 03:50:38
string uid0,udep,uid1,uid2
uid0=ddlb_1.text;
udep=ddlb_2.text;
if(udep="上司") then
select fuid
into :uid1
from tinfor
where uid=:uid0
connect using SQLCA;
select *
from pinfor
where uid=:uid1
connect using SQLCA;
end if
我要实现2个表的连接查询可是上面的代码有错误!
谁能帮我一下~!
...全文
39 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
ropriest 2002-12-19
  • 打赏
  • 举报
回复
If (udep="上司") Then
select *
from pinfor
where uid in (select fuid from tinfor where uid=:uid0)
End If

是否可以实现你要的功能?
bomber2001 2002-12-19
  • 打赏
  • 举报
回复
select *
from pinfor
where uid=:uid1
connect using SQLCA;
不行吧!同意楼上的
select * into :x,:y.....
from pinfor
where uid=:uid1
using SQLCA;
songfrh 2002-12-19
  • 打赏
  • 举报
回复
select *
from pinfor
where uid=:uid1 ; //加分号
不能这样写
必须带有into
qqqdong 2002-12-19
  • 打赏
  • 举报
回复
select a.* from pinfor a,tinfor b where b.uid=:uid0 and a.uid = b.fuid
使用这个做一个带参数的datawindow
if(udep="上司") then
dw.Retrieve(ddlb_1.text)
end if
hj12 2002-12-19
  • 打赏
  • 举报
回复
照你们的改了还是系统错误!
songfrh 2002-12-19
  • 打赏
  • 举报
回复
string uid0,udep,uid1,uid2
uid0=ddlb_1.text;
udep=ddlb_2.text;
if(udep="上司") then
select fuid
into :uid1
from tinfor
where uid=:uid0 ; //加分号
connect using SQLCA;
select *
from pinfor
where uid=:uid1 ; //加分号
connect using SQLCA;
end if
qqqdong 2002-12-19
  • 打赏
  • 举报
回复
string uid0,udep,uid1,uid2
uid0=ddlb_1.text;
udep=ddlb_2.text;
if(udep="上司") then
connect using sqlca;
select fuid into :uid1 from tinfor where uid=:uid0;
select * from pinfor where uid=:uid1;
end if
//select * from pinfor where uid=:uid1;
因为返回的是多条记录,所以必须使用datawindow或动态datawindow
connect using sqlca;最好在application.open事件中写
disconnect using sqlca;在application.close事件中写
sweettaowa 2002-12-19
  • 打赏
  • 举报
回复
把connect 去掉,试

1,108

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧