数据窗口问题!急!

deliadelia 2003-09-23 09:04:35
我有一个dw,里面包含两张表,a:型号,名称,厂家;b:型号,现有库存,现有库存可用量。a的关键字是型号,b的关键字是id,我要通过对型号的查询,显示与这个型号相关的dw里的内容,有什么办法可以实现?
如果数据窗口中从更多表的提取数据呢?谢谢!
...全文
29 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
deliadelia 2003-09-23
  • 打赏
  • 举报
回复
以上代码执行时会提示错误:expression is not valid
wuhanjuan 2003-09-23
  • 打赏
  • 举报
回复
按楼上的就能实现
up 喽
deliadelia 2003-09-23
  • 打赏
  • 举报
回复
能否看一下我的代码:string ls_model,ls_name,ls_factory
long now_number,total_number,number,number1

ls_model=trim(sle_1.text)
dw_1.settransobject(sqlca)
select model into :ls_model from now where now.model=:ls_model;
select factory into :ls_factory from basic where basic.model=:ls_model;
select name into :ls_name from basic where basic.model=:ls_model;
select now_number into :number from now where now.model=:ls_model;
select total_number into :number1 from now where now.model=:ls_model;


dw_1.setfilter("model='" + ls_model + "'")
dw_1.filter()
dw_1.retrieve(ls_model)
qiyousyc 2003-09-23
  • 打赏
  • 举报
回复
直接select 表.字段 .... from 表1,表2 where 表1.型号=表2.型号
workhand 2003-09-23
  • 打赏
  • 举报
回复
也可以用主子表形式,主显示a表,子显示b表多条数据
wantsong 2003-09-23
  • 打赏
  • 举报
回复
select a.型号,a.名称,a.厂家,b.型号,b.现有库存,b.现有库存可用量
from a ,b
where a.型号 = b.型号
and a.型号 = :ls_model
________________________________________________
mmjhcg 2003-09-23
  • 打赏
  • 举报
回复
可以嵌套一个DW

1,108

社区成员

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

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