我又来了。。通过我的SQL语句查询出来的在DW_1中体现出来

fancydong 2012-12-11 06:00:28
我又来了。。通过我的SQL语句查询出来的在DW_1中体现出来
通过查询在Dw_1显示出来,再导出成TXT
sql=" &
SELECT convert(char(20),isnull(a.item_no,''))+convert(char(20),isnull(a.item_subname,'')) &
+convert(char(20),isnull(a.item_size,'')) &
+case when convert(int,round(a.price,2)*100)%100=0 then convert(char(9),convert(dec(9,0),a.price)) when convert(int,round(a.price,2)*100)%10=0 then convert(char(9),convert(dec(8,1),a.price)) else convert(char(9),convert(dec(7,2),a.price)) end
+case when convert(int,round(a.sale_price,2)*100)%100=0 then convert(char(9),convert(dec(9,0),a.sale_price)) when convert(int,round(a.sale_price,2)*100)%10=0 then convert(char(9),convert(dec(8,1),a.sale_price)) else convert(char(9),convert(dec(7,2),a.sale_price)) end &
+convert(char(8),item_clsno) &
+convert(char(9),0) &
FROM t_bd_item_info a &
"
...全文
119 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
A啦Dbit 2012-12-11
  • 打赏
  • 举报
回复
transaction.SyntaxFromSQL ( sqlselect, presentation, err ) integer dwcontrol.Create ( string syntax {, string errorbuffer } ) integer dwcontrol.SetTransObject ( transaction transaction ) long dwcontrol.Retrieve ( { any argument, any argument . . . } ) integer dwcontrol.SaveAs ( { string filename, saveastype saveastype, boolean colheading { , encoding encoding } } ) 依次用这几个函数就OK了
A啦Dbit 2012-12-11
  • 打赏
  • 举报
回复
string ERRORS, sql_syntax string presentation_str, dwsyntax_str sql_syntax = "SELECT emp_data.emp_id,"& + "emp_data.emp_name FROM emp_data "& + "WHERE emp_data.emp_salary > 45000" presentation_str = "style(type=grid)" dwsyntax_str = SQLCA.SyntaxFromSQL(sql_syntax, & presentation_str, ERRORS) IF Len(ERRORS) > 0 THEN MessageBox("Caution", & "SyntaxFromSQL caused these errors: " + ERRORS) RETURN END IF dw_1.Create( dwsyntax_str, ERRORS) IF Len(ERRORS) > 0 THEN MessageBox("Caution", & "Create cause these errors: " + ERRORS) RETURN END I
Liu_cy88 2012-12-11
  • 打赏
  • 举报
回复
有什么问题吗?

1,079

社区成员

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

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