大家好,
我正在嘗試生成一個 SQL 語句,它只會帶來具有匹配 ID 名稱的行。
我有一個用戶列表,我想將其 Eval 插入到 SQL 字符串中。問題是它用雙引號而不是單引號來解析它。
Names default to here (1);<BR />// got the userlist from a data table using dt:users << get as matrix<BR />userlist = {"01E1B5C0651EDA80", "F62B70921920FCBE", "909D35028E2039CE", "B339888591CF1346"};
<BR />// define an SQL string to host the list of user ids
sqlstr_ =
"SELECT \!"t1\!".uid
FROM \!"Tables\!".\!"Table\!" \!"t1\!"
WHERE ( \!"t1\!".uid IN ( ^userlist^) )
;";
Eval Insert( sqlstr_logs );
// i get the following non working SQL string
"SELECT \!"t1\!".uid
FROM \!"Tables\!".\!"Table\!" \!"t1\!"
WHERE ( \!"t1\!".uid IN ( {\!"01E1B5C0651EDA80\!", \!"F62B70921920FCBE\!", \!"909D35028E2039CE\!", }) )
;"
// i would like to get the following working SQL statement
"SELECT \!"t1\!".uid
FROM \!"Tables\!".\!"Table\!" \!"t1\!"
WHERE ( \!"t1\!".uid IN ( '01E1B5C0651EDA80' , 'F62B70921920FCBE' , 'F62B70921920FCBE' ) ) ;"
非常感謝你提前。