动态数据窗口中的计算域问题?

xiongxiao 2002-11-04 04:52:52
近来因需要要使用动态数据窗口,而且要用计算域,我就用了如下的代码:
Select tab1.a,tab1.b,tab1.c,tab1.b * tab1.c,tab2.b from tab1,tab2 where tab1.a = tab2.a

为什么总是不成功,错误号好像为4200或42000
请大家快帮忙,急用。
...全文
50 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
songfrh 2002-11-27
  • 打赏
  • 举报
回复
select 里面加上tab2.a呢
killerdanny 2002-11-08
  • 打赏
  • 举报
回复 1
不成的话,就别在SQL中钻牛角尖了!
动态创建计算列
ls_syntax ="create compute(band="+nvfst_pass.string3+" alignment='2' expression=~"~~~""+nvfst_pass.string2+"~~~"~"border='"+nvfst_pass.string4+"' color='0' x='"+string(nvfi_x)+"' y='"+string(nvfi_y)+"' height='76' width='521' format='[general]' name="+nvfst_pass.string1+" font.face='Arial' font.height='-9' font.weight='400' font.family='2' font.pitch='2' font.charset='0' background.mode='2' background.color='16777215' )"
ls_syntax ="create text(band="+nvfst_pass.string3+" alignment='1' text='"+nvfst_pass.string2+"' border='"+nvfst_pass.string6+"' color='0' x='"+string(nvfi_x)+"' y='"+string(nvfi_y)+"' height='76' width='398' name="+nvfst_pass.string1+" font.face='Arial' font.height='-9' font.weight='400' font.family='2' font.pitch='2' font.charset='0' background.mode='"+nvfst_pass.string5+"' background.color='"+nvfst_pass.string4+"' ) "
ls_syntax = "create line(band=detail x1='"+string(li_x)+"' y1='"+string(li_y)+"' x2='"+string(li_x2)+"' y2='"+string(li_y2)+"' name="+ls_name+" pen.style='0' pen.width='23' pen.color='16776960' background.mode='2' background.color='16777215' ) "
dw_1.modify(ls_syntax)

保存:
string ls_syntax
string dwsyntax, ErrorBuffer

integer rtncode

ls_syntax = dw_1.modify("datawidow.syntax")


dwsyntax = dw_1.Describe("DataWindow.Syntax")

rtncode = LibraryImport("c:\pb\dwTemp.pbl", &
"d_emp", ImportDataWindow!, &
dwsyntax, ErrorBuffer

//转自中国龙论坛!
xiongxiao 2002-11-06
  • 打赏
  • 举报
回复
没人答,这问题就这么偏吗?
xiongxiao 2002-11-05
  • 打赏
  • 举报
回复
Select tab1.a,tab1.b,tab1.c,tab1.b * tab1.c,tab2.b from tab1,tab2 where tab1.a = tab2.a
可否改成:
Select tab1.a,tab1.b,tab1.c,tab1.b * tab1.c as BC之和,tab2.b from tab1,tab2 where tab1.a = tab2.a

这里能用中文吗?
xiongxiao 2002-11-05
  • 打赏
  • 举报
回复
都是实数,
错误提示为:
SQLSTATE=42000
[Sybase][ODBC Driver]Syntax error or access violation
caic 2002-11-05
  • 打赏
  • 举报
回复
tab1.b 同 tab1.c 都是整形或实数吗?
balloonman2002 2002-11-04
  • 打赏
  • 举报
回复
SQLERRTEXT?
flyhot 2002-11-04
  • 打赏
  • 举报
回复
up

606

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder DataWindow
社区管理员
  • DataWindow社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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