안녕 모두,
ID 이름이 일치하는 행만 가져오는 SQL 문을 생성하려고 합니다.
SQL 문자열에 Eval 삽입을 원하는 사용자 목록이 있습니다. 문제는 작은따옴표 대신 큰따옴표로 구문 분석한다는 것입니다.
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' ) ) ;"
미리 감사드립니다.