我又来了。。通过我的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 &
"
------解决方案--------------------
有什么问题吗?
------解决方案--------------------
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
------解决方案--------------------
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了