Gentlemen of Scriptcase below, I paste a post that was published in June 2013, and in July 2023 it has not yet been resolved or answered. 10 years! How much longer do we have to wait?
The Internal and External Libraries are basically used as reusable code, so it is logical that your functions expect input variables to produce common processes, used from different Project applications.
------- POST 2013 ------------
"When specifying the 2nd parameter for this macro, ScriptCase will generate a PHP error unless the value is hard-coded.
sc_exec_sql (“SQL Command”, “Connection”)
For example, these lines of code crashes PHP:
sc_exec_sql ($sql_command, [global_my_connection]);
sc_exec_sql ($sql_command, $thisConnection);
The same is true for the other functions I listed, when they are used in Library functions.
When used in Library functions, the PHP error I get is:
Parse error: syntax error, unexpected ‘,’ in E:\Program Files\NetMake\v7\wwwroot\scriptcase\app rialshow\Login\Login_apl.php on line 1384
It will generate a different type of error in the Events. For example, this works fine:
sc_select(my_data, “SELECT DISTINCT Access FROM myusers WHERE LoginID=‘johnxm’”, “si_local_mysql”);
BUT if I change it to:
[global_ftp_db] = ‘si_local_mysql’;
sc_select(my_data, “SELECT DISTINCT Access FROM myusers WHERE LoginID=‘johnxm’”, [global_ftp_db]);
Then I get a error on compile:
SQL ERROR’s:
Event onValidate: “SELECT DISTINCT Access FROM myusers WHERE LoginID='johnxm”, [global_ftp_db]
(Table 'sc_XXXXXXXXXX_dev.myusers ’ doesn’t exist)
(screenshot of one time I had this error is attached)
Why this is really bad for me: We have to frequently switch the database that our code uses. We need to coordinate a central database with 5-10 other servers that each run a local mySQL. I think it’s pretty common to need to use multiple connections. So I think this is a really important bug fix."