各位,
我經常使用數據庫查詢,並結合自定義 sql。 我知道,有3種方法,如下所示。
我最喜歡“新的sql查詢”,因為它最強大,而且更安全(見密碼...)。
不幸的是,JMP17 中有關隱藏 ODBC 連接字符串的行為已更改,但將會得到糾正:
首選項“隱藏 ODBC 連接字符串”集上的 JMP17 行為:連接字符串... - JMP 用戶社區
在錫切斯的歐洲探索峰會上,開發人員告訴我,新的 sql 查詢方法是推薦的方法,更穩定,其他兩種方法都已經過時了。 但我也聽說有速度問題。 我從來沒有讀過這個建議,也沒有在文檔中讀過。
我想討論的是:
您使用什麼方法,為什麼?
你有哪些經歷?
謝謝並致以最誠摯的問候,
格奧爾格
Names Default To Here( 1 );
// 3 different ways for database access
// constants
sql_str = "select * from Dual"; // this works on all Oracle DB's
// needs to be adapted to your database<BR />cnx_str ="DSN=MYDSN_NAME;UID=USERNAME;PWD=PASSWORD";
// new sql query needs connection string starting with "ODBC:"
// there is no good documentation in the manual (scripting guide and JMP Help)
qry_obj = New SQL Query( query name("New SQL Query"), connection( "ODBC:"||cnx_str ), custom sql( sql_str ) );
dt_sqlquery = qry_obj << run foreground();
// open database is a oneliner
// with "Hide ODBC connection string" not set, it saves the plain password into the table scripts
dt_open = open database(cnx_str, sql_str, "Open Database");
// expecute sql needs the database opened before sending statements
// with "Hide ODBC connection string" not set, it saves the plain password into the table scripts
dbc=create database connection(cnx_str);
dt_execute = execute sql(dbc, sql_str, "Execute SQL");
close database connection(dbc);
// EOS